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
6dd270d4
Commit
6dd270d4
authored
Aug 30, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improvements to gate-sizing.
parent
c84f26c9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
77 additions
and
67 deletions
+77
-67
src/map/scl/scl.c
+73
-50
src/map/scl/sclInt.h
+1
-1
src/map/scl/sclMan.h
+3
-1
src/map/scl/sclSize.c
+0
-0
src/map/scl/sclTime.c
+0
-15
No files found.
src/map/scl/scl.c
View file @
6dd270d4
...
...
@@ -32,8 +32,8 @@ static int Scl_CommandRead ( Abc_Frame_t * pAbc, int argc, char **argv );
static
int
Scl_CommandWrite
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Scl_CommandPrint
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Scl_CommandStime
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Scl_CommandGsize
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Scl_CommandBuffer
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Scl_CommandGsize
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
...
...
@@ -56,8 +56,8 @@ void Scl_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"write_scl"
,
Scl_CommandWrite
,
0
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"print_scl"
,
Scl_CommandPrint
,
0
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"stime"
,
Scl_CommandStime
,
0
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"gsize"
,
Scl_CommandGsize
,
1
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"buffer"
,
Scl_CommandBuffer
,
1
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"gsize"
,
Scl_CommandGsize
,
1
);
}
void
Scl_End
(
Abc_Frame_t
*
pAbc
)
{
...
...
@@ -292,11 +292,14 @@ usage:
SeeAlso []
***********************************************************************/
int
Scl_Command
Gsize
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
int
Scl_Command
Buffer
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
int
c
,
fVerbose
=
0
;
int
nSteps
=
100000
;
Abc_Ntk_t
*
pNtk
=
Abc_FrameReadNtk
(
pAbc
);
Abc_Ntk_t
*
pNtkRes
;
int
Degree
;
int
c
,
fVerbose
;
Degree
=
4
;
fVerbose
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"Nvh"
)
)
!=
EOF
)
{
...
...
@@ -308,9 +311,9 @@ int Scl_CommandGsize( Abc_Frame_t * pAbc, int argc, char **argv )
Abc_Print
(
-
1
,
"Command line switch
\"
-N
\"
should be followed by a positive integer.
\n
"
);
goto
usage
;
}
nSteps
=
atoi
(
argv
[
globalUtilOptind
]);
Degree
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
nSteps
<=
0
)
if
(
Degree
<
0
)
goto
usage
;
break
;
case
'v'
:
...
...
@@ -323,36 +326,34 @@ int Scl_CommandGsize( Abc_Frame_t * pAbc, int argc, char **argv )
}
}
if
(
Abc_FrameReadNtk
(
pAbc
)
==
NULL
)
{
fprintf
(
pAbc
->
Err
,
"There is no current network.
\n
"
);
return
1
;
}
if
(
!
Abc_NtkHasMapping
(
Abc_FrameReadNtk
(
pAbc
))
)
if
(
pNtk
==
NULL
)
{
fprintf
(
pAbc
->
Err
,
"The current network is not mapped
.
\n
"
);
Abc_Print
(
-
1
,
"Empty network
.
\n
"
);
return
1
;
}
if
(
!
Abc_
SclCheckNtk
(
Abc_FrameReadNtk
(
pAbc
),
0
)
)
if
(
!
Abc_
NtkIsLogic
(
pNtk
)
)
{
fprintf
(
pAbc
->
Err
,
"The current networks is not in a topo order (run
\"
buffer -N 1000
\"
)
.
\n
"
);
Abc_Print
(
-
1
,
"This command can only be applied to a logic network
.
\n
"
);
return
1
;
}
if
(
pAbc
->
pLibScl
==
NULL
)
// modify the current network
pNtkRes
=
Abc_SclPerformBuffering
(
pNtk
,
Degree
,
fVerbose
);
if
(
pNtkRes
==
NULL
)
{
fprintf
(
pAbc
->
Err
,
"There is no Liberty library available
.
\n
"
);
Abc_Print
(
-
1
,
"The command has failed
.
\n
"
);
return
1
;
}
Abc_
SclSizingPerform
(
pAbc
->
pLibScl
,
Abc_FrameReadNtk
(
pAbc
),
nSteps
,
fVerbose
);
// replace the current network
Abc_
FrameReplaceCurrentNetwork
(
pAbc
,
pNtkRes
);
return
0
;
usage:
fprintf
(
pAbc
->
Err
,
"usage:
gsize
[-N num] [-vh]
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
performs
gate sizing using Liberty library
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
-N <num> : the
number of gate-sizing steps performed [default = %d]
\n
"
,
nSteps
);
fprintf
(
pAbc
->
Err
,
"usage:
buffer
[-N num] [-vh]
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
performs
buffering of the mapped network
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
-N <num> : the
max allowed fanout count of node/buffer [default = %d]
\n
"
,
Degree
);
fprintf
(
pAbc
->
Err
,
"
\t
-v : toggle printing verbose information [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
fprintf
(
pAbc
->
Err
,
"
\t
-h : print the
help massage
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
-h : print the
command usage
\n
"
);
return
1
;
}
...
...
@@ -367,16 +368,16 @@ usage:
SeeAlso []
***********************************************************************/
int
Scl_Command
Buffer
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
int
Scl_Command
Gsize
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
Abc_Ntk_t
*
pNtk
=
Abc_FrameReadNtk
(
pAbc
)
;
Abc_Ntk_t
*
pNtkRes
;
int
Degree
;
int
c
,
fVerbose
;
Degree
=
4
;
fVerbose
=
0
;
int
c
,
fVerbose
=
0
;
int
fPrintCP
=
0
;
int
nSteps
=
100000
;
int
nRange
=
0
;
int
fTryAll
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"N
v
h"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"N
Wvap
h"
)
)
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -386,11 +387,28 @@ int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print
(
-
1
,
"Command line switch
\"
-N
\"
should be followed by a positive integer.
\n
"
);
goto
usage
;
}
Degree
=
atoi
(
argv
[
globalUtilOptind
]);
nSteps
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
Degree
<
0
)
if
(
nSteps
<=
0
)
goto
usage
;
break
;
case
'W'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-W
\"
should be followed by a positive integer.
\n
"
);
goto
usage
;
}
nRange
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
nRange
<
0
)
goto
usage
;
break
;
case
'a'
:
fTryAll
^=
1
;
break
;
case
'p'
:
fPrintCP
^=
1
;
break
;
case
'v'
:
fVerbose
^=
1
;
break
;
...
...
@@ -401,34 +419,39 @@ int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char ** argv )
}
}
if
(
pNtk
==
NULL
)
if
(
Abc_FrameReadNtk
(
pAbc
)
==
NULL
)
{
Abc_Print
(
-
1
,
"Empty
network.
\n
"
);
fprintf
(
pAbc
->
Err
,
"There is no current
network.
\n
"
);
return
1
;
}
if
(
!
Abc_Ntk
IsLogic
(
pNtk
)
)
if
(
!
Abc_Ntk
HasMapping
(
Abc_FrameReadNtk
(
pAbc
)
)
)
{
Abc_Print
(
-
1
,
"This command can only be applied to a logic network
.
\n
"
);
fprintf
(
pAbc
->
Err
,
"The current network is not mapped
.
\n
"
);
return
1
;
}
// modify the current network
pNtkRes
=
Abc_SclPerformBuffering
(
pNtk
,
Degree
,
fVerbose
);
if
(
pNtkRes
==
NULL
)
if
(
!
Abc_SclCheckNtk
(
Abc_FrameReadNtk
(
pAbc
),
0
)
)
{
Abc_Print
(
-
1
,
"The command has failed
.
\n
"
);
fprintf
(
pAbc
->
Err
,
"The current networks is not in a topo order (run
\"
buffer -N 1000
\"
)
.
\n
"
);
return
1
;
}
// replace the current network
Abc_FrameReplaceCurrentNetwork
(
pAbc
,
pNtkRes
);
if
(
pAbc
->
pLibScl
==
NULL
)
{
fprintf
(
pAbc
->
Err
,
"There is no Liberty library available.
\n
"
);
return
1
;
}
Abc_SclSizingPerform
(
pAbc
->
pLibScl
,
Abc_FrameReadNtk
(
pAbc
),
nSteps
,
nRange
,
fTryAll
,
fPrintCP
,
fVerbose
);
return
0
;
usage:
fprintf
(
pAbc
->
Err
,
"usage: buffer [-N num] [-vh]
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
performs buffering of the mapped network
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
-N <num> : the max allowed fanout count of node/buffer [default = %d]
\n
"
,
Degree
);
fprintf
(
pAbc
->
Err
,
"usage: gsize [-NW num] [-apvh]
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
performs gate sizing using Liberty library
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
-N <num> : the number of gate-sizing steps performed [default = %d]
\n
"
,
nSteps
);
fprintf
(
pAbc
->
Err
,
"
\t
-W <num> : delay window (in percents) of near-critical COs [default = %d]
\n
"
,
nRange
);
fprintf
(
pAbc
->
Err
,
"
\t
-a : try resizing all gates (not only critical) [default = %s]
\n
"
,
fTryAll
?
"yes"
:
"no"
);
fprintf
(
pAbc
->
Err
,
"
\t
-p : toggle printing critical path before and after sizing [default = %s]
\n
"
,
fPrintCP
?
"yes"
:
"no"
);
fprintf
(
pAbc
->
Err
,
"
\t
-v : toggle printing verbose information [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
fprintf
(
pAbc
->
Err
,
"
\t
-h : print the
command usage
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
-h : print the
help massage
\n
"
);
return
1
;
}
...
...
src/map/scl/sclInt.h
View file @
6dd270d4
...
...
@@ -414,7 +414,7 @@ extern void Abc_SclSave( char * pFileName, SC_Lib * pScl );
/*=== sclTime.c =============================================================*/
extern
void
Abc_SclTimePerform
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
int
fShowAll
);
/*=== sclSize.c =============================================================*/
extern
void
Abc_SclSizingPerform
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
int
nSteps
,
int
fVerbose
);
extern
void
Abc_SclSizingPerform
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
int
nSteps
,
int
nRange
,
int
fTryAll
,
int
fPrintCP
,
int
fVerbose
);
/*=== sclUtil.c =============================================================*/
extern
void
Abc_SclHashCells
(
SC_Lib
*
p
);
extern
int
Abc_SclCellFind
(
SC_Lib
*
p
,
char
*
pName
);
...
...
src/map/scl/sclMan.h
View file @
6dd270d4
...
...
@@ -80,6 +80,8 @@ static inline SC_Pair * Abc_SclObjSlew( SC_Man * p, Abc_Obj_t * pObj ) { re
static
inline
SC_Pair
*
Abc_SclObjTime2
(
SC_Man
*
p
,
Abc_Obj_t
*
pObj
)
{
return
p
->
pTimes2
+
Abc_ObjId
(
pObj
);
}
static
inline
SC_Pair
*
Abc_SclObjSlew2
(
SC_Man
*
p
,
Abc_Obj_t
*
pObj
)
{
return
p
->
pSlews2
+
Abc_ObjId
(
pObj
);
}
static
inline
float
Abc_SclObjTimeMax
(
SC_Man
*
p
,
Abc_Obj_t
*
pObj
)
{
return
Abc_MaxFloat
(
Abc_SclObjTime
(
p
,
pObj
)
->
rise
,
Abc_SclObjTime
(
p
,
pObj
)
->
fall
);
}
static
inline
void
Abc_SclObjDupFanin
(
SC_Man
*
p
,
Abc_Obj_t
*
pObj
)
{
assert
(
Abc_ObjIsCo
(
pObj
)
);
*
Abc_SclObjTime
(
p
,
pObj
)
=
*
Abc_SclObjTime
(
p
,
Abc_ObjFanin0
(
pObj
));
}
static
inline
float
Abc_SclObjGain
(
SC_Man
*
p
,
Abc_Obj_t
*
pObj
)
{
return
(
Abc_SclObjTime2
(
p
,
pObj
)
->
rise
-
Abc_SclObjTime
(
p
,
pObj
)
->
rise
)
+
(
Abc_SclObjTime2
(
p
,
pObj
)
->
fall
-
Abc_SclObjTime
(
p
,
pObj
)
->
fall
);
}
...
...
@@ -200,8 +202,8 @@ static inline float Abc_SclGetMaxDelay( SC_Man * p )
/*=== sclTime.c =============================================================*/
extern
Vec_Int_t
*
Abc_SclFindCriticalPath
(
SC_Man
*
p
);
extern
Abc_Obj_t
*
Abc_SclFindCriticalCo
(
SC_Man
*
p
,
int
*
pfRise
);
extern
Abc_Obj_t
*
Abc_SclFindMostCriticalFanin
(
SC_Man
*
p
,
int
*
pfRise
,
Abc_Obj_t
*
pNode
);
extern
void
Abc_SclTimeNtkPrint
(
SC_Man
*
p
,
int
fShowAll
);
extern
SC_Man
*
Abc_SclManStart
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
);
extern
void
Abc_SclTimeCone
(
SC_Man
*
p
,
Vec_Int_t
*
vCone
);
...
...
src/map/scl/sclSize.c
View file @
6dd270d4
This diff is collapsed.
Click to expand it.
src/map/scl/sclTime.c
View file @
6dd270d4
...
...
@@ -70,21 +70,6 @@ Abc_Obj_t * Abc_SclFindMostCriticalFanin( SC_Man * p, int * pfRise, Abc_Obj_t *
}
return
pPivot
;
}
Vec_Int_t
*
Abc_SclFindCriticalPath
(
SC_Man
*
p
)
{
int
fRise
=
0
;
Abc_Obj_t
*
pPivot
=
Abc_SclFindCriticalCo
(
p
,
&
fRise
);
Vec_Int_t
*
vPath
=
Vec_IntAlloc
(
100
);
Vec_IntPush
(
vPath
,
Abc_ObjId
(
pPivot
)
);
pPivot
=
Abc_ObjFanin0
(
pPivot
);
while
(
pPivot
&&
Abc_ObjIsNode
(
pPivot
)
)
{
Vec_IntPush
(
vPath
,
Abc_ObjId
(
pPivot
)
);
pPivot
=
Abc_SclFindMostCriticalFanin
(
p
,
&
fRise
,
pPivot
);
}
Vec_IntReverseOrder
(
vPath
);
return
vPath
;
}
/**Function*************************************************************
...
...
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