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
e5636522
Commit
e5636522
authored
Aug 25, 2016
by
Mathias Soeken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BMS fixes and start gates parameter.
parent
360e85fc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
26 deletions
+34
-26
src/base/abc/abc.h
+1
-1
src/base/abci/abc.c
+18
-6
src/base/abci/abcExact.c
+15
-19
No files found.
src/base/abc/abc.h
View file @
e5636522
...
...
@@ -646,7 +646,7 @@ extern ABC_DLL Vec_Ptr_t * Abc_AigGetLevelizedOrder( Abc_Ntk_t * pNtk, in
extern
ABC_DLL
int
Abc_ExactInputNum
();
extern
ABC_DLL
int
Abc_ExactIsRunning
();
extern
ABC_DLL
Abc_Obj_t
*
Abc_ExactBuildNode
(
word
*
pTruth
,
int
nVars
,
int
*
pArrTimeProfile
,
Abc_Obj_t
**
pFanins
,
Abc_Ntk_t
*
pNtk
);
extern
ABC_DLL
Abc_Ntk_t
*
Abc_NtkFindExact
(
word
*
pTruth
,
int
nVars
,
int
nFunc
,
int
nMaxDepth
,
int
*
pArrivalTimes
,
int
nBTLimit
,
int
fVerbose
);
extern
ABC_DLL
Abc_Ntk_t
*
Abc_NtkFindExact
(
word
*
pTruth
,
int
nVars
,
int
nFunc
,
int
nMaxDepth
,
int
*
pArrivalTimes
,
int
nBTLimit
,
int
nStartGates
,
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 @
e5636522
...
...
@@ -7291,9 +7291,9 @@ usage:
***********************************************************************/
int
Abc_CommandExact
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
extern
Gia_Man_t
*
Gia_ManFindExact
(
word
*
pTruth
,
int
nVars
,
int
nFunc
,
int
nMaxDepth
,
int
*
pArrivalTimes
,
int
nBTLimit
,
int
fVerbose
);
extern
Gia_Man_t
*
Gia_ManFindExact
(
word
*
pTruth
,
int
nVars
,
int
nFunc
,
int
nMaxDepth
,
int
*
pArrivalTimes
,
int
nBTLimit
,
int
nStartGates
,
int
fVerbose
);
int
c
,
nMaxDepth
=
-
1
,
fMakeAIG
=
0
,
fTest
=
0
,
fVerbose
=
0
,
nVars
=
0
,
nVarsTmp
,
nFunc
=
0
,
nBTLimit
=
100
;
int
c
,
nMaxDepth
=
-
1
,
fMakeAIG
=
0
,
fTest
=
0
,
fVerbose
=
0
,
nVars
=
0
,
nVarsTmp
,
nFunc
=
0
,
n
StartGates
=
1
,
n
BTLimit
=
100
;
char
*
p1
,
*
p2
;
word
pTruth
[
64
];
int
pArrTimeProfile
[
8
],
fHasArrTimeProfile
=
0
;
...
...
@@ -7301,7 +7301,7 @@ int Abc_CommandExact( Abc_Frame_t * pAbc, int argc, char ** argv )
Gia_Man_t
*
pGiaRes
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"DACatvh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"DA
S
Catvh"
)
)
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -7341,6 +7341,17 @@ int Abc_CommandExact( Abc_Frame_t * pAbc, int argc, char ** argv )
++
p2
;
}
break
;
case
'S'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-S
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
nStartGates
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
nStartGates
<
1
)
goto
usage
;
break
;
case
'C'
:
if
(
globalUtilOptind
>=
argc
)
{
...
...
@@ -7406,7 +7417,7 @@ int Abc_CommandExact( Abc_Frame_t * pAbc, int argc, char ** argv )
if
(
fMakeAIG
)
{
pGiaRes
=
Gia_ManFindExact
(
pTruth
,
nVars
,
nFunc
,
nMaxDepth
,
fHasArrTimeProfile
?
pArrTimeProfile
:
NULL
,
nBTLimit
,
fVerbose
);
pGiaRes
=
Gia_ManFindExact
(
pTruth
,
nVars
,
nFunc
,
nMaxDepth
,
fHasArrTimeProfile
?
pArrTimeProfile
:
NULL
,
nBTLimit
,
nStartGates
-
1
,
fVerbose
);
if
(
pGiaRes
)
Abc_FrameUpdateGia
(
pAbc
,
pGiaRes
);
else
...
...
@@ -7414,7 +7425,7 @@ int Abc_CommandExact( Abc_Frame_t * pAbc, int argc, char ** argv )
}
else
{
pNtkRes
=
Abc_NtkFindExact
(
pTruth
,
nVars
,
nFunc
,
nMaxDepth
,
fHasArrTimeProfile
?
pArrTimeProfile
:
NULL
,
nBTLimit
,
fVerbose
);
pNtkRes
=
Abc_NtkFindExact
(
pTruth
,
nVars
,
nFunc
,
nMaxDepth
,
fHasArrTimeProfile
?
pArrTimeProfile
:
NULL
,
nBTLimit
,
nStartGates
-
1
,
fVerbose
);
if
(
pNtkRes
)
{
Abc_FrameReplaceCurrentNetwork
(
pAbc
,
pNtkRes
);
...
...
@@ -7426,10 +7437,11 @@ int Abc_CommandExact( Abc_Frame_t * pAbc, int argc, char ** argv )
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: exact [-D
<num
>] [-atvh] <truth1> <truth2> ...
\n
"
);
Abc_Print
(
-
2
,
"usage: exact [-D
SC <num>] [-A <list
>] [-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 <list> : input arrival times (comma separated list)
\n
"
);
Abc_Print
(
-
2
,
"
\t
-S <num> : number of start gates in search [default = %s]
\n
"
,
nStartGates
);
Abc_Print
(
-
2
,
"
\t
-C <num> : the limit on the number of conflicts [default = %d]
\n
"
,
nBTLimit
);
Abc_Print
(
-
2
,
"
\t
-a : toggle create AIG [default = %s]
\n
"
,
fMakeAIG
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-t : run test suite
\n
"
);
src/base/abci/abcExact.c
View file @
e5636522
...
...
@@ -966,17 +966,11 @@ static int Ses_ManCreateClauses( Ses_Man_t * pSes )
{
pLits
[
0
]
=
Abc_Var2Lit
(
Ses_ManOutputVar
(
pSes
,
0
,
i
),
1
);
if
(
!
sat_solver_addclause
(
pSes
->
pSat
,
pLits
,
pLits
+
1
)
)
{
Vec_IntFree
(
vLits
);
return
0
;
}
}
pLits
[
0
]
=
Abc_Var2Lit
(
Ses_ManOutputVar
(
pSes
,
0
,
pSes
->
nGates
-
1
),
0
);
if
(
!
sat_solver_addclause
(
pSes
->
pSat
,
pLits
,
pLits
+
1
)
)
{
Vec_IntFree
(
vLits
);
return
0
;
}
vLits
=
Vec_IntAlloc
(
0u
);
}
...
...
@@ -1744,7 +1738,7 @@ static int Ses_ManFindMinimumSize( Ses_Man_t * pSes )
pSes
->
fHitResLimit
=
0
;
/* do the arrival times allow for a network? */
if
(
pSes
->
nMaxDepth
!=
-
1
&&
!
Ses_CheckDepthConsistency
(
pSes
)
)
if
(
pSes
->
nMaxDepth
!=
-
1
&&
pSes
->
pArrTimeProfile
&&
!
Ses_CheckDepthConsistency
(
pSes
)
)
return
0
;
//Ses_ManStoreDepthAndArrivalTimes( pSes );
...
...
@@ -1818,7 +1812,7 @@ static int Ses_ManFindMinimumSize( Ses_Man_t * pSes )
SeeAlso []
***********************************************************************/
Abc_Ntk_t
*
Abc_NtkFindExact
(
word
*
pTruth
,
int
nVars
,
int
nFunc
,
int
nMaxDepth
,
int
*
pArrTimeProfile
,
int
nBTLimit
,
int
fVerbose
)
Abc_Ntk_t
*
Abc_NtkFindExact
(
word
*
pTruth
,
int
nVars
,
int
nFunc
,
int
nMaxDepth
,
int
*
pArrTimeProfile
,
int
nBTLimit
,
int
nStartGates
,
int
fVerbose
)
{
Ses_Man_t
*
pSes
;
char
*
pSol
;
...
...
@@ -1831,6 +1825,7 @@ Abc_Ntk_t * Abc_NtkFindExact( word * pTruth, int nVars, int nFunc, int nMaxDepth
timeStart
=
Abc_Clock
();
pSes
=
Ses_ManAlloc
(
pTruth
,
nVars
,
nFunc
,
nMaxDepth
,
pArrTimeProfile
,
0
,
nBTLimit
,
fVerbose
);
pSes
->
nStartGates
=
nStartGates
;
if
(
fVerbose
)
Ses_ManPrintFuncs
(
pSes
);
...
...
@@ -1852,7 +1847,7 @@ Abc_Ntk_t * Abc_NtkFindExact( word * pTruth, int nVars, int nFunc, int nMaxDepth
return
pNtk
;
}
Gia_Man_t
*
Gia_ManFindExact
(
word
*
pTruth
,
int
nVars
,
int
nFunc
,
int
nMaxDepth
,
int
*
pArrTimeProfile
,
int
nBTLimit
,
int
fVerbose
)
Gia_Man_t
*
Gia_ManFindExact
(
word
*
pTruth
,
int
nVars
,
int
nFunc
,
int
nMaxDepth
,
int
*
pArrTimeProfile
,
int
nBTLimit
,
int
nStartGates
,
int
fVerbose
)
{
Ses_Man_t
*
pSes
;
char
*
pSol
;
...
...
@@ -1865,6 +1860,7 @@ Gia_Man_t * Gia_ManFindExact( word * pTruth, int nVars, int nFunc, int nMaxDepth
timeStart
=
Abc_Clock
();
pSes
=
Ses_ManAlloc
(
pTruth
,
nVars
,
nFunc
,
nMaxDepth
,
pArrTimeProfile
,
1
,
nBTLimit
,
fVerbose
);
pSes
->
nStartGates
=
nStartGates
;
pSes
->
fVeryVerbose
=
1
;
pSes
->
fExtractVerbose
=
1
;
pSes
->
fSatVerbose
=
1
;
...
...
@@ -1920,30 +1916,30 @@ void Abc_ExactTestSingleOutput( int fVerbose )
pNtk
=
Abc_NtkFromTruthTable
(
pTruth
,
4
);
pNtk2
=
Abc_NtkFindExact
(
pTruth
,
4
,
1
,
-
1
,
NULL
,
0
,
fVerbose
);
pNtk2
=
Abc_NtkFindExact
(
pTruth
,
4
,
1
,
-
1
,
NULL
,
0
,
0
,
fVerbose
);
Abc_NtkShortNames
(
pNtk2
);
Abc_NtkCecSat
(
pNtk
,
pNtk2
,
10000
,
0
);
assert
(
pNtk2
);
assert
(
Abc_NtkNodeNum
(
pNtk2
)
==
6
);
Abc_NtkDelete
(
pNtk2
);
pNtk3
=
Abc_NtkFindExact
(
pTruth
,
4
,
1
,
3
,
NULL
,
0
,
fVerbose
);
pNtk3
=
Abc_NtkFindExact
(
pTruth
,
4
,
1
,
3
,
NULL
,
0
,
0
,
fVerbose
);
Abc_NtkShortNames
(
pNtk3
);
Abc_NtkCecSat
(
pNtk
,
pNtk3
,
10000
,
0
);
assert
(
pNtk3
);
assert
(
Abc_NtkLevel
(
pNtk3
)
<=
3
);
Abc_NtkDelete
(
pNtk3
);
pNtk4
=
Abc_NtkFindExact
(
pTruth
,
4
,
1
,
9
,
pArrTimeProfile
,
50000
,
fVerbose
);
pNtk4
=
Abc_NtkFindExact
(
pTruth
,
4
,
1
,
9
,
pArrTimeProfile
,
50000
,
0
,
fVerbose
);
Abc_NtkShortNames
(
pNtk4
);
Abc_NtkCecSat
(
pNtk
,
pNtk4
,
10000
,
0
);
assert
(
pNtk4
);
assert
(
Abc_NtkLevel
(
pNtk4
)
<=
9
);
Abc_NtkDelete
(
pNtk4
);
assert
(
!
Abc_NtkFindExact
(
pTruth
,
4
,
1
,
2
,
NULL
,
50000
,
fVerbose
)
);
assert
(
!
Abc_NtkFindExact
(
pTruth
,
4
,
1
,
2
,
NULL
,
50000
,
0
,
fVerbose
)
);
assert
(
!
Abc_NtkFindExact
(
pTruth
,
4
,
1
,
8
,
pArrTimeProfile
,
50000
,
fVerbose
)
);
assert
(
!
Abc_NtkFindExact
(
pTruth
,
4
,
1
,
8
,
pArrTimeProfile
,
50000
,
0
,
fVerbose
)
);
Abc_NtkDelete
(
pNtk
);
}
...
...
@@ -1962,27 +1958,27 @@ void Abc_ExactTestSingleOutputAIG( int fVerbose )
Abc_NtkToAig
(
pNtk
);
pGia
=
Abc_NtkAigToGia
(
pNtk
,
1
);
pGia2
=
Gia_ManFindExact
(
pTruth
,
4
,
1
,
-
1
,
NULL
,
0
,
fVerbose
);
pGia2
=
Gia_ManFindExact
(
pTruth
,
4
,
1
,
-
1
,
NULL
,
0
,
0
,
fVerbose
);
pMiter
=
Gia_ManMiter
(
pGia
,
pGia2
,
0
,
1
,
0
,
0
,
1
);
assert
(
pMiter
);
Cec_ManVerify
(
pMiter
,
pPars
);
Gia_ManStop
(
pMiter
);
pGia3
=
Gia_ManFindExact
(
pTruth
,
4
,
1
,
3
,
NULL
,
0
,
fVerbose
);
pGia3
=
Gia_ManFindExact
(
pTruth
,
4
,
1
,
3
,
NULL
,
0
,
0
,
fVerbose
);
pMiter
=
Gia_ManMiter
(
pGia
,
pGia3
,
0
,
1
,
0
,
0
,
1
);
assert
(
pMiter
);
Cec_ManVerify
(
pMiter
,
pPars
);
Gia_ManStop
(
pMiter
);
pGia4
=
Gia_ManFindExact
(
pTruth
,
4
,
1
,
9
,
pArrTimeProfile
,
50000
,
fVerbose
);
pGia4
=
Gia_ManFindExact
(
pTruth
,
4
,
1
,
9
,
pArrTimeProfile
,
50000
,
0
,
fVerbose
);
pMiter
=
Gia_ManMiter
(
pGia
,
pGia4
,
0
,
1
,
0
,
0
,
1
);
assert
(
pMiter
);
Cec_ManVerify
(
pMiter
,
pPars
);
Gia_ManStop
(
pMiter
);
assert
(
!
Gia_ManFindExact
(
pTruth
,
4
,
1
,
2
,
NULL
,
50000
,
fVerbose
)
);
assert
(
!
Gia_ManFindExact
(
pTruth
,
4
,
1
,
2
,
NULL
,
50000
,
0
,
fVerbose
)
);
assert
(
!
Gia_ManFindExact
(
pTruth
,
4
,
1
,
8
,
pArrTimeProfile
,
50000
,
fVerbose
)
);
assert
(
!
Gia_ManFindExact
(
pTruth
,
4
,
1
,
8
,
pArrTimeProfile
,
50000
,
0
,
fVerbose
)
);
Gia_ManStop
(
pGia
);
Gia_ManStop
(
pGia2
);
...
...
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