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
1e7ea2ca
Commit
1e7ea2ca
authored
Oct 09, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improvements to gate sizing.
parent
daeffe79
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
111 additions
and
62 deletions
+111
-62
src/base/abc/abcHie.c
+1
-1
src/map/scl/scl.c
+0
-0
src/map/scl/sclInt.h
+16
-1
src/map/scl/sclMan.h
+10
-3
src/map/scl/sclSize.c
+6
-5
src/map/scl/sclTime.c
+14
-13
src/map/scl/sclUpsize.c
+64
-39
No files found.
src/base/abc/abcHie.c
View file @
1e7ea2ca
...
...
@@ -436,7 +436,7 @@ void Abc_NtkPrintBoxInfo( Abc_Ntk_t * pNtk )
int
i
,
k
,
Num
;
if
(
pNtk
->
pDesign
==
NULL
||
pNtk
->
pDesign
->
vModules
==
NULL
)
{
printf
(
"There is no hierarchy information.
\n
"
);
//
printf( "There is no hierarchy information.\n" );
return
;
}
// sort models by name
...
...
src/map/scl/scl.c
View file @
1e7ea2ca
This diff is collapsed.
Click to expand it.
src/map/scl/sclInt.h
View file @
1e7ea2ca
...
...
@@ -74,6 +74,21 @@ struct SC_SizePars_
int
fVeryVerbose
;
};
typedef
struct
SC_UpSizePars_
SC_UpSizePars
;
struct
SC_UpSizePars_
{
int
nIters
;
int
nIterNoChange
;
int
Window
;
int
Ratio
;
int
Notches
;
int
TimeOut
;
int
fUseDept
;
int
fDumpStats
;
int
fVerbose
;
int
fVeryVerbose
;
};
////////////////////////////////////////////////////////////////////////
/// STRUCTURE DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
...
...
@@ -439,7 +454,7 @@ extern void Abc_SclTimePerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, int fU
/*=== sclSize.c ===============================================================*/
extern
void
Abc_SclSizingPerform
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
SC_SizePars
*
p
);
/*=== sclUpsize.c ===============================================================*/
extern
void
Abc_SclUpsizePerform
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
int
nIters
,
int
nIterNoChange
,
int
Window
,
int
Ratio
,
int
Notches
,
int
TimeOut
,
int
fDumpStats
,
int
fVerbose
,
int
fVeryVerbose
);
extern
void
Abc_SclUpsizePerform
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
SC_UpSizePars
*
pPars
);
/*=== 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 @
1e7ea2ca
...
...
@@ -64,6 +64,7 @@ struct SC_Man_
SC_Pair
*
pSlews
;
// slews for each gate
SC_Pair
*
pTimes2
;
// arrivals for each gate
SC_Pair
*
pSlews2
;
// slews for each gate
float
*
pSlack
;
// slacks for each gate
Vec_Flt_t
*
vTimesOut
;
// output arrival times
Vec_Que_t
*
vQue
;
// outputs by their time
SC_WireLoad
*
pWLoadUsed
;
// name of the used WireLoad model
...
...
@@ -147,6 +148,7 @@ static inline SC_Man * Abc_SclManAlloc( SC_Lib * pLib, Abc_Ntk_t * pNtk )
p
->
pSlews
=
ABC_CALLOC
(
SC_Pair
,
p
->
nObjs
);
p
->
pTimes2
=
ABC_CALLOC
(
SC_Pair
,
p
->
nObjs
);
p
->
pSlews2
=
ABC_CALLOC
(
SC_Pair
,
p
->
nObjs
);
p
->
pSlack
=
ABC_FALLOC
(
float
,
p
->
nObjs
);
p
->
vTimesOut
=
Vec_FltStart
(
Abc_NtkCoNum
(
pNtk
)
);
p
->
vQue
=
Vec_QueAlloc
(
Abc_NtkCoNum
(
pNtk
)
);
Vec_QueSetCosts
(
p
->
vQue
,
Vec_FltArray
(
p
->
vTimesOut
)
);
...
...
@@ -182,6 +184,7 @@ static inline void Abc_SclManFree( SC_Man * p )
ABC_FREE
(
p
->
pSlews
);
ABC_FREE
(
p
->
pTimes2
);
ABC_FREE
(
p
->
pSlews2
);
ABC_FREE
(
p
->
pSlack
);
ABC_FREE
(
p
);
}
static
inline
void
Abc_SclManCleanTime
(
SC_Man
*
p
)
...
...
@@ -300,6 +303,10 @@ static inline float Abc_SclGetMaxDelayNodeFanins( SC_Man * p, Abc_Obj_t * pNode
fMaxArr
=
Abc_MaxFloat
(
fMaxArr
,
Abc_SclObjTimeMax
(
p
,
pObj
)
);
return
fMaxArr
;
}
static
inline
float
Abc_SclReadMaxDelay
(
SC_Man
*
p
)
{
return
Abc_SclObjTimeMax
(
p
,
Abc_NtkPo
(
p
->
pNtk
,
Vec_QueTop
(
p
->
vQue
))
);
}
/**Function*************************************************************
...
...
@@ -340,8 +347,8 @@ static inline void Abc_SclDumpStats( SC_Man * p, char * pFileName, clock_t Time
fprintf
(
pTable
,
"%d "
,
Abc_NtkPiNum
(
p
->
pNtk
)
);
fprintf
(
pTable
,
"%d "
,
Abc_NtkPoNum
(
p
->
pNtk
)
);
fprintf
(
pTable
,
"%d "
,
Abc_NtkNodeNum
(
p
->
pNtk
)
);
fprintf
(
pTable
,
"%d "
,
(
int
)
p
->
SumArea
0
);
fprintf
(
pTable
,
"%d "
,
(
int
)
p
->
MaxDelay0
);
fprintf
(
pTable
,
"%d "
,
(
int
)
p
->
SumArea
);
fprintf
(
pTable
,
"%d "
,
(
int
)
SC_LibTimePs
(
p
->
pLib
,
p
->
MaxDelay
)
);
fprintf
(
pTable
,
"%.2f "
,
1
.
0
*
Time
/
CLOCKS_PER_SEC
);
fprintf
(
pTable
,
"
\n
"
);
fclose
(
pTable
);
...
...
@@ -352,7 +359,7 @@ static inline void Abc_SclDumpStats( SC_Man * p, char * pFileName, clock_t Time
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
,
int
fShort
);
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
,
int
fDept
);
extern
void
Abc_SclTimeCone
(
SC_Man
*
p
,
Vec_Int_t
*
vCone
);
extern
void
Abc_SclTimeNtkRecompute
(
SC_Man
*
p
,
float
*
pArea
,
float
*
pDelay
,
int
fReverse
);
/*=== sclTime.c =============================================================*/
...
...
src/map/scl/sclSize.c
View file @
1e7ea2ca
...
...
@@ -67,7 +67,8 @@ Vec_Int_t * Abc_SclCollectNodes( Abc_Ntk_t * p )
***********************************************************************/
Vec_Int_t
*
Abc_SclFindCriticalCoRange
(
SC_Man
*
p
,
int
Range
)
{
float
fMaxArr
=
Abc_SclGetMaxDelay
(
p
)
*
(
100
.
0
-
Range
)
/
100
.
0
;
// float fMaxArr = Abc_SclGetMaxDelay( p ) * (100.0 - Range) / 100.0;
float
fMaxArr
=
Abc_SclReadMaxDelay
(
p
)
*
(
100
.
0
-
Range
)
/
100
.
0
;
Vec_Int_t
*
vPivots
;
Abc_Obj_t
*
pObj
;
int
i
;
...
...
@@ -333,7 +334,7 @@ void Abc_SclUpdateNetwork( SC_Man * p, Abc_Obj_t * pObj, int nCone, int fUpsize,
printf
(
"%5d :"
,
iStep
);
printf
(
"%7d "
,
Abc_ObjId
(
pObj
)
);
printf
(
"%-12s-> %-12s "
,
pOld
->
pName
,
pNew
->
pName
);
printf
(
"d =%8.2f ps "
,
SC_LibTimePs
(
p
->
pLib
,
Abc_Scl
Get
MaxDelay
(
p
))
);
printf
(
"d =%8.2f ps "
,
SC_LibTimePs
(
p
->
pLib
,
Abc_Scl
Read
MaxDelay
(
p
))
);
printf
(
"a =%10.2f "
,
p
->
SumArea
);
printf
(
"n =%5d "
,
nCone
);
// Abc_PrintTime( 1, "Time", clock() - p->timeTotal );
...
...
@@ -365,7 +366,7 @@ void Abc_SclSizingPerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, SC_SizePars * pPars
Abc_Obj_t
*
pBest
;
clock_t
nRuntimeLimit
=
pPars
->
nTimeOut
?
pPars
->
nTimeOut
*
CLOCKS_PER_SEC
+
clock
()
:
0
;
int
r
,
i
,
nNodes
,
nCones
=
0
,
nDownSize
=
0
;
p
=
Abc_SclManStart
(
pLib
,
pNtk
,
pPars
->
fUseWireLoads
);
p
=
Abc_SclManStart
(
pLib
,
pNtk
,
pPars
->
fUseWireLoads
,
0
);
p
->
timeTotal
=
clock
();
if
(
pPars
->
fPrintCP
)
Abc_SclTimeNtkPrint
(
p
,
0
,
0
);
...
...
@@ -375,7 +376,7 @@ void Abc_SclSizingPerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, SC_SizePars * pPars
{
// printf( "%5d : ", 0 );
printf
(
"Starting parameters of current mapping: "
);
printf
(
"d =%8.2f ps "
,
SC_LibTimePs
(
p
->
pLib
,
Abc_Scl
Get
MaxDelay
(
p
))
);
printf
(
"d =%8.2f ps "
,
SC_LibTimePs
(
p
->
pLib
,
Abc_Scl
Read
MaxDelay
(
p
))
);
printf
(
"a =%10.2f "
,
p
->
SumArea
);
printf
(
" "
);
Abc_PrintTime
(
1
,
"Time"
,
clock
()
-
p
->
timeTotal
);
...
...
@@ -458,7 +459,7 @@ void Abc_SclSizingPerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, SC_SizePars * pPars
printf
(
"
\n
"
);
}
p
->
MaxDelay
=
Abc_Scl
Get
MaxDelay
(
p
);
p
->
MaxDelay
=
Abc_Scl
Read
MaxDelay
(
p
);
if
(
pPars
->
fPrintCP
)
Abc_SclTimeNtkPrint
(
p
,
0
,
0
);
if
(
nRuntimeLimit
&&
clock
()
>
nRuntimeLimit
)
...
...
src/map/scl/sclTime.c
View file @
1e7ea2ca
...
...
@@ -226,7 +226,7 @@ void Abc_SclDeptFanin( SC_Man * p, SC_Timing * pTime, Abc_Obj_t * pObj, Abc_Obj_
pDepIn
->
rise
=
Abc_MaxFloat
(
pDepIn
->
rise
,
pDepOut
->
fall
+
Abc_SclLookup
(
pTime
->
pCellFall
,
pSlewIn
->
rise
,
pLoad
->
fall
)
);
}
}
void
Abc_SclTimeNode
(
SC_Man
*
p
,
Abc_Obj_t
*
pObj
,
int
fDept
)
void
Abc_SclTimeNode
(
SC_Man
*
p
,
Abc_Obj_t
*
pObj
,
int
fDept
,
float
D
)
{
SC_Timings
*
pRTime
;
SC_Timing
*
pTime
;
...
...
@@ -256,6 +256,8 @@ void Abc_SclTimeNode( SC_Man * p, Abc_Obj_t * pObj, int fDept )
else
Abc_SclTimeFanin
(
p
,
pTime
,
pObj
,
Abc_ObjFanin
(
pObj
,
k
)
);
}
if
(
fDept
)
p
->
pSlack
[
Abc_ObjId
(
pObj
)]
=
Abc_MaxFloat
(
0
.
0
,
Abc_SclObjSlack
(
p
,
pObj
,
D
)
);
}
void
Abc_SclTimeCone
(
SC_Man
*
p
,
Vec_Int_t
*
vCone
)
{
...
...
@@ -269,7 +271,7 @@ void Abc_SclTimeCone( SC_Man * p, Vec_Int_t * vCone )
printf
(
" Updating node %d with gate %s
\n
"
,
Abc_ObjId
(
pObj
),
Abc_SclObjCell
(
p
,
pObj
)
->
pName
);
if
(
fVerbose
&&
Abc_ObjIsNode
(
pObj
)
)
printf
(
" before (%6.1f ps %6.1f ps) "
,
Abc_SclObjTimePs
(
p
,
pObj
,
1
),
Abc_SclObjTimePs
(
p
,
pObj
,
0
)
);
Abc_SclTimeNode
(
p
,
pObj
,
0
);
Abc_SclTimeNode
(
p
,
pObj
,
0
,
0
);
if
(
fVerbose
&&
Abc_ObjIsNode
(
pObj
)
)
printf
(
"after (%6.1f ps %6.1f ps)
\n
"
,
Abc_SclObjTimePs
(
p
,
pObj
,
1
),
Abc_SclObjTimePs
(
p
,
pObj
,
0
)
);
}
...
...
@@ -277,27 +279,26 @@ void Abc_SclTimeCone( SC_Man * p, Vec_Int_t * vCone )
void
Abc_SclTimeNtkRecompute
(
SC_Man
*
p
,
float
*
pArea
,
float
*
pDelay
,
int
fReverse
)
{
Abc_Obj_t
*
pObj
;
float
D
;
int
i
;
Abc_SclComputeLoad
(
p
);
Abc_SclManCleanTime
(
p
);
Abc_NtkForEachNode1
(
p
->
pNtk
,
pObj
,
i
)
Abc_SclTimeNode
(
p
,
pObj
,
0
);
if
(
fReverse
)
Abc_NtkForEachNodeReverse1
(
p
->
pNtk
,
pObj
,
i
)
Abc_SclTimeNode
(
p
,
pObj
,
1
);
Abc_SclTimeNode
(
p
,
pObj
,
0
,
0
);
Abc_NtkForEachCo
(
p
->
pNtk
,
pObj
,
i
)
{
Abc_SclObjDupFanin
(
p
,
pObj
);
Vec_FltWriteEntry
(
p
->
vTimesOut
,
i
,
Abc_SclObjTimeMax
(
p
,
pObj
)
);
Vec_QueUpdate
(
p
->
vQue
,
i
);
}
// Vec_FltClear( p->vTimesOut );
// Abc_NtkForEachCo( p->pNtk, pObj, i )
// Vec_FltPush( p->vTimesOut, Abc_SclObjTimeMax(p, pObj) );
D
=
Abc_SclReadMaxDelay
(
p
);
if
(
pArea
)
*
pArea
=
Abc_SclGetTotalArea
(
p
);
if
(
pDelay
)
*
pDelay
=
Abc_SclGetMaxDelay
(
p
);
*
pDelay
=
D
;
if
(
fReverse
)
Abc_NtkForEachNodeReverse1
(
p
->
pNtk
,
pObj
,
i
)
Abc_SclTimeNode
(
p
,
pObj
,
1
,
D
);
}
/**Function*************************************************************
...
...
@@ -311,14 +312,14 @@ void Abc_SclTimeNtkRecompute( SC_Man * p, float * pArea, float * pDelay, int fRe
SeeAlso []
***********************************************************************/
SC_Man
*
Abc_SclManStart
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
int
fUseWireLoads
)
SC_Man
*
Abc_SclManStart
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
int
fUseWireLoads
,
int
fDept
)
{
SC_Man
*
p
=
Abc_SclManAlloc
(
pLib
,
pNtk
);
assert
(
p
->
vGates
==
NULL
);
p
->
vGates
=
Abc_SclManFindGates
(
pLib
,
pNtk
);
if
(
fUseWireLoads
)
p
->
pWLoadUsed
=
Abc_SclFindWireLoadModel
(
pLib
,
Abc_SclGetTotalArea
(
p
)
);
Abc_SclTimeNtkRecompute
(
p
,
&
p
->
SumArea0
,
&
p
->
MaxDelay0
,
0
);
Abc_SclTimeNtkRecompute
(
p
,
&
p
->
SumArea0
,
&
p
->
MaxDelay0
,
fDept
);
p
->
SumArea
=
p
->
SumArea0
;
return
p
;
}
...
...
@@ -337,7 +338,7 @@ SC_Man * Abc_SclManStart( SC_Lib * pLib, Abc_Ntk_t * pNtk, int fUseWireLoads )
void
Abc_SclTimePerform
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
int
fUseWireLoads
,
int
fShowAll
,
int
fShort
,
int
fDumpStats
)
{
SC_Man
*
p
;
p
=
Abc_SclManStart
(
pLib
,
pNtk
,
fUseWireLoads
);
p
=
Abc_SclManStart
(
pLib
,
pNtk
,
fUseWireLoads
,
1
);
Abc_SclTimeNtkPrint
(
p
,
fShowAll
,
fShort
);
if
(
fDumpStats
)
Abc_SclDumpStats
(
p
,
"stats.txt"
,
0
);
...
...
src/map/scl/sclUpsize.c
View file @
1e7ea2ca
This diff is collapsed.
Click to expand it.
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