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
b90f1c73
Commit
b90f1c73
authored
Feb 29, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding switch -N to 'super' to set an upper bound on the number of supergates generated.
parent
b30791ba
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
48 deletions
+84
-48
src/map/super/super.c
+41
-33
src/map/super/superGate.c
+42
-14
src/map/super/superInt.h
+1
-1
No files found.
src/map/super/super.c
View file @
b90f1c73
...
...
@@ -94,17 +94,17 @@ int Super_CommandSupergatesAnd( Abc_Frame_t * pAbc, int argc, char **argv )
nLevels
=
3
;
fVerbose
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"
il
vh"
))
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"
IL
vh"
))
!=
EOF
)
{
switch
(
c
)
{
case
'
i
'
:
case
'
I
'
:
nVarsMax
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
nVarsMax
<
0
)
goto
usage
;
break
;
case
'
l
'
:
case
'
L
'
:
nLevels
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
nLevels
<
0
)
...
...
@@ -126,10 +126,10 @@ int Super_CommandSupergatesAnd( Abc_Frame_t * pAbc, int argc, char **argv )
return
0
;
usage:
fprintf
(
pErr
,
"usage: super2 [-
i num] [-l
num] [-vh]
\n
"
);
fprintf
(
pErr
,
"usage: super2 [-
IL
num] [-vh]
\n
"
);
fprintf
(
pErr
,
"
\t
precomputes the supergates composed of AND2s and INVs
\n
"
);
fprintf
(
pErr
,
"
\t
-
i
num : the max number of inputs to the supergate [default = %d]
\n
"
,
nVarsMax
);
fprintf
(
pErr
,
"
\t
-
l
num : the max number of logic levels of gates [default = %d]
\n
"
,
nLevels
);
fprintf
(
pErr
,
"
\t
-
I
num : the max number of inputs to the supergate [default = %d]
\n
"
,
nVarsMax
);
fprintf
(
pErr
,
"
\t
-
L
num : the max number of logic levels of gates [default = %d]
\n
"
,
nLevels
);
fprintf
(
pErr
,
"
\t
-v : enable verbose output
\n
"
);
fprintf
(
pErr
,
"
\t
-h : print the help message
\n
"
);
return
1
;
/* error exit */
...
...
@@ -157,7 +157,7 @@ int Super_CommandSupergates( Abc_Frame_t * pAbc, int argc, char **argv )
float
AreaLimit
;
int
fSkipInvs
;
int
fWriteOldFormat
;
int
nVarsMax
,
nLevels
,
TimeLimit
;
int
nVarsMax
,
nLevels
,
nGatesMax
,
TimeLimit
;
int
fVerbose
;
int
c
;
...
...
@@ -169,6 +169,7 @@ int Super_CommandSupergates( Abc_Frame_t * pAbc, int argc, char **argv )
nLevels
=
3
;
DelayLimit
=
3
.
5
;
AreaLimit
=
9
;
nGatesMax
=
10000
;
TimeLimit
=
10
;
fSkipInvs
=
1
;
fVerbose
=
0
;
...
...
@@ -176,46 +177,52 @@ int Super_CommandSupergates( Abc_Frame_t * pAbc, int argc, char **argv )
ExcludeFile
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"
eiltda
sovh"
))
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"
ILNTDAE
sovh"
))
!=
EOF
)
{
switch
(
c
)
{
case
'e'
:
ExcludeFile
=
argv
[
globalUtilOptind
];
if
(
ExcludeFile
==
0
)
goto
usage
;
globalUtilOptind
++
;
break
;
case
'i'
:
case
'I'
:
nVarsMax
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
nVarsMax
<
0
)
goto
usage
;
break
;
case
'
l
'
:
case
'
L
'
:
nLevels
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
nLevels
<
0
)
goto
usage
;
break
;
case
't'
:
case
'N'
:
nGatesMax
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
nGatesMax
<
0
)
goto
usage
;
break
;
case
'T'
:
TimeLimit
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
TimeLimit
<
0
)
goto
usage
;
break
;
case
'
d
'
:
case
'
D
'
:
DelayLimit
=
(
float
)
atof
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
DelayLimit
<=
0
.
0
)
goto
usage
;
break
;
case
'
a
'
:
case
'
A
'
:
AreaLimit
=
(
float
)
atof
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
AreaLimit
<=
0
.
0
)
goto
usage
;
break
;
case
'E'
:
ExcludeFile
=
argv
[
globalUtilOptind
];
if
(
ExcludeFile
==
0
)
goto
usage
;
globalUtilOptind
++
;
break
;
case
's'
:
fSkipInvs
^=
1
;
break
;
...
...
@@ -268,41 +275,42 @@ int Super_CommandSupergates( Abc_Frame_t * pAbc, int argc, char **argv )
}
// compute the gates
Super_Precompute
(
pLib
,
nVarsMax
,
nLevels
,
DelayLimit
,
AreaLimit
,
TimeLimit
,
fSkipInvs
,
fWriteOldFormat
,
fVerbose
);
Super_Precompute
(
pLib
,
nVarsMax
,
nLevels
,
nGatesMax
,
DelayLimit
,
AreaLimit
,
TimeLimit
,
fSkipInvs
,
fWriteOldFormat
,
fVerbose
);
// delete the library
Mio_LibraryDelete
(
pLib
);
return
0
;
usage:
fprintf
(
pErr
,
"usage: super [-
i num] [-l num] [-d float] [-a float] [-t num
] [-sovh] <genlib_file>
\n
"
);
fprintf
(
pErr
,
"usage: super [-
ILNT num] [-DA float] [-E file
] [-sovh] <genlib_file>
\n
"
);
fprintf
(
pErr
,
"
\t
precomputes the supergates for the given GENLIB library
\n
"
);
fprintf
(
pErr
,
"
\t
-i num : the max number of supergate inputs [default = %d]
\n
"
,
nVarsMax
);
fprintf
(
pErr
,
"
\t
-l num : the max number of levels of gates [default = %d]
\n
"
,
nLevels
);
fprintf
(
pErr
,
"
\t
-d float : the max delay of the supergates [default = %.2f]
\n
"
,
DelayLimit
);
fprintf
(
pErr
,
"
\t
-a float : the max area of the supergates [default = %.2f]
\n
"
,
AreaLimit
);
fprintf
(
pErr
,
"
\t
-t num : the approximate runtime limit in seconds [default = %d]
\n
"
,
TimeLimit
);
fprintf
(
pErr
,
"
\t
-I num : the max number of supergate inputs [default = %d]
\n
"
,
nVarsMax
);
fprintf
(
pErr
,
"
\t
-L num : the max number of levels of gates [default = %d]
\n
"
,
nLevels
);
fprintf
(
pErr
,
"
\t
-N num : the limit on the number of considered supergates [default = %d]
\n
"
,
nGatesMax
);
fprintf
(
pErr
,
"
\t
-T num : the approximate runtime limit in seconds [default = %d]
\n
"
,
TimeLimit
);
fprintf
(
pErr
,
"
\t
-D float : the max delay of the supergates [default = %.2f]
\n
"
,
DelayLimit
);
fprintf
(
pErr
,
"
\t
-A float : the max area of the supergates [default = %.2f]
\n
"
,
AreaLimit
);
fprintf
(
pErr
,
"
\t
-E file : file contains list of genlib gates to exclude
\n
"
);
fprintf
(
pErr
,
"
\t
-s : toggle the use of inverters at the inputs [default = %s]
\n
"
,
(
fSkipInvs
?
"no"
:
"yes"
)
);
fprintf
(
pErr
,
"
\t
-o : toggle dumping the supergate library in old format [default = %s]
\n
"
,
(
fWriteOldFormat
?
"yes"
:
"no"
)
);
fprintf
(
pErr
,
"
\t
-e file : file contains list of genlib gates to exclude
\n
"
);
fprintf
(
pErr
,
"
\t
-v : enable verbose output [default = %s]
\n
"
,
(
fVerbose
?
"yes"
:
"no"
)
);
fprintf
(
pErr
,
"
\t
-h : print the help message
\n
"
);
fprintf
(
pErr
,
"
\n
"
);
fprintf
(
pErr
,
"
\t
Here is a piece of advice on precomputing supergate libraries:
\n
"
);
fprintf
(
pErr
,
"
\t\n
"
);
fprintf
(
pErr
,
"
\t
Start with the number of inputs equal to 5 (-
i
5), the number of
\n
"
);
fprintf
(
pErr
,
"
\t
levels equal to
3 (-l 3
), the delay equal to 2-3 delays of inverter,
\n
"
);
fprintf
(
pErr
,
"
\t
the area equal to
3-4
areas of two input NAND, and runtime limit equal
\n
"
);
fprintf
(
pErr
,
"
\t
to 10 seconds (-
t
10). Run precomputation and learn from the result.
\n
"
);
fprintf
(
pErr
,
"
\t
Start with the number of inputs equal to 5 (-
I
5), the number of
\n
"
);
fprintf
(
pErr
,
"
\t
levels equal to
2 (-L 2
), the delay equal to 2-3 delays of inverter,
\n
"
);
fprintf
(
pErr
,
"
\t
the area equal to
2-3
areas of two input NAND, and runtime limit equal
\n
"
);
fprintf
(
pErr
,
"
\t
to 10 seconds (-
T
10). Run precomputation and learn from the result.
\n
"
);
fprintf
(
pErr
,
"
\t
Determine what parameter is most constraining and try to increase
\n
"
);
fprintf
(
pErr
,
"
\t
the value of that parameter. The goal is to have a well-balanced
\n
"
);
fprintf
(
pErr
,
"
\t
set of constraints and the resulting supergate library containing
\n
"
);
fprintf
(
pErr
,
"
\t
approximately
100K-20
0K supergates. Typically, it is better to increase
\n
"
);
fprintf
(
pErr
,
"
\t
approximately
5K-2
0K supergates. Typically, it is better to increase
\n
"
);
fprintf
(
pErr
,
"
\t
delay limit rather than area limit, because having large-area supergates
\n
"
);
fprintf
(
pErr
,
"
\t
may result in a considerable increase in area.
\n
"
);
fprintf
(
pErr
,
"
\t\n
"
);
fprintf
(
pErr
,
"
\t
Note that a good supergate library for experiments typically can be
\n
"
);
fprintf
(
pErr
,
"
\t
precomputed in 30 sec
. Increasing the
runtime limit makes sense when
\n
"
);
fprintf
(
pErr
,
"
\t
precomputed in 30 sec
or less. Increasing
runtime limit makes sense when
\n
"
);
fprintf
(
pErr
,
"
\t
other parameters are well-balanced and it is needed to enumerate more
\n
"
);
fprintf
(
pErr
,
"
\t
choices to have a good result. In the end, to compute the final library
\n
"
);
fprintf
(
pErr
,
"
\t
the runtime can be set to 300 sec to ensure the ultimate quality.
\n
"
);
...
...
src/map/super/superGate.c
View file @
b90f1c73
This diff is collapsed.
Click to expand it.
src/map/super/superInt.h
View file @
b90f1c73
...
...
@@ -57,7 +57,7 @@ ABC_NAMESPACE_HEADER_START
/*=== superAnd.c =============================================================*/
extern
void
Super2_Precompute
(
int
nInputs
,
int
nLevels
,
int
fVerbose
);
/*=== superGate.c =============================================================*/
extern
void
Super_Precompute
(
Mio_Library_t
*
pLibGen
,
int
nInputs
,
int
nLevels
,
float
tDelayMax
,
float
tAreaMax
,
int
TimeLimit
,
int
fSkipInv
,
int
fWriteOldFormat
,
int
fVerbose
);
extern
void
Super_Precompute
(
Mio_Library_t
*
pLibGen
,
int
nInputs
,
int
nLevels
,
int
nGatesMax
,
float
tDelayMax
,
float
tAreaMax
,
int
TimeLimit
,
int
fSkipInv
,
int
fWriteOldFormat
,
int
fVerbose
);
...
...
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