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
b5e0b7d4
Commit
b5e0b7d4
authored
Oct 13, 2015
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Experiments with precomputation and matching.
parent
9df63f52
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
19 deletions
+26
-19
src/base/abci/abc.c
+20
-16
src/opt/sfm/sfm.h
+2
-0
src/opt/sfm/sfmDec.c
+0
-0
src/opt/sfm/sfmInt.h
+2
-1
src/opt/sfm/sfmLib.c
+2
-2
No files found.
src/base/abci/abc.c
View file @
b5e0b7d4
...
@@ -5160,7 +5160,7 @@ int Abc_CommandMfs3( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -5160,7 +5160,7 @@ int Abc_CommandMfs3( Abc_Frame_t * pAbc, int argc, char ** argv )
// set defaults
// set defaults
Sfm_ParSetDefault3
(
pPars
);
Sfm_ParSetDefault3
(
pPars
);
Extra_UtilGetoptReset
();
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"OIF
XMLCNda
ovwh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"OIF
LHMCNdaz
ovwh"
)
)
!=
EOF
)
{
{
switch
(
c
)
switch
(
c
)
{
{
...
@@ -5200,37 +5200,37 @@ int Abc_CommandMfs3( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -5200,37 +5200,37 @@ int Abc_CommandMfs3( Abc_Frame_t * pAbc, int argc, char ** argv )
if
(
pPars
->
nFanoutMax
<
0
)
if
(
pPars
->
nFanoutMax
<
0
)
goto
usage
;
goto
usage
;
break
;
break
;
case
'
X
'
:
case
'
L
'
:
if
(
globalUtilOptind
>=
argc
)
if
(
globalUtilOptind
>=
argc
)
{
{
Abc_Print
(
-
1
,
"Command line switch
\"
-
X
\"
should be followed by an integer.
\n
"
);
Abc_Print
(
-
1
,
"Command line switch
\"
-
L
\"
should be followed by an integer.
\n
"
);
goto
usage
;
goto
usage
;
}
}
pPars
->
nMffcM
ax
=
atoi
(
argv
[
globalUtilOptind
]);
pPars
->
nMffcM
in
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
globalUtilOptind
++
;
if
(
pPars
->
nMffcM
ax
<
0
)
if
(
pPars
->
nMffcM
in
<
0
)
goto
usage
;
goto
usage
;
break
;
break
;
case
'
M
'
:
case
'
H
'
:
if
(
globalUtilOptind
>=
argc
)
if
(
globalUtilOptind
>=
argc
)
{
{
Abc_Print
(
-
1
,
"Command line switch
\"
-
M
\"
should be followed by an integer.
\n
"
);
Abc_Print
(
-
1
,
"Command line switch
\"
-
H
\"
should be followed by an integer.
\n
"
);
goto
usage
;
goto
usage
;
}
}
pPars
->
n
WinSize
Max
=
atoi
(
argv
[
globalUtilOptind
]);
pPars
->
n
Mffc
Max
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
globalUtilOptind
++
;
if
(
pPars
->
n
WinSize
Max
<
0
)
if
(
pPars
->
n
Mffc
Max
<
0
)
goto
usage
;
goto
usage
;
break
;
break
;
case
'
L
'
:
case
'
M
'
:
if
(
globalUtilOptind
>=
argc
)
if
(
globalUtilOptind
>=
argc
)
{
{
Abc_Print
(
-
1
,
"Command line switch
\"
-
L
\"
should be followed by an integer.
\n
"
);
Abc_Print
(
-
1
,
"Command line switch
\"
-
M
\"
should be followed by an integer.
\n
"
);
goto
usage
;
goto
usage
;
}
}
pPars
->
n
GrowthLevel
=
atoi
(
argv
[
globalUtilOptind
]);
pPars
->
n
WinSizeMax
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
globalUtilOptind
++
;
if
(
pPars
->
n
GrowthLevel
<
-
ABC_INFINITY
||
pPars
->
nGrowthLevel
>
ABC_INFINITY
)
if
(
pPars
->
n
WinSizeMax
<
0
)
goto
usage
;
goto
usage
;
break
;
break
;
case
'C'
:
case
'C'
:
...
@@ -5258,6 +5258,9 @@ int Abc_CommandMfs3( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -5258,6 +5258,9 @@ int Abc_CommandMfs3( Abc_Frame_t * pAbc, int argc, char ** argv )
case
'a'
:
case
'a'
:
pPars
->
fArea
^=
1
;
pPars
->
fArea
^=
1
;
break
;
break
;
case
'z'
:
pPars
->
fZeroCost
^=
1
;
break
;
case
'o'
:
case
'o'
:
pPars
->
fRrOnly
^=
1
;
pPars
->
fRrOnly
^=
1
;
break
;
break
;
...
@@ -5288,17 +5291,18 @@ int Abc_CommandMfs3( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -5288,17 +5291,18 @@ int Abc_CommandMfs3( Abc_Frame_t * pAbc, int argc, char ** argv )
return
0
;
return
0
;
usage:
usage:
Abc_Print
(
-
2
,
"usage: mfs3 [-OIF
XMLCN <num>] [-a
ovwh]
\n
"
);
Abc_Print
(
-
2
,
"usage: mfs3 [-OIF
LHMCN <num>] [-az
ovwh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
performs don't-care-based optimization of mapped networks
\n
"
);
Abc_Print
(
-
2
,
"
\t
performs don't-care-based optimization of mapped networks
\n
"
);
Abc_Print
(
-
2
,
"
\t
-O <num> : the number of levels in the TFO cone (0 <= num) [default = %d]
\n
"
,
pPars
->
nTfoLevMax
);
Abc_Print
(
-
2
,
"
\t
-O <num> : the number of levels in the TFO cone (0 <= num) [default = %d]
\n
"
,
pPars
->
nTfoLevMax
);
Abc_Print
(
-
2
,
"
\t
-I <num> : the number of levels in the TFI cone (1 <= num) [default = %d]
\n
"
,
pPars
->
nTfiLevMax
);
Abc_Print
(
-
2
,
"
\t
-I <num> : the number of levels in the TFI cone (1 <= num) [default = %d]
\n
"
,
pPars
->
nTfiLevMax
);
Abc_Print
(
-
2
,
"
\t
-F <num> : the max number of fanouts to skip (1 <= num) [default = %d]
\n
"
,
pPars
->
nFanoutMax
);
Abc_Print
(
-
2
,
"
\t
-F <num> : the max number of fanouts to skip (1 <= num) [default = %d]
\n
"
,
pPars
->
nFanoutMax
);
Abc_Print
(
-
2
,
"
\t
-X <num> : the max size of max fanout-free cone (MFFC) [default = %d]
\n
"
,
pPars
->
nMffcMax
);
Abc_Print
(
-
2
,
"
\t
-L <num> : the min size of max fanout-free cone (MFFC) [default = %d]
\n
"
,
pPars
->
nMffcMin
);
Abc_Print
(
-
2
,
"
\t
-H <num> : the max size of max fanout-free cone (MFFC) [default = %d]
\n
"
,
pPars
->
nMffcMax
);
Abc_Print
(
-
2
,
"
\t
-M <num> : the max node count of windows to consider (0 = no limit) [default = %d]
\n
"
,
pPars
->
nWinSizeMax
);
Abc_Print
(
-
2
,
"
\t
-M <num> : the max node count of windows to consider (0 = no limit) [default = %d]
\n
"
,
pPars
->
nWinSizeMax
);
Abc_Print
(
-
2
,
"
\t
-L <num> : the max increase in node level after resynthesis (0 <= num) [default = %d]
\n
"
,
pPars
->
nGrowthLevel
);
Abc_Print
(
-
2
,
"
\t
-C <num> : the max number of conflicts in one SAT run (0 = no limit) [default = %d]
\n
"
,
pPars
->
nBTLimit
);
Abc_Print
(
-
2
,
"
\t
-C <num> : the max number of conflicts in one SAT run (0 = no limit) [default = %d]
\n
"
,
pPars
->
nBTLimit
);
Abc_Print
(
-
2
,
"
\t
-N <num> : the max number of nodes to try (0 = all) [default = %d]
\n
"
,
pPars
->
nNodesMax
);
Abc_Print
(
-
2
,
"
\t
-N <num> : the max number of nodes to try (0 = all) [default = %d]
\n
"
,
pPars
->
nNodesMax
);
Abc_Print
(
-
2
,
"
\t
-a : toggle minimizing area or area+edges [default = %s]
\n
"
,
pPars
->
fArea
?
"area"
:
"area+edges"
);
Abc_Print
(
-
2
,
"
\t
-a : toggle minimizing area or area+edges [default = %s]
\n
"
,
pPars
->
fArea
?
"area"
:
"area+edges"
);
Abc_Print
(
-
2
,
"
\t
-z : toggle zero-cost replacements [default = %s]
\n
"
,
pPars
->
fZeroCost
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-o : toggle using old implementation for comparison [default = %s]
\n
"
,
pPars
->
fRrOnly
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-o : toggle using old implementation for comparison [default = %s]
\n
"
,
pPars
->
fRrOnly
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-v : toggle printing optimization summary [default = %s]
\n
"
,
pPars
->
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-v : toggle printing optimization summary [default = %s]
\n
"
,
pPars
->
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-w : toggle printing detailed stats for each node [default = %s]
\n
"
,
pPars
->
fVeryVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-w : toggle printing detailed stats for each node [default = %s]
\n
"
,
pPars
->
fVeryVerbose
?
"yes"
:
"no"
);
src/opt/sfm/sfm.h
View file @
b5e0b7d4
...
@@ -46,6 +46,7 @@ struct Sfm_Par_t_
...
@@ -46,6 +46,7 @@ struct Sfm_Par_t_
int
nTfiLevMax
;
// the maximum fanin levels
int
nTfiLevMax
;
// the maximum fanin levels
int
nFanoutMax
;
// the maximum number of fanouts
int
nFanoutMax
;
// the maximum number of fanouts
int
nDepthMax
;
// the maximum depth to try
int
nDepthMax
;
// the maximum depth to try
int
nMffcMin
;
// the minimum MFFC size
int
nMffcMax
;
// the maximum MFFC size
int
nMffcMax
;
// the maximum MFFC size
int
nWinSizeMax
;
// the maximum window size
int
nWinSizeMax
;
// the maximum window size
int
nGrowthLevel
;
// the maximum allowed growth in level
int
nGrowthLevel
;
// the maximum allowed growth in level
...
@@ -55,6 +56,7 @@ struct Sfm_Par_t_
...
@@ -55,6 +56,7 @@ struct Sfm_Par_t_
int
fRrOnly
;
// perform redundance removal
int
fRrOnly
;
// perform redundance removal
int
fArea
;
// performs optimization for area
int
fArea
;
// performs optimization for area
int
fMoreEffort
;
// performs high-affort minimization
int
fMoreEffort
;
// performs high-affort minimization
int
fZeroCost
;
// enable zero-cost replacement
int
fVerbose
;
// enable basic stats
int
fVerbose
;
// enable basic stats
int
fVeryVerbose
;
// enable detailed stats
int
fVeryVerbose
;
// enable detailed stats
};
};
...
...
src/opt/sfm/sfmDec.c
View file @
b5e0b7d4
This diff is collapsed.
Click to expand it.
src/opt/sfm/sfmInt.h
View file @
b5e0b7d4
...
@@ -47,6 +47,7 @@ ABC_NAMESPACE_HEADER_START
...
@@ -47,6 +47,7 @@ ABC_NAMESPACE_HEADER_START
#define SFM_SUPP_MAX 6
#define SFM_SUPP_MAX 6
#define SFM_WORD_MAX ((SFM_SUPP_MAX>6) ? (1<<(SFM_SUPP_MAX-6)) : 1)
#define SFM_WORD_MAX ((SFM_SUPP_MAX>6) ? (1<<(SFM_SUPP_MAX-6)) : 1)
#define SFM_WIN_MAX 1000
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// BASIC TYPES ///
/// BASIC TYPES ///
...
@@ -193,7 +194,7 @@ extern int Sfm_LibFindComplInputGate( Vec_Wrd_t * vFuncs, int iGate, in
...
@@ -193,7 +194,7 @@ extern int Sfm_LibFindComplInputGate( Vec_Wrd_t * vFuncs, int iGate, in
extern
Sfm_Lib_t
*
Sfm_LibPrepare
(
int
nVars
,
int
fTwo
,
int
fVerbose
);
extern
Sfm_Lib_t
*
Sfm_LibPrepare
(
int
nVars
,
int
fTwo
,
int
fVerbose
);
extern
void
Sfm_LibPrint
(
Sfm_Lib_t
*
p
);
extern
void
Sfm_LibPrint
(
Sfm_Lib_t
*
p
);
extern
void
Sfm_LibStop
(
Sfm_Lib_t
*
p
);
extern
void
Sfm_LibStop
(
Sfm_Lib_t
*
p
);
extern
int
Sfm_LibImplement
(
Sfm_Lib_t
*
p
,
word
uTruth
,
int
*
pFanins
,
int
nFanins
,
int
AreaMffc
,
Vec_Int_t
*
vGates
,
Vec_Wec_t
*
vFanins
);
extern
int
Sfm_LibImplement
(
Sfm_Lib_t
*
p
,
word
uTruth
,
int
*
pFanins
,
int
nFanins
,
int
AreaMffc
,
Vec_Int_t
*
vGates
,
Vec_Wec_t
*
vFanins
,
int
fZeroCost
);
/*=== sfmNtk.c ==========================================================*/
/*=== sfmNtk.c ==========================================================*/
extern
Sfm_Ntk_t
*
Sfm_ConstructNetwork
(
Vec_Wec_t
*
vFanins
,
int
nPis
,
int
nPos
);
extern
Sfm_Ntk_t
*
Sfm_ConstructNetwork
(
Vec_Wec_t
*
vFanins
,
int
nPis
,
int
nPos
);
extern
void
Sfm_NtkPrepare
(
Sfm_Ntk_t
*
p
);
extern
void
Sfm_NtkPrepare
(
Sfm_Ntk_t
*
p
);
...
...
src/opt/sfm/sfmLib.c
View file @
b5e0b7d4
...
@@ -428,7 +428,7 @@ void Sfm_LibTest( int nVars, int fTwo, int fVerbose )
...
@@ -428,7 +428,7 @@ void Sfm_LibTest( int nVars, int fTwo, int fVerbose )
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
int
Sfm_LibImplement
(
Sfm_Lib_t
*
p
,
word
uTruth
,
int
*
pFanins
,
int
nFanins
,
int
AreaMffc
,
Vec_Int_t
*
vGates
,
Vec_Wec_t
*
vFanins
)
int
Sfm_LibImplement
(
Sfm_Lib_t
*
p
,
word
uTruth
,
int
*
pFanins
,
int
nFanins
,
int
AreaMffc
,
Vec_Int_t
*
vGates
,
Vec_Wec_t
*
vFanins
,
int
fZeroCost
)
{
{
Mio_Library_t
*
pLib
=
(
Mio_Library_t
*
)
Abc_FrameReadLibGen
();
Mio_Library_t
*
pLib
=
(
Mio_Library_t
*
)
Abc_FrameReadLibGen
();
Mio_Gate_t
*
pGate
;
Mio_Gate_t
*
pGate
;
...
@@ -460,7 +460,7 @@ int Sfm_LibImplement( Sfm_Lib_t * p, word uTruth, int * pFanins, int nFanins, in
...
@@ -460,7 +460,7 @@ int Sfm_LibImplement( Sfm_Lib_t * p, word uTruth, int * pFanins, int nFanins, in
Sfm_LibForEachSuper
(
p
,
pObj
,
iFunc
)
Sfm_LibForEachSuper
(
p
,
pObj
,
iFunc
)
if
(
!
pObjMin
||
pObjMin
->
Area
>
pObj
->
Area
)
if
(
!
pObjMin
||
pObjMin
->
Area
>
pObj
->
Area
)
pObjMin
=
pObj
;
pObjMin
=
pObj
;
if
(
pObjMin
==
NULL
||
pObjMin
->
Area
>=
AreaMffc
)
if
(
pObjMin
==
NULL
||
(
fZeroCost
?
pObjMin
->
Area
>
AreaMffc
:
pObjMin
->
Area
>=
AreaMffc
)
)
return
-
1
;
return
-
1
;
// get the gates
// get the gates
pCellB
=
p
->
pCells
+
(
int
)
pObjMin
->
pFansB
[
0
];
pCellB
=
p
->
pCells
+
(
int
)
pObjMin
->
pFansB
[
0
];
...
...
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