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
9b15f71f
Commit
9b15f71f
authored
Sep 12, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added new command 'upsize'.
parent
e3d75484
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
241 additions
and
44 deletions
+241
-44
src/map/scl/module.make
+1
-0
src/map/scl/scl.c
+89
-0
src/map/scl/sclInt.h
+2
-0
src/map/scl/sclMan.h
+26
-0
src/map/scl/sclSize.c
+0
-38
src/map/scl/sclTime.c
+9
-6
src/map/scl/sclUpsize.c
+114
-0
No files found.
src/map/scl/module.make
View file @
9b15f71f
...
@@ -4,4 +4,5 @@ SRC += src/map/scl/scl.c \
...
@@ -4,4 +4,5 @@ SRC += src/map/scl/scl.c \
src/map/scl/sclLoad.c
\
src/map/scl/sclLoad.c
\
src/map/scl/sclSize.c
\
src/map/scl/sclSize.c
\
src/map/scl/sclTime.c
\
src/map/scl/sclTime.c
\
src/map/scl/sclUpsize.c
\
src/map/scl/sclUtil.c
src/map/scl/sclUtil.c
src/map/scl/scl.c
View file @
9b15f71f
...
@@ -36,6 +36,7 @@ static int Scl_CommandStime ( Abc_Frame_t * pAbc, int argc, char **argv );
...
@@ -36,6 +36,7 @@ static int Scl_CommandStime ( Abc_Frame_t * pAbc, int argc, char **argv );
static
int
Scl_CommandTopo
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Scl_CommandTopo
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Scl_CommandBuffer
(
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
);
static
int
Scl_CommandGsize
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Scl_CommandUpsize
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
/// FUNCTION DEFINITIONS ///
...
@@ -62,6 +63,7 @@ void Scl_Init( Abc_Frame_t * pAbc )
...
@@ -62,6 +63,7 @@ void Scl_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"topo"
,
Scl_CommandTopo
,
1
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"topo"
,
Scl_CommandTopo
,
1
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"buffer"
,
Scl_CommandBuffer
,
1
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"buffer"
,
Scl_CommandBuffer
,
1
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"gsize"
,
Scl_CommandGsize
,
1
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"gsize"
,
Scl_CommandGsize
,
1
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"upsize"
,
Scl_CommandUpsize
,
1
);
}
}
void
Scl_End
(
Abc_Frame_t
*
pAbc
)
void
Scl_End
(
Abc_Frame_t
*
pAbc
)
{
{
...
@@ -621,6 +623,93 @@ usage:
...
@@ -621,6 +623,93 @@ usage:
return
1
;
return
1
;
}
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Scl_CommandUpsize
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
Abc_Ntk_t
*
pNtk
=
Abc_FrameReadNtk
(
pAbc
);
int
Degree
=
2
;
int
nRange
=
5
;
int
c
,
fVerbose
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"NWvh"
)
)
!=
EOF
)
{
switch
(
c
)
{
case
'N'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-N
\"
should be followed by a positive integer.
\n
"
);
goto
usage
;
}
Degree
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
Degree
<
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
'v'
:
fVerbose
^=
1
;
break
;
case
'h'
:
goto
usage
;
default:
goto
usage
;
}
}
if
(
Abc_FrameReadNtk
(
pAbc
)
==
NULL
)
{
fprintf
(
pAbc
->
Err
,
"There is no current network.
\n
"
);
return
1
;
}
if
(
!
Abc_NtkHasMapping
(
Abc_FrameReadNtk
(
pAbc
))
)
{
fprintf
(
pAbc
->
Err
,
"The current network is not mapped.
\n
"
);
return
1
;
}
if
(
!
Abc_SclCheckNtk
(
Abc_FrameReadNtk
(
pAbc
),
0
)
)
{
fprintf
(
pAbc
->
Err
,
"The current networks is not in a topo order (run
\"
topo
\"
).
\n
"
);
return
1
;
}
if
(
pAbc
->
pLibScl
==
NULL
)
{
fprintf
(
pAbc
->
Err
,
"There is no Liberty library available.
\n
"
);
return
1
;
}
Abc_SclUpsizingPerform
(
pAbc
->
pLibScl
,
pNtk
,
Degree
,
nRange
,
fVerbose
);
return
0
;
usage:
fprintf
(
pAbc
->
Err
,
"usage: upsize [-NW num] [-vh]
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
selectively increases gate sizes in timing-critical regions
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
-N <num> : the max fanout count of gates to upsize [default = %d]
\n
"
,
Degree
);
fprintf
(
pAbc
->
Err
,
"
\t
-W <num> : delay window (in percents) of near-critical COs [default = %d]
\n
"
,
nRange
);
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
"
);
return
1
;
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
/// END OF FILE ///
...
...
src/map/scl/sclInt.h
View file @
9b15f71f
...
@@ -435,6 +435,8 @@ extern void Abc_SclSave( char * pFileName, SC_Lib * pScl );
...
@@ -435,6 +435,8 @@ extern void Abc_SclSave( char * pFileName, SC_Lib * pScl );
extern
void
Abc_SclTimePerform
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
int
fShowAll
,
int
fUseWireLoads
);
extern
void
Abc_SclTimePerform
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
int
fShowAll
,
int
fUseWireLoads
);
/*=== sclSize.c =============================================================*/
/*=== sclSize.c =============================================================*/
extern
void
Abc_SclSizingPerform
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
SC_SizePars
*
p
);
extern
void
Abc_SclSizingPerform
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
SC_SizePars
*
p
);
/*=== sclUpsize.c =============================================================*/
extern
void
Abc_SclUpsizingPerform
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
int
Degree
,
int
nRange
,
int
fVerbose
);
/*=== sclUtil.c =============================================================*/
/*=== sclUtil.c =============================================================*/
extern
void
Abc_SclHashCells
(
SC_Lib
*
p
);
extern
void
Abc_SclHashCells
(
SC_Lib
*
p
);
extern
int
Abc_SclCellFind
(
SC_Lib
*
p
,
char
*
pName
);
extern
int
Abc_SclCellFind
(
SC_Lib
*
p
,
char
*
pName
);
...
...
src/map/scl/sclMan.h
View file @
9b15f71f
...
@@ -131,6 +131,11 @@ static inline void Abc_SclManFree( SC_Man * p )
...
@@ -131,6 +131,11 @@ static inline void Abc_SclManFree( SC_Man * p )
ABC_FREE
(
p
->
pSlews2
);
ABC_FREE
(
p
->
pSlews2
);
ABC_FREE
(
p
);
ABC_FREE
(
p
);
}
}
static
inline
void
Abc_SclManCleanTime
(
SC_Man
*
p
)
{
memset
(
p
->
pTimes
,
0
,
sizeof
(
SC_Pair
)
*
p
->
nObjs
);
memset
(
p
->
pSlews
,
0
,
sizeof
(
SC_Pair
)
*
p
->
nObjs
);
}
/**Function*************************************************************
/**Function*************************************************************
...
@@ -206,6 +211,26 @@ static inline float Abc_SclGetMaxDelayNode( SC_Man * p, Abc_Obj_t * pNode )
...
@@ -206,6 +211,26 @@ static inline float Abc_SclGetMaxDelayNode( SC_Man * p, Abc_Obj_t * pNode )
return
fMaxArr
;
return
fMaxArr
;
}
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static
inline
SC_Cell
*
Abc_SclObjResiable
(
SC_Man
*
p
,
Abc_Obj_t
*
pObj
,
int
fUpsize
)
{
SC_Cell
*
pOld
=
Abc_SclObjCell
(
p
,
pObj
);
if
(
fUpsize
)
return
pOld
->
pNext
->
Order
>
pOld
->
Order
?
pOld
->
pNext
:
NULL
;
else
return
pOld
->
pPrev
->
Order
<
pOld
->
Order
?
pOld
->
pPrev
:
NULL
;
}
/*=== sclTime.c =============================================================*/
/*=== sclTime.c =============================================================*/
extern
Abc_Obj_t
*
Abc_SclFindCriticalCo
(
SC_Man
*
p
,
int
*
pfRise
);
extern
Abc_Obj_t
*
Abc_SclFindCriticalCo
(
SC_Man
*
p
,
int
*
pfRise
);
...
@@ -213,6 +238,7 @@ extern Abc_Obj_t * Abc_SclFindMostCriticalFanin( SC_Man * p, int * pfRise, Abc_O
...
@@ -213,6 +238,7 @@ extern Abc_Obj_t * Abc_SclFindMostCriticalFanin( SC_Man * p, int * pfRise, Abc_O
extern
void
Abc_SclTimeNtkPrint
(
SC_Man
*
p
,
int
fShowAll
);
extern
void
Abc_SclTimeNtkPrint
(
SC_Man
*
p
,
int
fShowAll
);
extern
SC_Man
*
Abc_SclManStart
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
int
fUseWireLoads
);
extern
SC_Man
*
Abc_SclManStart
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
int
fUseWireLoads
);
extern
void
Abc_SclTimeCone
(
SC_Man
*
p
,
Vec_Int_t
*
vCone
);
extern
void
Abc_SclTimeCone
(
SC_Man
*
p
,
Vec_Int_t
*
vCone
);
extern
void
Abc_SclTimeNtkRecompute
(
SC_Man
*
p
,
float
*
pArea
,
float
*
pDelay
);
/*=== sclTime.c =============================================================*/
/*=== sclTime.c =============================================================*/
extern
void
Abc_SclComputeLoad
(
SC_Man
*
p
);
extern
void
Abc_SclComputeLoad
(
SC_Man
*
p
);
extern
void
Abc_SclUpdateLoad
(
SC_Man
*
p
,
Abc_Obj_t
*
pObj
,
SC_Cell
*
pOld
,
SC_Cell
*
pNew
);
extern
void
Abc_SclUpdateLoad
(
SC_Man
*
p
,
Abc_Obj_t
*
pObj
,
SC_Cell
*
pOld
,
SC_Cell
*
pNew
);
...
...
src/map/scl/sclSize.c
View file @
9b15f71f
...
@@ -246,14 +246,6 @@ Vec_Int_t * Abc_SclCollectTfo( Abc_Ntk_t * p, Abc_Obj_t * pObj, Vec_Int_t * vPiv
...
@@ -246,14 +246,6 @@ Vec_Int_t * Abc_SclCollectTfo( Abc_Ntk_t * p, Abc_Obj_t * pObj, Vec_Int_t * vPiv
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
static
inline
SC_Cell
*
Abc_SclObjResiable
(
SC_Man
*
p
,
Abc_Obj_t
*
pObj
,
int
fUpsize
)
{
SC_Cell
*
pOld
=
Abc_SclObjCell
(
p
,
pObj
);
if
(
fUpsize
)
return
pOld
->
pNext
->
Order
>
pOld
->
Order
?
pOld
->
pNext
:
NULL
;
else
return
pOld
->
pPrev
->
Order
<
pOld
->
Order
?
pOld
->
pPrev
:
NULL
;
}
float
Abc_SclSizingGain
(
SC_Man
*
p
,
Abc_Obj_t
*
pPivot
,
Vec_Int_t
*
vPivots
,
int
fUpsize
)
float
Abc_SclSizingGain
(
SC_Man
*
p
,
Abc_Obj_t
*
pPivot
,
Vec_Int_t
*
vPivots
,
int
fUpsize
)
{
{
double
dGain
=
0
;
double
dGain
=
0
;
...
@@ -356,36 +348,6 @@ void Abc_SclUpdateNetwork( SC_Man * p, Abc_Obj_t * pObj, int nCone, int fUpsize,
...
@@ -356,36 +348,6 @@ void Abc_SclUpdateNetwork( SC_Man * p, Abc_Obj_t * pObj, int nCone, int fUpsize,
/**Function*************************************************************
/**Function*************************************************************
Synopsis [Begin by upsizing gates will many fanouts.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Abc_SclManUpsize
(
SC_Man
*
p
)
{
SC_Cell
*
pOld
,
*
pNew
;
Abc_Obj_t
*
pObj
;
int
i
;
Abc_NtkForEachNode1
(
p
->
pNtk
,
pObj
,
i
)
{
if
(
Abc_ObjFanoutNum
(
pObj
)
<=
2
)
continue
;
// find new gate
pOld
=
Abc_SclObjCell
(
p
,
pObj
);
pNew
=
Abc_SclObjResiable
(
p
,
pObj
,
1
);
if
(
pNew
==
NULL
)
continue
;
Vec_IntWriteEntry
(
p
->
vGates
,
Abc_ObjId
(
pObj
),
Abc_SclCellFind
(
p
->
pLib
,
pNew
->
pName
)
);
}
}
/**Function*************************************************************
Synopsis []
Synopsis []
Description []
Description []
...
...
src/map/scl/sclTime.c
View file @
9b15f71f
...
@@ -250,14 +250,20 @@ void Abc_SclTimeCone( SC_Man * p, Vec_Int_t * vCone )
...
@@ -250,14 +250,20 @@ void Abc_SclTimeCone( SC_Man * p, Vec_Int_t * vCone )
printf
(
"after (%6.1f ps %6.1f ps)
\n
"
,
Abc_SclObjTimePs
(
p
,
pObj
,
1
),
Abc_SclObjTimePs
(
p
,
pObj
,
0
)
);
printf
(
"after (%6.1f ps %6.1f ps)
\n
"
,
Abc_SclObjTimePs
(
p
,
pObj
,
1
),
Abc_SclObjTimePs
(
p
,
pObj
,
0
)
);
}
}
}
}
void
Abc_SclTimeNtk
(
SC_Man
*
p
)
void
Abc_SclTimeNtk
Recompute
(
SC_Man
*
p
,
float
*
pArea
,
float
*
pDelay
)
{
{
Abc_Obj_t
*
pObj
;
Abc_Obj_t
*
pObj
;
int
i
;
int
i
;
Abc_SclComputeLoad
(
p
);
Abc_SclManCleanTime
(
p
);
Abc_NtkForEachNode1
(
p
->
pNtk
,
pObj
,
i
)
Abc_NtkForEachNode1
(
p
->
pNtk
,
pObj
,
i
)
Abc_SclTimeGate
(
p
,
pObj
);
Abc_SclTimeGate
(
p
,
pObj
);
Abc_NtkForEachCo
(
p
->
pNtk
,
pObj
,
i
)
Abc_NtkForEachCo
(
p
->
pNtk
,
pObj
,
i
)
Abc_SclObjDupFanin
(
p
,
pObj
);
Abc_SclObjDupFanin
(
p
,
pObj
);
if
(
pArea
)
*
pArea
=
Abc_SclGetTotalArea
(
p
);
if
(
pDelay
)
*
pDelay
=
Abc_SclGetMaxDelay
(
p
);
}
}
/**Function*************************************************************
/**Function*************************************************************
...
@@ -277,11 +283,8 @@ SC_Man * Abc_SclManStart( SC_Lib * pLib, Abc_Ntk_t * pNtk, int fUseWireLoads )
...
@@ -277,11 +283,8 @@ SC_Man * Abc_SclManStart( SC_Lib * pLib, Abc_Ntk_t * pNtk, int fUseWireLoads )
p
->
fUseWireLoads
=
fUseWireLoads
;
p
->
fUseWireLoads
=
fUseWireLoads
;
assert
(
p
->
vGates
==
NULL
);
assert
(
p
->
vGates
==
NULL
);
p
->
vGates
=
Abc_SclManFindGates
(
pLib
,
pNtk
);
p
->
vGates
=
Abc_SclManFindGates
(
pLib
,
pNtk
);
// Abc_SclManUpsize( p );
Abc_SclTimeNtkRecompute
(
p
,
&
p
->
SumArea0
,
&
p
->
MaxDelay0
);
Abc_SclComputeLoad
(
p
);
p
->
SumArea
=
p
->
SumArea0
;
Abc_SclTimeNtk
(
p
);
p
->
SumArea
=
p
->
SumArea0
=
Abc_SclGetTotalArea
(
p
);
p
->
MaxDelay0
=
Abc_SclGetMaxDelay
(
p
);
return
p
;
return
p
;
}
}
...
...
src/map/scl/sclUpsize.c
0 → 100644
View file @
9b15f71f
/**CFile****************************************************************
FileName [sclUpsize.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Standard-cell library representation.]
Synopsis [Selective increase of gate sizes.]
Author [Alan Mishchenko, Niklas Een]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - August 24, 2012.]
Revision [$Id: sclUpsize.c,v 1.0 2012/08/24 00:00:00 alanmi Exp $]
***********************************************************************/
#include "sclInt.h"
#include "sclMan.h"
ABC_NAMESPACE_IMPL_START
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
/**Function*************************************************************
Synopsis [Begin by upsizing gates will many fanouts.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Abc_SclManUpsize
(
SC_Man
*
p
,
int
Degree
)
{
SC_Cell
*
pOld
,
*
pNew
;
Abc_Obj_t
*
pObj
;
int
i
,
Count
=
0
;
Abc_NtkForEachNode1
(
p
->
pNtk
,
pObj
,
i
)
{
if
(
Abc_ObjFanoutNum
(
pObj
)
<
Degree
)
continue
;
// find new gate
pOld
=
Abc_SclObjCell
(
p
,
pObj
);
pNew
=
Abc_SclObjResiable
(
p
,
pObj
,
1
);
if
(
pNew
==
NULL
)
continue
;
Vec_IntWriteEntry
(
p
->
vGates
,
Abc_ObjId
(
pObj
),
Abc_SclCellFind
(
p
->
pLib
,
pNew
->
pName
)
);
Count
++
;
}
return
Count
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Abc_SclUpsizingPerform
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
int
Degree
,
int
nRange
,
int
fVerbose
)
{
SC_Man
*
p
;
int
nUpsizes
;
// prepare the manager; collect init stats
p
=
Abc_SclManStart
(
pLib
,
pNtk
,
1
);
// perform upsizing
nUpsizes
=
Abc_SclManUpsize
(
p
,
Degree
);
// recompute timing
Abc_SclTimeNtkRecompute
(
p
,
&
p
->
SumArea
,
&
p
->
MaxDelay
);
// print cumulative statistics
printf
(
"Resized: %d. "
,
nUpsizes
);
printf
(
"Delay: "
);
printf
(
"%.2f -> %.2f ps "
,
SC_LibTimePs
(
p
->
pLib
,
p
->
MaxDelay0
),
SC_LibTimePs
(
p
->
pLib
,
p
->
MaxDelay
)
);
printf
(
"(%+.1f %%). "
,
100
.
0
*
(
p
->
MaxDelay
-
p
->
MaxDelay0
)
/
p
->
MaxDelay0
);
printf
(
"Area: "
);
printf
(
"%.2f -> %.2f "
,
p
->
SumArea0
,
p
->
SumArea
);
printf
(
"(%+.1f %%). "
,
100
.
0
*
(
p
->
SumArea
-
p
->
SumArea0
)
/
p
->
SumArea0
);
Abc_PrintTime
(
1
,
"Time"
,
clock
()
-
p
->
clkStart
);
// save the result and quit
Abc_SclManSetGates
(
pLib
,
pNtk
,
p
->
vGates
);
// updates gate pointers
Abc_SclManFree
(
p
);
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
ABC_NAMESPACE_IMPL_END
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