Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
abc
Commits
80fdd58c
Commit
80fdd58c
authored
Jul 28, 2016
by
Mathias Soeken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Several updates to exact synthesis.
parent
0f1624e5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
14 deletions
+64
-14
src/base/abc/abc.h
+1
-1
src/base/abci/abc.c
+63
-13
src/base/abci/abcExact.c
+0
-0
No files found.
src/base/abc/abc.h
View file @
80fdd58c
...
...
@@ -643,7 +643,7 @@ extern ABC_DLL int Abc_NtkIsAcyclic( Abc_Ntk_t * pNtk );
extern
ABC_DLL
int
Abc_NtkIsAcyclicWithBoxes
(
Abc_Ntk_t
*
pNtk
);
extern
ABC_DLL
Vec_Ptr_t
*
Abc_AigGetLevelizedOrder
(
Abc_Ntk_t
*
pNtk
,
int
fCollectCis
);
/*=== abcExact.c ==========================================================*/
extern
ABC_DLL
Abc_Ntk_t
*
Abc_NtkFindExact
(
word
*
pTruth
,
int
nVars
,
int
nFunc
,
int
nMaxDepth
,
int
fVerbose
);
extern
ABC_DLL
Abc_Ntk_t
*
Abc_NtkFindExact
(
word
*
pTruth
,
int
nVars
,
int
nFunc
,
int
nMaxDepth
,
int
*
pArrivalTimes
,
int
fVerbose
);
/*=== abcFanio.c ==========================================================*/
extern
ABC_DLL
void
Abc_ObjAddFanin
(
Abc_Obj_t
*
pObj
,
Abc_Obj_t
*
pFanin
);
extern
ABC_DLL
void
Abc_ObjDeleteFanin
(
Abc_Obj_t
*
pObj
,
Abc_Obj_t
*
pFanin
);
...
...
src/base/abci/abc.c
View file @
80fdd58c
...
...
@@ -7284,12 +7284,15 @@ usage:
***********************************************************************/
int
Abc_CommandExact
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
int
c
,
nMaxDepth
=
-
1
,
fVerbose
=
0
,
nVars
;
word
pTruth
[
1
];
extern
Gia_Man_t
*
Gia_ManFindExact
(
word
*
pTruth
,
int
nVars
,
int
nFunc
,
int
nMaxDepth
,
int
*
pArrivalTimes
,
int
fVerbose
);
int
c
,
nMaxDepth
=
-
1
,
fMakeAIG
=
0
,
fTest
=
0
,
fVerbose
=
0
,
nVars
=
0
,
nVarsTmp
,
nFunc
=
0
;
word
pTruth
[
64
];
Abc_Ntk_t
*
pNtkRes
;
Gia_Man_t
*
pGiaRes
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"Dvh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"D
at
vh"
)
)
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -7304,6 +7307,12 @@ int Abc_CommandExact( Abc_Frame_t * pAbc, int argc, char ** argv )
if
(
nMaxDepth
<
0
)
goto
usage
;
break
;
case
'a'
:
fMakeAIG
^=
1
;
break
;
case
't'
:
fTest
^=
1
;
break
;
case
'v'
:
fVerbose
^=
1
;
break
;
...
...
@@ -7314,23 +7323,64 @@ int Abc_CommandExact( Abc_Frame_t * pAbc, int argc, char ** argv )
}
}
if
(
argc
!=
globalUtilOptind
+
1
)
if
(
fTest
)
{
extern
void
Abc_ExactTest
();
printf
(
"run test suite, ignore all other settings
\n
"
);
Abc_ExactTest
(
fVerbose
);
return
0
;
}
if
(
argc
==
globalUtilOptind
)
goto
usage
;
memset
(
pTruth
,
0
,
64
);
while
(
globalUtilOptind
<
argc
)
{
if
(
nFunc
==
16
)
{
Abc_Print
(
-
1
,
"Too many functions (at most 16 supported).
\n
"
);
goto
usage
;
}
nVarsTmp
=
Abc_TtReadHex
(
&
pTruth
[
nFunc
<<
2
],
argv
[
globalUtilOptind
++
]
);
nFunc
++
;
if
(
nVars
==
0
)
nVars
=
nVarsTmp
;
else
if
(
nVars
>
8
)
{
Abc_Print
(
-
1
,
"Only 8-variable functions are supported.
\n
"
);
goto
usage
;
}
else
if
(
nVars
!=
nVarsTmp
)
{
Abc_Print
(
-
1
,
"All functions need to have the same size.
\n
"
);
goto
usage
;
}
}
nVars
=
Abc_TtReadHex
(
pTruth
,
argv
[
globalUtilOptind
]
);
pNtkRes
=
Abc_NtkFindExact
(
pTruth
,
nVars
,
1
,
nMaxDepth
,
fVerbose
);
assert
(
pNtkRes
!=
NULL
);
Abc_FrameReplaceCurrentNetwork
(
pAbc
,
pNtkRes
);
Abc_FrameClearVerifStatus
(
pAbc
);
if
(
fMakeAIG
)
{
pGiaRes
=
Gia_ManFindExact
(
pTruth
,
nVars
,
nFunc
,
nMaxDepth
,
NULL
,
fVerbose
);
assert
(
pGiaRes
!=
NULL
);
Abc_FrameUpdateGia
(
pAbc
,
pGiaRes
);
}
else
{
pNtkRes
=
Abc_NtkFindExact
(
pTruth
,
nVars
,
nFunc
,
nMaxDepth
,
NULL
,
fVerbose
);
assert
(
pNtkRes
!=
NULL
);
Abc_FrameReplaceCurrentNetwork
(
pAbc
,
pNtkRes
);
Abc_FrameClearVerifStatus
(
pAbc
);
}
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: exact [-vh] <truth>
\n
"
);
Abc_Print
(
-
2
,
"
\t
finds optimum networks using SAT-based exact synthesis for hex truth table <truth>
\n
"
);
Abc_Print
(
-
2
,
"
\t
-D <num> : constrain maximum depth
\n
"
);
Abc_Print
(
-
2
,
"
\t
-v : toggle verbose printout [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"usage: exact [-D <num>] [-atvh] <truth1> <truth2> ...
\n
"
);
Abc_Print
(
-
2
,
"
\t
finds optimum networks using SAT-based exact synthesis for hex truth tables <truth1> <truth2> ...
\n
"
);
Abc_Print
(
-
2
,
"
\t
-D <num> : constrain maximum depth (if too low, algorithm may not terminate)
\n
"
);
Abc_Print
(
-
2
,
"
\t
-a : create AIG [default = %s]
\n
"
,
fMakeAIG
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-t : run test suite
\n
"
);
Abc_Print
(
-
2
,
"
\t
-v : toggle verbose printout [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
Abc_Print
(
-
2
,
"
\t\n
"
);
Abc_Print
(
-
2
,
"
\t
This command was contributed by Mathias Soeken from EPFL in July 2016.
\n
"
);
src/base/abci/abcExact.c
View file @
80fdd58c
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment