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
84c0b9d6
Commit
84c0b9d6
authored
Jul 23, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tuning standard-cell mapping flow.
parent
038f2964
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
137 additions
and
94 deletions
+137
-94
src/aig/aig/aigDfs.c
+2
-3
src/base/abci/abcTiming.c
+28
-16
src/base/io/ioWriteBlif.c
+1
-1
src/map/scl/scl.c
+0
-0
src/map/scl/sclBuff.c
+12
-7
src/map/scl/sclLib.c
+69
-43
src/map/scl/sclLib.h
+3
-2
src/map/scl/sclSize.c
+19
-19
src/map/scl/sclSize.h
+3
-3
No files found.
src/aig/aig/aigDfs.c
View file @
84c0b9d6
...
...
@@ -398,13 +398,12 @@ Vec_Ptr_t * Aig_ManDfsChoices( Aig_Man_t * p )
{
if
(
Aig_ObjEquiv
(
p
,
pObj
)
==
NULL
)
continue
;
Counter
=
0
;
for
(
pObj
=
Aig_ObjEquiv
(
p
,
pObj
)
;
pObj
;
pObj
=
Aig_ObjEquiv
(
p
,
pObj
)
)
Counter
++
;
printf
(
"%d "
,
Counter
);
//
printf( "%d ", Counter );
}
printf
(
"
\n
"
);
//
printf( "\n" );
assert
(
p
->
pEquivs
!=
NULL
);
Aig_ManIncrementTravId
(
p
);
...
...
src/base/abci/abcTiming.c
View file @
84c0b9d6
...
...
@@ -300,8 +300,8 @@ void Abc_NtkTimeInitialize( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkOld )
Abc_Time_t
**
ppTimes
,
*
pTime
;
int
i
;
assert
(
pNtkOld
==
NULL
||
pNtkOld
->
pManTime
!=
NULL
);
assert
(
pNtkOld
==
NULL
||
Abc_Ntk
PiNum
(
pNtk
)
==
Abc_NtkP
iNum
(
pNtkOld
)
);
assert
(
pNtkOld
==
NULL
||
Abc_Ntk
PoNum
(
pNtk
)
==
Abc_NtkP
oNum
(
pNtkOld
)
);
assert
(
pNtkOld
==
NULL
||
Abc_Ntk
CiNum
(
pNtk
)
==
Abc_NtkC
iNum
(
pNtkOld
)
);
assert
(
pNtkOld
==
NULL
||
Abc_Ntk
CoNum
(
pNtk
)
==
Abc_NtkC
oNum
(
pNtkOld
)
);
if
(
pNtk
->
pManTime
==
NULL
)
return
;
Abc_ManTimeExpand
(
pNtk
->
pManTime
,
Abc_NtkObjNumMax
(
pNtk
),
0
);
...
...
@@ -314,7 +314,7 @@ void Abc_NtkTimeInitialize( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkOld )
}
// set the default timing
ppTimes
=
(
Abc_Time_t
**
)
pNtk
->
pManTime
->
vArrs
->
pArray
;
Abc_NtkForEach
P
i
(
pNtk
,
pObj
,
i
)
Abc_NtkForEach
C
i
(
pNtk
,
pObj
,
i
)
{
pTime
=
ppTimes
[
pObj
->
Id
];
if
(
Abc_MaxFloat
(
pTime
->
Fall
,
pTime
->
Rise
)
!=
-
ABC_INFINITY
)
...
...
@@ -323,10 +323,10 @@ void Abc_NtkTimeInitialize( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkOld )
}
// set the default timing
ppTimes
=
(
Abc_Time_t
**
)
pNtk
->
pManTime
->
vReqs
->
pArray
;
Abc_NtkForEach
P
o
(
pNtk
,
pObj
,
i
)
Abc_NtkForEach
C
o
(
pNtk
,
pObj
,
i
)
{
pTime
=
ppTimes
[
pObj
->
Id
];
if
(
Abc_MaxFloat
(
pTime
->
Fall
,
pTime
->
Rise
)
!=
-
ABC_INFINITY
)
if
(
Abc_MaxFloat
(
pTime
->
Fall
,
pTime
->
Rise
)
!=
ABC_INFINITY
)
continue
;
*
pTime
=
pNtkOld
?
*
Abc_NodeReadRequired
(
Abc_NtkPo
(
pNtkOld
,
i
))
:
pNtk
->
pManTime
->
tReqDef
;
}
...
...
@@ -371,7 +371,7 @@ void Abc_NtkTimePrepare( Abc_Ntk_t * pNtk )
pTime
=
ppTimes
[
pObj
->
Id
];
pTime
->
Fall
=
pTime
->
Rise
=
-
ABC_INFINITY
;
}
Abc_NtkForEach
P
o
(
pNtk
,
pObj
,
i
)
Abc_NtkForEach
C
o
(
pNtk
,
pObj
,
i
)
{
pTime
=
ppTimes
[
pObj
->
Id
];
pTime
->
Fall
=
pTime
->
Rise
=
-
ABC_INFINITY
;
...
...
@@ -381,12 +381,12 @@ void Abc_NtkTimePrepare( Abc_Ntk_t * pNtk )
Abc_NtkForEachNode
(
pNtk
,
pObj
,
i
)
{
pTime
=
ppTimes
[
pObj
->
Id
];
pTime
->
Fall
=
pTime
->
Rise
=
-
ABC_INFINITY
;
pTime
->
Fall
=
pTime
->
Rise
=
ABC_INFINITY
;
}
Abc_NtkForEach
P
i
(
pNtk
,
pObj
,
i
)
Abc_NtkForEach
C
i
(
pNtk
,
pObj
,
i
)
{
pTime
=
ppTimes
[
pObj
->
Id
];
pTime
->
Fall
=
pTime
->
Rise
=
-
ABC_INFINITY
;
pTime
->
Fall
=
pTime
->
Rise
=
ABC_INFINITY
;
}
}
...
...
@@ -411,6 +411,8 @@ Abc_ManTime_t * Abc_ManTimeStart()
memset
(
p
,
0
,
sizeof
(
Abc_ManTime_t
)
);
p
->
vArrs
=
Vec_PtrAlloc
(
0
);
p
->
vReqs
=
Vec_PtrAlloc
(
0
);
p
->
tReqDef
.
Rise
=
ABC_INFINITY
;
p
->
tReqDef
.
Fall
=
ABC_INFINITY
;
return
p
;
}
...
...
@@ -540,8 +542,8 @@ void Abc_ManTimeExpand( Abc_ManTime_t * p, int nSize, int fProgressive )
for
(
i
=
nSizeOld
;
i
<
nSizeNew
;
i
++
)
{
pTime
=
(
Abc_Time_t
*
)
vTimes
->
pArray
[
i
];
pTime
->
Rise
=
-
ABC_INFINITY
;
pTime
->
Fall
=
-
ABC_INFINITY
;
pTime
->
Rise
=
ABC_INFINITY
;
pTime
->
Fall
=
ABC_INFINITY
;
}
}
...
...
@@ -571,7 +573,7 @@ void Abc_NtkSetNodeLevelsArrival( Abc_Ntk_t * pNtkOld )
if
(
Abc_FrameReadLibGen
()
==
NULL
||
Mio_LibraryReadNand2
((
Mio_Library_t
*
)
Abc_FrameReadLibGen
())
==
NULL
)
return
;
tAndDelay
=
Mio_LibraryReadDelayNand2Max
((
Mio_Library_t
*
)
Abc_FrameReadLibGen
());
Abc_NtkForEach
P
i
(
pNtkOld
,
pNodeOld
,
i
)
Abc_NtkForEach
C
i
(
pNtkOld
,
pNodeOld
,
i
)
{
pNodeNew
=
pNodeOld
->
pCopy
;
pNodeNew
->
Level
=
(
int
)(
Abc_NodeReadArrivalWorst
(
pNodeOld
)
/
tAndDelay
);
...
...
@@ -598,7 +600,7 @@ Abc_Time_t * Abc_NtkGetCiArrivalTimes( Abc_Ntk_t * pNtk )
if
(
pNtk
->
pManTime
==
NULL
)
return
p
;
// set the PI arrival times
Abc_NtkForEach
P
i
(
pNtk
,
pNode
,
i
)
Abc_NtkForEach
C
i
(
pNtk
,
pNode
,
i
)
p
[
i
]
=
*
Abc_NodeArrival
(
pNode
);
return
p
;
}
...
...
@@ -611,7 +613,7 @@ Abc_Time_t * Abc_NtkGetCoRequiredTimes( Abc_Ntk_t * pNtk )
if
(
pNtk
->
pManTime
==
NULL
)
return
p
;
// set the PO required times
Abc_NtkForEach
P
o
(
pNtk
,
pNode
,
i
)
Abc_NtkForEach
C
o
(
pNtk
,
pNode
,
i
)
p
[
i
]
=
*
Abc_NodeRequired
(
pNode
);
return
p
;
}
...
...
@@ -636,8 +638,13 @@ float * Abc_NtkGetCiArrivalFloats( Abc_Ntk_t * pNtk )
p
=
ABC_CALLOC
(
float
,
Abc_NtkCiNum
(
pNtk
)
);
if
(
pNtk
->
pManTime
==
NULL
)
return
p
;
Abc_NtkForEachCi
(
pNtk
,
pNode
,
i
)
if
(
Abc_NodeReadArrivalWorst
(
pNode
)
!=
0
)
break
;
if
(
i
==
Abc_NtkCiNum
(
pNtk
)
)
return
NULL
;
// set the PI arrival times
Abc_NtkForEach
P
i
(
pNtk
,
pNode
,
i
)
Abc_NtkForEach
C
i
(
pNtk
,
pNode
,
i
)
p
[
i
]
=
Abc_NodeReadArrivalWorst
(
pNode
);
return
p
;
}
...
...
@@ -648,9 +655,14 @@ float * Abc_NtkGetCoRequiredFloats( Abc_Ntk_t * pNtk )
int
i
;
if
(
pNtk
->
pManTime
==
NULL
)
return
NULL
;
Abc_NtkForEachCo
(
pNtk
,
pNode
,
i
)
if
(
Abc_NodeReadRequiredWorst
(
pNode
)
!=
ABC_INFINITY
)
break
;
if
(
i
==
Abc_NtkCoNum
(
pNtk
)
)
return
NULL
;
// set the PO required times
p
=
ABC_CALLOC
(
float
,
Abc_NtkCoNum
(
pNtk
)
);
Abc_NtkForEach
P
o
(
pNtk
,
pNode
,
i
)
Abc_NtkForEach
C
o
(
pNtk
,
pNode
,
i
)
p
[
i
]
=
Abc_NodeReadRequiredWorst
(
pNode
);
return
p
;
}
...
...
src/base/io/ioWriteBlif.c
View file @
84c0b9d6
...
...
@@ -703,7 +703,7 @@ void Io_WriteTimingInfo( FILE * pFile, Abc_Ntk_t * pNtk )
}
pTimeDef
=
Abc_NtkReadDefaultRequired
(
pNtk
);
if
(
pTimeDef
->
Rise
!=
0
.
0
||
pTimeDef
->
Fall
!=
0
.
0
)
if
(
pTimeDef
->
Rise
!=
ABC_INFINITY
||
pTimeDef
->
Fall
!=
ABC_INFINITY
)
fprintf
(
pFile
,
".default_output_required %g %g
\n
"
,
pTimeDef
->
Rise
,
pTimeDef
->
Fall
);
Abc_NtkForEachPo
(
pNtk
,
pNode
,
i
)
{
...
...
src/map/scl/scl.c
View file @
84c0b9d6
This diff is collapsed.
Click to expand it.
src/map/scl/sclBuff.c
View file @
84c0b9d6
...
...
@@ -127,7 +127,7 @@ int Abc_SclComputeReverseLevel( Abc_Obj_t * pObj )
Level
=
Abc_MaxInt
(
Level
,
pFanout
->
Level
);
return
Level
+
1
;
}
Abc_Obj_t
*
Abc_SclPerformBufferingOne
(
Abc_Obj_t
*
pObj
,
int
Degree
,
int
fVerbose
)
Abc_Obj_t
*
Abc_SclPerformBufferingOne
(
Abc_Obj_t
*
pObj
,
int
Degree
,
int
f
UseInvs
,
int
f
Verbose
)
{
Vec_Ptr_t
*
vFanouts
;
Abc_Obj_t
*
pBuffer
,
*
pFanout
;
...
...
@@ -138,7 +138,10 @@ Abc_Obj_t * Abc_SclPerformBufferingOne( Abc_Obj_t * pObj, int Degree, int fVerbo
Abc_NodeCollectFanouts
(
pObj
,
vFanouts
);
Vec_PtrSort
(
vFanouts
,
(
int
(
*
)(
void
))
Abc_NodeCompareLevels
);
// select the first Degree fanouts
pBuffer
=
Abc_NtkCreateNodeBuf
(
pObj
->
pNtk
,
NULL
);
if
(
fUseInvs
)
pBuffer
=
Abc_NtkCreateNodeInv
(
pObj
->
pNtk
,
NULL
);
else
pBuffer
=
Abc_NtkCreateNodeBuf
(
pObj
->
pNtk
,
NULL
);
// check if it is possible to not increase level
if
(
Vec_PtrSize
(
vFanouts
)
<
2
*
Degree
)
{
...
...
@@ -176,7 +179,7 @@ Abc_Obj_t * Abc_SclPerformBufferingOne( Abc_Obj_t * pObj, int Degree, int fVerbo
pBuffer
->
Level
=
Abc_SclComputeReverseLevel
(
pBuffer
);
return
pBuffer
;
}
void
Abc_SclPerformBuffering_rec
(
Abc_Obj_t
*
pObj
,
int
Degree
,
int
fVerbose
)
void
Abc_SclPerformBuffering_rec
(
Abc_Obj_t
*
pObj
,
int
Degree
,
int
f
UseInvs
,
int
f
Verbose
)
{
Abc_Obj_t
*
pFanout
;
int
i
;
...
...
@@ -189,20 +192,22 @@ void Abc_SclPerformBuffering_rec( Abc_Obj_t * pObj, int Degree, int fVerbose )
assert
(
Abc_ObjIsCi
(
pObj
)
||
Abc_ObjIsNode
(
pObj
)
);
// buffer fanouts and collect reverse levels
Abc_ObjForEachFanout
(
pObj
,
pFanout
,
i
)
Abc_SclPerformBuffering_rec
(
pFanout
,
Degree
,
fVerbose
);
Abc_SclPerformBuffering_rec
(
pFanout
,
Degree
,
f
UseInvs
,
f
Verbose
);
// perform buffering as long as needed
while
(
Abc_ObjFanoutNum
(
pObj
)
>
Degree
)
Abc_SclPerformBufferingOne
(
pObj
,
Degree
,
fVerbose
);
Abc_SclPerformBufferingOne
(
pObj
,
Degree
,
f
UseInvs
,
f
Verbose
);
// compute the new level of the node
pObj
->
Level
=
Abc_SclComputeReverseLevel
(
pObj
);
}
Abc_Ntk_t
*
Abc_SclPerformBuffering
(
Abc_Ntk_t
*
p
,
int
Degree
,
int
fVerbose
)
Abc_Ntk_t
*
Abc_SclPerformBuffering
(
Abc_Ntk_t
*
p
,
int
Degree
,
int
f
UseInvs
,
int
f
Verbose
)
{
Vec_Int_t
*
vCiLevs
;
Abc_Ntk_t
*
pNew
;
Abc_Obj_t
*
pObj
;
int
i
;
assert
(
Abc_NtkHasMapping
(
p
)
);
if
(
fUseInvs
)
printf
(
"Warning!!! Using inverters instead of buffers.
\n
"
);
// remember CI levels
vCiLevs
=
Vec_IntAlloc
(
Abc_NtkCiNum
(
p
)
);
Abc_NtkForEachCi
(
p
,
pObj
,
i
)
...
...
@@ -210,7 +215,7 @@ Abc_Ntk_t * Abc_SclPerformBuffering( Abc_Ntk_t * p, int Degree, int fVerbose )
// perform buffering
Abc_NtkIncrementTravId
(
p
);
Abc_NtkForEachCi
(
p
,
pObj
,
i
)
Abc_SclPerformBuffering_rec
(
pObj
,
Degree
,
fVerbose
);
Abc_SclPerformBuffering_rec
(
pObj
,
Degree
,
f
UseInvs
,
f
Verbose
);
// recompute logic levels
Abc_NtkForEachCi
(
p
,
pObj
,
i
)
pObj
->
Level
=
Vec_IntEntry
(
vCiLevs
,
i
);
...
...
src/map/scl/sclLib.c
View file @
84c0b9d6
...
...
@@ -713,6 +713,14 @@ int Abc_SclCellFind( SC_Lib * p, char * pName )
{
return
*
Abc_SclHashLookup
(
p
,
pName
);
}
int
Abc_SclClassCellNum
(
SC_Cell
*
pClass
)
{
SC_Cell
*
pCell
;
int
i
,
Count
=
0
;
SC_RingForEachCell
(
pClass
,
pCell
,
i
)
Count
++
;
return
Count
;
}
/**Function*************************************************************
...
...
@@ -854,7 +862,7 @@ SC_WireLoad * Abc_SclFindWireLoadModel( SC_Lib * p, float Area )
SeeAlso []
***********************************************************************/
void
Abc_SclComputeParametersPin
(
SC_Lib
*
p
,
SC_Cell
*
pCell
,
int
iPin
,
float
Slew
,
float
*
p
L
D
,
float
*
pPD
)
void
Abc_SclComputeParametersPin
(
SC_Lib
*
p
,
SC_Cell
*
pCell
,
int
iPin
,
float
Slew
,
float
*
p
E
D
,
float
*
pPD
)
{
SC_Timings
*
pRTime
;
SC_Timing
*
pTime
=
NULL
;
...
...
@@ -887,59 +895,59 @@ void Abc_SclComputeParametersPin( SC_Lib * p, SC_Cell * pCell, int iPin, float S
ArrOut1
.
rise
=
0
.
5
*
(
ArrOut1
.
rise
+
ArrOut1
.
fall
);
ArrOut2
.
rise
=
0
.
5
*
(
ArrOut2
.
rise
+
ArrOut2
.
fall
);
// get tangent
*
p
L
D
=
(
ArrOut2
.
rise
-
ArrOut1
.
rise
)
/
((
Load2
.
rise
-
Load1
.
rise
)
/
SC_CellPinCap
(
pCell
,
iPin
));
*
p
E
D
=
(
ArrOut2
.
rise
-
ArrOut1
.
rise
)
/
((
Load2
.
rise
-
Load1
.
rise
)
/
SC_CellPinCap
(
pCell
,
iPin
));
// get constant
*
pPD
=
ArrOut0
.
rise
;
}
void
Abc_SclComputeParametersCell
(
SC_Lib
*
p
,
SC_Cell
*
pCell
,
float
Slew
,
float
*
p
L
D
,
float
*
pPD
)
void
Abc_SclComputeParametersCell
(
SC_Lib
*
p
,
SC_Cell
*
pCell
,
float
Slew
,
float
*
p
E
D
,
float
*
pPD
)
{
SC_Pin
*
pPin
;
float
LD
,
PD
,
l
d
,
pd
;
float
ED
,
PD
,
e
d
,
pd
;
int
i
;
LD
=
PD
=
l
d
=
pd
=
0
;
ED
=
PD
=
e
d
=
pd
=
0
;
SC_CellForEachPinIn
(
pCell
,
pPin
,
i
)
{
Abc_SclComputeParametersPin
(
p
,
pCell
,
i
,
Slew
,
&
l
d
,
&
pd
);
LD
+=
l
d
;
PD
+=
pd
;
Abc_SclComputeParametersPin
(
p
,
pCell
,
i
,
Slew
,
&
e
d
,
&
pd
);
ED
+=
e
d
;
PD
+=
pd
;
}
*
p
LD
=
L
D
/
pCell
->
n_inputs
;
*
p
ED
=
E
D
/
pCell
->
n_inputs
;
*
pPD
=
PD
/
pCell
->
n_inputs
;
}
void
Abc_SclComputeParametersClass
(
SC_Lib
*
p
,
SC_Cell
*
pRepr
,
float
Slew
,
float
*
p
L
D
,
float
*
pPD
)
void
Abc_SclComputeParametersClass
(
SC_Lib
*
p
,
SC_Cell
*
pRepr
,
float
Slew
,
float
*
p
E
D
,
float
*
pPD
)
{
SC_Cell
*
pCell
;
float
LD
,
PD
,
l
d
,
pd
;
float
ED
,
PD
,
e
d
,
pd
;
int
i
,
Count
=
0
;
LD
=
PD
=
l
d
=
pd
=
0
;
ED
=
PD
=
e
d
=
pd
=
0
;
SC_RingForEachCell
(
pRepr
,
pCell
,
i
)
{
Abc_SclComputeParametersCell
(
p
,
pCell
,
Slew
,
&
l
d
,
&
pd
);
LD
+=
l
d
;
PD
+=
pd
;
Abc_SclComputeParametersCell
(
p
,
pCell
,
Slew
,
&
e
d
,
&
pd
);
ED
+=
e
d
;
PD
+=
pd
;
Count
++
;
}
*
p
LD
=
L
D
/
Count
;
*
p
ED
=
E
D
/
Count
;
*
pPD
=
PD
/
Count
;
}
void
Abc_SclComputeParametersClassPin
(
SC_Lib
*
p
,
SC_Cell
*
pRepr
,
int
iPin
,
float
Slew
,
float
*
p
L
D
,
float
*
pPD
)
void
Abc_SclComputeParametersClassPin
(
SC_Lib
*
p
,
SC_Cell
*
pRepr
,
int
iPin
,
float
Slew
,
float
*
p
E
D
,
float
*
pPD
)
{
SC_Cell
*
pCell
;
float
LD
,
PD
,
l
d
,
pd
;
float
ED
,
PD
,
e
d
,
pd
;
int
i
,
Count
=
0
;
LD
=
PD
=
l
d
=
pd
=
0
;
ED
=
PD
=
e
d
=
pd
=
0
;
SC_RingForEachCell
(
pRepr
,
pCell
,
i
)
{
Abc_SclComputeParametersPin
(
p
,
pCell
,
Slew
,
iPin
,
&
l
d
,
&
pd
);
LD
+=
l
d
;
PD
+=
pd
;
Abc_SclComputeParametersPin
(
p
,
pCell
,
Slew
,
iPin
,
&
e
d
,
&
pd
);
ED
+=
e
d
;
PD
+=
pd
;
Count
++
;
}
*
p
LD
=
L
D
/
Count
;
*
p
ED
=
E
D
/
Count
;
*
pPD
=
PD
/
Count
;
}
float
Abc_SclComputeDelayCellPin
(
SC_Lib
*
p
,
SC_Cell
*
pCell
,
int
iPin
,
float
Slew
,
float
Gain
)
{
float
L
D
=
0
,
PD
=
0
;
Abc_SclComputeParametersPin
(
p
,
pCell
,
iPin
,
Slew
,
&
L
D
,
&
PD
);
return
L
D
*
Gain
+
PD
;
float
E
D
=
0
,
PD
=
0
;
Abc_SclComputeParametersPin
(
p
,
pCell
,
iPin
,
Slew
,
&
E
D
,
&
PD
);
return
0
.
01
*
E
D
*
Gain
+
PD
;
}
float
Abc_SclComputeDelayClassPin
(
SC_Lib
*
p
,
SC_Cell
*
pRepr
,
int
iPin
,
float
Slew
,
float
Gain
)
{
...
...
@@ -947,11 +955,14 @@ float Abc_SclComputeDelayClassPin( SC_Lib * p, SC_Cell * pRepr, int iPin, float
float
Delay
=
0
;
int
i
,
Count
=
0
;
SC_RingForEachCell
(
pRepr
,
pCell
,
i
)
Count
++
;
SC_RingForEachCell
(
pRepr
,
pCell
,
i
)
{
if
(
pRepr
==
pCell
&&
Count
>
1
)
// skip the first gate
continue
;
Delay
+=
Abc_SclComputeDelayCellPin
(
p
,
pCell
,
iPin
,
Slew
,
Gain
);
Count
++
;
}
return
Delay
/
Count
;
return
Delay
/
Abc_MaxInt
(
1
,
Count
-
1
)
;
}
float
Abc_SclComputeAreaClass
(
SC_Cell
*
pRepr
)
{
...
...
@@ -977,16 +988,16 @@ float Abc_SclComputeAreaClass( SC_Cell * pRepr )
SeeAlso []
***********************************************************************/
void
Abc_SclPrintCells
(
SC_Lib
*
p
)
void
Abc_SclPrintCells
(
SC_Lib
*
p
,
float
Slew
,
float
Gain
)
{
SC_Cell
*
pCell
,
*
pRepr
;
int
i
,
k
,
nLength
=
0
;
float
LD
=
0
,
PD
=
0
;
float
SlewDef
=
100
;
float
ED
=
0
,
PD
=
0
;
assert
(
Vec_PtrSize
(
p
->
vCellClasses
)
>
0
);
printf
(
"Library
\"
%s
\"
"
,
p
->
pName
);
printf
(
"
containing %d cells in %d classes.
\n
"
,
printf
(
"
has %d cells in %d classes.
"
,
Vec_PtrSize
(
p
->
vCells
),
Vec_PtrSize
(
p
->
vCellClasses
)
);
printf
(
"Delay estimate is based on slew %.2f and gain %.2f.
\n
"
,
Slew
,
Gain
);
// find the longest name
SC_LibForEachCellClass
(
p
,
pRepr
,
k
)
SC_RingForEachCell
(
pRepr
,
pCell
,
i
)
...
...
@@ -1005,14 +1016,18 @@ void Abc_SclPrintCells( SC_Lib * p )
printf
(
"
\n
"
);
SC_RingForEachCell
(
pRepr
,
pCell
,
i
)
{
Abc_SclComputeParametersCell
(
p
,
pCell
,
Slew
Def
,
&
L
D
,
&
PD
);
Abc_SclComputeParametersCell
(
p
,
pCell
,
Slew
,
&
E
D
,
&
PD
);
printf
(
" %3d : "
,
i
+
1
);
printf
(
"%-*s "
,
nLength
,
pCell
->
pName
);
printf
(
"%2d "
,
pCell
->
drive_strength
);
printf
(
"A =%8.2f "
,
pCell
->
area
);
printf
(
"C =%6.2f ff "
,
Abc_SclGatePinCapAve
(
p
,
pCell
)
);
printf
(
"LD =%8.2f ps "
,
LD
);
printf
(
"PD =%8.2f ps"
,
PD
);
printf
(
"A =%8.2f "
,
pCell
->
area
);
printf
(
"D =%6.0f ps "
,
0
.
01
*
ED
*
Gain
+
PD
);
printf
(
"ED =%6.0f ps "
,
ED
);
printf
(
"PD =%6.0f ps "
,
PD
);
printf
(
"C =%5.1f ff "
,
Abc_SclGatePinCapAve
(
p
,
pCell
)
);
printf
(
"Lm =%5.1f ff "
,
0
.
01
*
Gain
*
Abc_SclGatePinCapAve
(
p
,
pCell
)
);
// printf( "MaxS =%5.1f ps ", SC_CellPin(pCell, pCell->n_inputs)->max_out_slew );
printf
(
"Lm2 =%5.0f ff"
,
SC_CellPin
(
pCell
,
pCell
->
n_inputs
)
->
max_out_cap
);
printf
(
"
\n
"
);
}
}
...
...
@@ -1029,21 +1044,23 @@ void Abc_SclPrintCells( SC_Lib * p )
SeeAlso []
***********************************************************************/
Vec_Str_t
*
Abc_SclDeriveGenlib
(
SC_Lib
*
p
,
float
Slew
,
float
Gain
)
Vec_Str_t
*
Abc_SclDeriveGenlib
(
SC_Lib
*
p
,
float
Slew
,
float
Gain
,
int
nGatesMin
,
int
*
pnCellCount
)
{
extern
char
*
Abc_SclFindGateFormula
(
char
*
pGateName
,
char
*
pOutName
);
char
Buffer
[
200
];
Vec_Str_t
*
vStr
;
SC_Cell
*
pRepr
;
SC_Pin
*
pPin
;
int
i
,
k
,
Count
=
0
;
int
i
,
k
,
Count
=
2
;
vStr
=
Vec_StrAlloc
(
1000
);
Vec_StrPrintStr
(
vStr
,
"GATE
_const0_ 0.000000
z=CONST0;
\n
"
);
Vec_StrPrintStr
(
vStr
,
"GATE
_const1_ 0.000000
z=CONST1;
\n
"
);
Vec_StrPrintStr
(
vStr
,
"GATE
_const0_ 0.00
z=CONST0;
\n
"
);
Vec_StrPrintStr
(
vStr
,
"GATE
_const1_ 0.00
z=CONST1;
\n
"
);
SC_LibForEachCellClass
(
p
,
pRepr
,
i
)
{
if
(
pRepr
->
n_outputs
>
1
)
continue
;
if
(
Abc_SclClassCellNum
(
pRepr
)
<
nGatesMin
)
continue
;
assert
(
strlen
(
pRepr
->
pName
)
<
200
);
Vec_StrPrintStr
(
vStr
,
"GATE "
);
sprintf
(
Buffer
,
"%-16s"
,
pRepr
->
pName
);
...
...
@@ -1071,22 +1088,31 @@ Vec_Str_t * Abc_SclDeriveGenlib( SC_Lib * p, float Slew, float Gain )
Vec_StrPrintStr
(
vStr
,
"
\n
.end
\n
"
);
Vec_StrPush
(
vStr
,
'\0'
);
// printf( "%s", Vec_StrArray(vStr) );
printf
(
"GENLIB library with %d gates is produced.
\n
"
,
Count
);
// printf( "GENLIB library with %d gates is produced.\n", Count );
*
pnCellCount
=
Count
;
return
vStr
;
}
void
Abc_SclDumpGenlib
(
char
*
pFileName
,
SC_Lib
*
p
,
float
Slew
,
float
Gain
)
void
Abc_SclDumpGenlib
(
char
*
pFileName
,
SC_Lib
*
p
,
float
Slew
,
float
Gain
,
int
nGatesMin
)
{
char
FileName
[
1000
];
int
nCellCount
=
0
;
Vec_Str_t
*
vStr
;
FILE
*
pFile
=
fopen
(
pFileName
,
"wb"
);
FILE
*
pFile
;
if
(
pFileName
==
NULL
)
sprintf
(
FileName
,
"%s_s%03d_g%03d_m%d.genlib"
,
p
->
pName
,
(
int
)
Slew
,
(
int
)
Gain
,
nGatesMin
,
&
nCellCount
);
else
sprintf
(
FileName
,
"%s"
,
pFileName
);
pFile
=
fopen
(
FileName
,
"wb"
);
if
(
pFile
==
NULL
)
{
printf
(
"Cannot open file
\"
%s
\"
for writing.
\n
"
,
p
FileName
);
printf
(
"Cannot open file
\"
%s
\"
for writing.
\n
"
,
FileName
);
return
;
}
vStr
=
Abc_SclDeriveGenlib
(
p
,
Slew
,
Gain
);
vStr
=
Abc_SclDeriveGenlib
(
p
,
Slew
,
Gain
,
nGatesMin
,
&
nCellCount
);
fprintf
(
pFile
,
"%s"
,
Vec_StrArray
(
vStr
)
);
Vec_StrFree
(
vStr
);
fclose
(
pFile
);
printf
(
"Written GENLIB library with %d gates into file
\"
%s
\"
.
\n
"
,
nCellCount
,
FileName
);
}
////////////////////////////////////////////////////////////////////////
...
...
src/map/scl/sclLib.h
View file @
84c0b9d6
...
...
@@ -544,10 +544,11 @@ extern void Abc_SclLoad( char * pFileName, SC_Lib ** ppScl );
extern
void
Abc_SclSave
(
char
*
pFileName
,
SC_Lib
*
pScl
);
extern
void
Abc_SclHashCells
(
SC_Lib
*
p
);
extern
int
Abc_SclCellFind
(
SC_Lib
*
p
,
char
*
pName
);
extern
int
Abc_SclClassCellNum
(
SC_Cell
*
pClass
);
extern
void
Abc_SclLinkCells
(
SC_Lib
*
p
);
extern
void
Abc_SclPrintCells
(
SC_Lib
*
p
);
extern
void
Abc_SclPrintCells
(
SC_Lib
*
p
,
float
Slew
,
float
Gain
);
extern
SC_WireLoad
*
Abc_SclFindWireLoadModel
(
SC_Lib
*
p
,
float
Area
);
extern
void
Abc_SclDumpGenlib
(
char
*
pFileName
,
SC_Lib
*
p
,
float
Slew
,
float
Gain
);
extern
void
Abc_SclDumpGenlib
(
char
*
pFileName
,
SC_Lib
*
p
,
float
Slew
,
float
Gain
,
int
nGatesMin
);
ABC_NAMESPACE_HEADER_END
...
...
src/map/scl/sclSize.c
View file @
84c0b9d6
...
...
@@ -108,23 +108,23 @@ Abc_Obj_t * Abc_SclFindMostCriticalFanin( SC_Man * p, int * pfRise, Abc_Obj_t *
static
inline
void
Abc_SclTimeNodePrint
(
SC_Man
*
p
,
Abc_Obj_t
*
pObj
,
int
fRise
,
int
Length
,
float
maxDelay
)
{
SC_Cell
*
pCell
=
Abc_ObjIsNode
(
pObj
)
?
Abc_SclObjCell
(
p
,
pObj
)
:
NULL
;
printf
(
"%6d : "
,
Abc_ObjId
(
pObj
)
);
printf
(
"%d "
,
Abc_ObjFaninNum
(
pObj
)
);
printf
(
"%2d "
,
Abc_ObjFanoutNum
(
pObj
)
);
printf
(
"%-*s "
,
Length
,
pCell
?
pCell
->
pName
:
"pi"
);
if
(
fRise
>=
0
)
printf
(
"
(%s) "
,
fRise
?
"rise"
:
"fall
"
);
printf
(
"
A =%7.2f "
,
pCell
?
pCell
->
area
:
0
.
0
);
printf
(
"
D = ("
);
printf
(
"
%8.2f ps"
,
Abc_SclObjTimePs
(
p
,
pObj
,
1
)
);
printf
(
"
%8.2f ps ) "
,
Abc_SclObjTimePs
(
p
,
pObj
,
0
)
);
printf
(
"
L =%7.2f ff "
,
Abc_SclObjLoadFf
(
p
,
pObj
,
fRise
>=
0
?
fRise
:
0
)
);
printf
(
"
G =%5.2f "
,
pCell
?
Abc_SclObjLoadAve
(
p
,
pObj
)
/
SC_CellPinCap
(
pCell
,
0
)
:
0
.
0
);
printf
(
"
S =%7.2f ps "
,
Abc_SclObjSlewPs
(
p
,
pObj
,
fRise
>=
0
?
fRise
:
0
)
);
printf
(
"SL =%
6.2f ps"
,
Abc_SclObjSlack
(
p
,
pObj
)
);
printf
(
"%6d : "
,
Abc_ObjId
(
pObj
)
);
printf
(
"%d "
,
Abc_ObjFaninNum
(
pObj
)
);
printf
(
"%2d "
,
Abc_ObjFanoutNum
(
pObj
)
);
printf
(
"%-*s "
,
Length
,
pCell
?
pCell
->
pName
:
"pi"
);
printf
(
"A =%7.2f "
,
pCell
?
pCell
->
area
:
0
.
0
);
printf
(
"
D%s ="
,
fRise
?
"r"
:
"f
"
);
printf
(
"
%5.0f "
,
Abc_MaxFloat
(
Abc_SclObjTimePs
(
p
,
pObj
,
0
),
Abc_SclObjTimePs
(
p
,
pObj
,
1
))
);
printf
(
"
%4.0f ps "
,
-
Abc_AbsFloat
(
Abc_SclObjTimePs
(
p
,
pObj
,
0
)
-
Abc_SclObjTimePs
(
p
,
pObj
,
1
))
);
printf
(
"
S =%5.0f ps "
,
Abc_SclObjSlewPs
(
p
,
pObj
,
fRise
>=
0
?
fRise
:
0
)
);
printf
(
"
Cin =%4.0f ff "
,
pCell
?
Abc_SclGatePinCapAve
(
p
->
pLib
,
pCell
)
:
0
.
0
);
printf
(
"
Cout =%5.0f ff "
,
Abc_SclObjLoadFf
(
p
,
pObj
,
fRise
>=
0
?
fRise
:
0
)
);
printf
(
"
Cmax =%5.0f ff "
,
pCell
?
SC_CellPin
(
pCell
,
pCell
->
n_inputs
)
->
max_out_cap
:
0
.
0
);
printf
(
"
G =%4.1f "
,
pCell
?
Abc_SclObjLoadAve
(
p
,
pObj
)
/
SC_CellPinCap
(
pCell
,
0
)
:
0
.
0
);
printf
(
"SL =%
5.1f ps"
,
Abc_SclObjSlack
(
p
,
pObj
)
);
printf
(
"
\n
"
);
}
void
Abc_SclTimeNtkPrint
(
SC_Man
*
p
,
int
fShowAll
,
int
f
Short
)
void
Abc_SclTimeNtkPrint
(
SC_Man
*
p
,
int
fShowAll
,
int
f
PrintPath
)
{
int
i
,
nLength
=
0
,
fRise
=
0
;
Abc_Obj_t
*
pObj
,
*
pPivot
=
Abc_SclFindCriticalCo
(
p
,
&
fRise
);
...
...
@@ -134,7 +134,7 @@ void Abc_SclTimeNtkPrint( SC_Man * p, int fShowAll, int fShort )
printf
(
"Gates = %6d. "
,
Abc_NtkNodeNum
(
p
->
pNtk
)
);
printf
(
"Area = %12.2f. "
,
Abc_SclGetTotalArea
(
p
)
);
printf
(
"Critical delay = %8.2f ps
\n
"
,
maxDelay
);
if
(
fShort
)
if
(
!
fPrintPath
)
return
;
if
(
fShowAll
)
...
...
@@ -165,7 +165,7 @@ void Abc_SclTimeNtkPrint( SC_Man * p, int fShowAll, int fShort )
pObj
=
Abc_ObjFanin0
(
pPivot
);
while
(
pObj
)
//&& Abc_ObjIsNode(pObj) )
{
printf
(
"
C-path
%3d -- "
,
i
--
);
printf
(
"
Path
%3d -- "
,
i
--
);
Abc_SclTimeNodePrint
(
p
,
pObj
,
fRise
,
nLength
,
maxDelay
);
pObj
=
Abc_SclFindMostCriticalFanin
(
p
,
&
fRise
,
pObj
);
}
...
...
@@ -380,11 +380,11 @@ SC_Man * Abc_SclManStart( SC_Lib * pLib, Abc_Ntk_t * pNtk, int fUseWireLoads, in
SeeAlso []
***********************************************************************/
void
Abc_SclTimePerform
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
int
fUseWireLoads
,
int
fShowAll
,
int
f
Short
,
int
fDumpStats
)
void
Abc_SclTimePerform
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
int
fUseWireLoads
,
int
fShowAll
,
int
f
PrintPath
,
int
fDumpStats
)
{
SC_Man
*
p
;
p
=
Abc_SclManStart
(
pLib
,
pNtk
,
fUseWireLoads
,
1
,
0
);
Abc_SclTimeNtkPrint
(
p
,
fShowAll
,
f
Short
);
Abc_SclTimeNtkPrint
(
p
,
fShowAll
,
f
PrintPath
);
if
(
fDumpStats
)
Abc_SclDumpStats
(
p
,
"stats.txt"
,
0
);
Abc_SclManFree
(
p
);
...
...
src/map/scl/sclSize.h
View file @
84c0b9d6
...
...
@@ -373,7 +373,7 @@ static inline void Abc_SclDumpStats( SC_Man * p, char * pFileName, abctime Time
/*=== sclBuff.c ===============================================================*/
extern
int
Abc_SclCheckNtk
(
Abc_Ntk_t
*
p
,
int
fVerbose
);
extern
Abc_Ntk_t
*
Abc_SclPerformBuffering
(
Abc_Ntk_t
*
p
,
int
Degree
,
int
fVerbose
);
extern
Abc_Ntk_t
*
Abc_SclPerformBuffering
(
Abc_Ntk_t
*
p
,
int
Degree
,
int
f
UseInvs
,
int
f
Verbose
);
/*=== sclDnsize.c ===============================================================*/
extern
void
Abc_SclDnsizePerform
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
SC_SizePars
*
pPars
);
/*=== sclLoad.c ===============================================================*/
...
...
@@ -382,11 +382,11 @@ extern void Abc_SclUpdateLoad( SC_Man * p, Abc_Obj_t * pObj, SC_Cell *
/*=== sclSize.c ===============================================================*/
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
f
Short
);
extern
void
Abc_SclTimeNtkPrint
(
SC_Man
*
p
,
int
fShowAll
,
int
f
PrintPath
);
extern
SC_Man
*
Abc_SclManStart
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
int
fUseWireLoads
,
int
fDept
,
float
DUser
);
extern
void
Abc_SclTimeCone
(
SC_Man
*
p
,
Vec_Int_t
*
vCone
);
extern
void
Abc_SclTimeNtkRecompute
(
SC_Man
*
p
,
float
*
pArea
,
float
*
pDelay
,
int
fReverse
,
float
DUser
);
extern
void
Abc_SclTimePerform
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
int
fUseWireLoads
,
int
fShowAll
,
int
f
Short
,
int
fDumpStats
);
extern
void
Abc_SclTimePerform
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
int
fUseWireLoads
,
int
fShowAll
,
int
f
PrintPath
,
int
fDumpStats
);
extern
void
Abc_SclPrintBuffers
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
int
fVerbose
);
/*=== sclUpsize.c ===============================================================*/
extern
void
Abc_SclUpsizePerform
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
pNtk
,
SC_SizePars
*
pPars
);
...
...
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