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
c6b80ffc
Commit
c6b80ffc
authored
Oct 13, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Normalization of slew/load values.
parent
f8410b53
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
95 additions
and
17 deletions
+95
-17
src/map/scl/scl.c
+2
-2
src/map/scl/sclBufSize.c
+24
-9
src/map/scl/sclDnsize.c
+2
-2
src/map/scl/sclLib.h
+1
-0
src/map/scl/sclLibScl.c
+1
-0
src/map/scl/sclLibUtil.c
+60
-0
src/map/scl/sclLiberty.c
+1
-0
src/map/scl/sclUpsize.c
+4
-4
No files found.
src/map/scl/scl.c
View file @
c6b80ffc
...
...
@@ -99,14 +99,14 @@ void Scl_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"print_gs"
,
Scl_CommandPrintGS
,
0
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"stime"
,
Scl_CommandStime
,
0
);
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"
,
"bufsize"
,
Scl_CommandBufSize
,
1
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"unbuffer"
,
Scl_CommandUnBuffer
,
1
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"minsize"
,
Scl_CommandMinsize
,
1
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"maxsize"
,
Scl_CommandMaxsize
,
1
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"upsize"
,
Scl_CommandUpsize
,
1
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"dnsize"
,
Scl_CommandDnsize
,
1
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"bsize"
,
Scl_CommandBsize
,
1
);
//
Cmd_CommandAdd( pAbc, "SCL mapping", "bsize", Scl_CommandBsize, 1 );
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"print_buf"
,
Scl_CommandPrintBuf
,
0
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"read_constr"
,
Scl_CommandReadConstr
,
0
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"print_constr"
,
Scl_CommandPrintConstr
,
0
);
...
...
src/map/scl/sclBufSize.c
View file @
c6b80ffc
...
...
@@ -95,11 +95,15 @@ Bus_Man_t * Bus_ManStart( Abc_Ntk_t * pNtk, SC_Lib * pLib, SC_BusPars * pPars )
}
if
(
p
->
pWLoadUsed
)
p
->
vWireCaps
=
Abc_SclFindWireCaps
(
p
->
pWLoadUsed
);
p
->
vCins
=
Vec_FltStart
(
2
*
Abc_NtkObjNumMax
(
pNtk
)
+
10000
);
p
->
vETimes
=
Vec_FltStart
(
2
*
Abc_NtkObjNumMax
(
pNtk
)
+
10000
);
p
->
vLoads
=
Vec_FltStart
(
2
*
Abc_NtkObjNumMax
(
pNtk
)
+
10000
);
p
->
vDepts
=
Vec_FltStart
(
2
*
Abc_NtkObjNumMax
(
pNtk
)
+
10000
);
p
->
vFanouts
=
Vec_PtrAlloc
(
100
);
p
->
vCins
=
Vec_FltAlloc
(
2
*
Abc_NtkObjNumMax
(
pNtk
)
+
1000
);
p
->
vETimes
=
Vec_FltAlloc
(
2
*
Abc_NtkObjNumMax
(
pNtk
)
+
1000
);
p
->
vLoads
=
Vec_FltAlloc
(
2
*
Abc_NtkObjNumMax
(
pNtk
)
+
1000
);
p
->
vDepts
=
Vec_FltAlloc
(
2
*
Abc_NtkObjNumMax
(
pNtk
)
+
1000
);
Vec_FltFill
(
p
->
vCins
,
Abc_NtkObjNumMax
(
pNtk
),
0
);
Vec_FltFill
(
p
->
vETimes
,
Abc_NtkObjNumMax
(
pNtk
),
0
);
Vec_FltFill
(
p
->
vLoads
,
Abc_NtkObjNumMax
(
pNtk
),
0
);
Vec_FltFill
(
p
->
vDepts
,
Abc_NtkObjNumMax
(
pNtk
),
0
);
pNtk
->
pBSMan
=
p
;
return
p
;
}
...
...
@@ -131,9 +135,9 @@ void Bus_ManReadInOutLoads( Bus_Man_t * p )
{
Abc_Obj_t
*
pObj
;
int
i
;
float
MaxLoad
=
Abc_FrameReadMaxLoad
();
Abc_NtkForEach
P
o
(
p
->
pNtk
,
pObj
,
i
)
Abc_NtkForEach
C
o
(
p
->
pNtk
,
pObj
,
i
)
Bus_SclObjSetCin
(
pObj
,
MaxLoad
);
printf
(
"Default output load is specified (%f ff).
\n
"
,
SC_LibCapFf
(
p
->
pLib
,
MaxLoad
)
);
// printf( "Default output load is specified (%f ff).\n", MaxLoad
);
}
if
(
Abc_FrameReadDrivingCell
()
)
{
...
...
@@ -146,7 +150,7 @@ void Bus_ManReadInOutLoads( Bus_Man_t * p )
p
->
pPiDrive
=
SC_LibCell
(
p
->
pLib
,
iCell
);
assert
(
p
->
pPiDrive
!=
NULL
);
assert
(
p
->
pPiDrive
->
n_inputs
==
1
);
printf
(
"Default input driving cell is specified (%s).
\n
"
,
p
->
pPiDrive
->
pName
);
//
printf( "Default input driving cell is specified (%s).\n", p->pPiDrive->pName );
}
}
}
...
...
@@ -351,8 +355,12 @@ Abc_Obj_t * Abc_SclAddOneInv( Bus_Man_t * p, Abc_Obj_t * pObj, Vec_Ptr_t * vFano
pInv
=
Abc_NtkCreateNodeBuf
(
p
->
pNtk
,
NULL
);
else
pInv
=
Abc_NtkCreateNodeInv
(
p
->
pNtk
,
NULL
);
assert
(
(
int
)
Abc_ObjId
(
pInv
)
<
Vec_FltSize
(
p
->
vDepts
)
);
Limit
=
Abc_MinInt
(
iStop
,
Vec_PtrSize
(
vFanouts
)
);
assert
(
(
int
)
Abc_ObjId
(
pInv
)
==
Vec_FltSize
(
p
->
vCins
)
);
Vec_FltPush
(
p
->
vCins
,
0
);
Vec_FltPush
(
p
->
vETimes
,
0
);
Vec_FltPush
(
p
->
vLoads
,
0
);
Vec_FltPush
(
p
->
vDepts
,
0
);
Limit
=
Abc_MinInt
(
Abc_MaxInt
(
iStop
,
2
),
Vec_PtrSize
(
vFanouts
)
);
Vec_PtrForEachEntryStop
(
Abc_Obj_t
*
,
vFanouts
,
pFanout
,
i
,
Limit
)
{
Vec_PtrWriteEntry
(
vFanouts
,
i
,
NULL
);
...
...
@@ -381,6 +389,7 @@ void Abc_SclBufSize( Bus_Man_t * p )
SC_Cell
*
pCell
,
*
pCellNew
;
Abc_Obj_t
*
pObj
,
*
pFanout
;
abctime
clk
=
Abc_Clock
();
int
nObjsOld
=
Abc_NtkObjNumMax
(
p
->
pNtk
);
float
GainInv
=
0
.
01
*
p
->
pPars
->
GainRatio
;
float
GainGate
=
(
float
)
1
.
0
*
GainInv
;
float
Load
,
LoadNew
,
Cin
,
DeptMax
=
0
;
...
...
@@ -390,6 +399,11 @@ void Abc_SclBufSize( Bus_Man_t * p )
{
if
(
!
((
Abc_ObjIsNode
(
pObj
)
&&
Abc_ObjFaninNum
(
pObj
)
>
0
)
||
(
Abc_ObjIsCi
(
pObj
)
&&
p
->
pPiDrive
))
)
continue
;
if
(
2
*
nObjsOld
<
Abc_NtkObjNumMax
(
p
->
pNtk
)
)
{
printf
(
"Buffering could not be completed because the gain value (%d) is too low.
\n
"
,
p
->
pPars
->
GainRatio
);
break
;
}
// compute load
Abc_NtkComputeFanoutInfo
(
pObj
,
p
->
pPars
->
Slew
);
Load
=
Abc_NtkComputeNodeLoad
(
p
,
pObj
);
...
...
@@ -443,6 +457,7 @@ void Abc_SclBufSize( Bus_Man_t * p )
assert
(
p
->
pPars
->
fSizeOnly
||
Abc_ObjFanoutNum
(
pObj
)
<=
p
->
pPars
->
nDegree
);
}
// compute departure time of the PI
if
(
i
<
0
)
// finished buffering
Abc_NtkForEachCi
(
p
->
pNtk
,
pObj
,
i
)
{
float
DeptCur
=
Abc_NtkComputeNodeDeparture
(
pObj
,
p
->
pPars
->
Slew
);
...
...
src/map/scl/sclDnsize.c
View file @
c6b80ffc
...
...
@@ -122,8 +122,8 @@ clk = Abc_Clock();
continue
;
if
(
i
>
Notches
)
break
;
if
(
p
->
vInDrive
&&
!
Abc_SclInputDriveOk
(
p
,
pObj
,
pCellNew
)
)
continue
;
//
if ( p->vInDrive && !Abc_SclInputDriveOk( p, pObj, pCellNew ) )
//
continue;
// set new cell
Abc_SclObjSetCell
(
pObj
,
pCellNew
);
Abc_SclUpdateLoad
(
p
,
pObj
,
pCellOld
,
pCellNew
);
...
...
src/map/scl/sclLib.h
View file @
c6b80ffc
...
...
@@ -610,6 +610,7 @@ extern int Abc_SclClassCellNum( SC_Cell * pClass );
extern
int
Abc_SclLibClassNum
(
SC_Lib
*
pLib
);
extern
void
Abc_SclLinkCells
(
SC_Lib
*
p
);
extern
void
Abc_SclPrintCells
(
SC_Lib
*
p
,
float
Slew
,
float
Gain
,
int
fInvOnly
,
int
fShort
);
extern
void
Abc_SclLibNormalize
(
SC_Lib
*
p
);
extern
SC_Cell
*
Abc_SclFindInvertor
(
SC_Lib
*
p
,
int
fFindBuff
);
extern
SC_Cell
*
Abc_SclFindSmallestGate
(
SC_Cell
*
p
,
float
CinMin
);
extern
SC_WireLoad
*
Abc_SclFindWireLoadModel
(
SC_Lib
*
p
,
float
Area
);
...
...
src/map/scl/sclLibScl.c
View file @
c6b80ffc
...
...
@@ -274,6 +274,7 @@ SC_Lib * Abc_SclReadFromFile( char * pFileName )
// read the library
p
=
Abc_SclReadFromStr
(
vOut
);
p
->
pFileName
=
Abc_UtilStrsav
(
pFileName
);
Abc_SclLibNormalize
(
p
);
Vec_StrFree
(
vOut
);
return
p
;
}
...
...
src/map/scl/sclLibUtil.c
View file @
c6b80ffc
...
...
@@ -505,6 +505,66 @@ void Abc_SclPrintCells( SC_Lib * p, float Slew, float Gain, int fInvOnly, int fS
/**Function*************************************************************
Synopsis [Print cells]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Abc_SclLibNormalizeSurface
(
SC_Surface
*
p
,
float
Time
,
float
Load
)
{
Vec_Flt_t
*
vArray
;
int
i
,
k
;
float
Entry
;
Vec_FltForEachEntry
(
p
->
vIndex0
,
Entry
,
i
)
// slew
Vec_FltWriteEntry
(
p
->
vIndex0
,
i
,
Time
*
Entry
);
Vec_FltForEachEntry
(
p
->
vIndex1
,
Entry
,
i
)
// load
Vec_FltWriteEntry
(
p
->
vIndex1
,
i
,
Load
*
Entry
);
Vec_PtrForEachEntry
(
Vec_Flt_t
*
,
p
->
vData
,
vArray
,
k
)
Vec_FltForEachEntry
(
vArray
,
Entry
,
i
)
// delay/slew
Vec_FltWriteEntry
(
vArray
,
i
,
Time
*
Entry
);
}
void
Abc_SclLibNormalize
(
SC_Lib
*
p
)
{
SC_WireLoad
*
pWL
;
SC_Cell
*
pCell
;
SC_Pin
*
pPin
;
SC_Timings
*
pTimings
;
SC_Timing
*
pTiming
;
int
i
,
k
,
m
,
n
;
float
Time
=
1
.
0
*
pow
(
10
.
0
,
12
-
p
->
unit_time
);
float
Load
=
p
->
unit_cap_fst
*
pow
(
10
.
0
,
15
-
p
->
unit_cap_snd
);
if
(
Time
==
1
&&
Load
==
1
)
return
;
p
->
unit_time
=
12
;
p
->
unit_cap_fst
=
1
;
p
->
unit_cap_snd
=
15
;
p
->
default_max_out_slew
*=
Time
;
SC_LibForEachWireLoad
(
p
,
pWL
,
i
)
pWL
->
cap
*=
Load
;
SC_LibForEachCell
(
p
,
pCell
,
i
)
SC_CellForEachPin
(
pCell
,
pPin
,
k
)
{
pPin
->
cap
*=
Load
;
pPin
->
rise_cap
*=
Load
;
pPin
->
fall_cap
*=
Load
;
pPin
->
max_out_cap
*=
Load
;
pPin
->
max_out_slew
*=
Time
;
SC_PinForEachRTiming
(
pPin
,
pTimings
,
m
)
Vec_PtrForEachEntry
(
SC_Timing
*
,
pTimings
->
vTimings
,
pTiming
,
n
)
{
Abc_SclLibNormalizeSurface
(
pTiming
->
pCellRise
,
Time
,
Load
);
Abc_SclLibNormalizeSurface
(
pTiming
->
pCellFall
,
Time
,
Load
);
Abc_SclLibNormalizeSurface
(
pTiming
->
pRiseTrans
,
Time
,
Load
);
Abc_SclLibNormalizeSurface
(
pTiming
->
pFallTrans
,
Time
,
Load
);
}
}
}
/**Function*************************************************************
Synopsis [Derives simple GENLIB library.]
Description []
...
...
src/map/scl/sclLiberty.c
View file @
c6b80ffc
...
...
@@ -1331,6 +1331,7 @@ SC_Lib * Abc_SclReadLiberty( char * pFileName, int fVerbose, int fVeryVerbose )
// construct SCL data-structure
pLib
=
Abc_SclReadFromStr
(
vStr
);
pLib
->
pFileName
=
Abc_UtilStrsav
(
pFileName
);
Abc_SclLibNormalize
(
pLib
);
Vec_StrFree
(
vStr
);
return
pLib
;
}
...
...
src/map/scl/sclUpsize.c
View file @
c6b80ffc
...
...
@@ -291,8 +291,8 @@ int Abc_SclFindBestCell( SC_Man * p, Abc_Obj_t * pObj, Vec_Int_t * vRecalcs, Vec
continue
;
if
(
k
>
Notches
)
break
;
if
(
p
->
vInDrive
&&
!
Abc_SclInputDriveOk
(
p
,
pObj
,
pCellNew
)
)
continue
;
//
if ( p->vInDrive && !Abc_SclInputDriveOk( p, pObj, pCellNew ) )
//
continue;
// set new cell
Abc_SclObjSetCell
(
pObj
,
pCellNew
);
Abc_SclUpdateLoad
(
p
,
pObj
,
pCellOld
,
pCellNew
);
...
...
@@ -311,8 +311,8 @@ int Abc_SclFindBestCell( SC_Man * p, Abc_Obj_t * pObj, Vec_Int_t * vRecalcs, Vec
}
else
if
(
NoChange
)
NoChange
++
;
if
(
NoChange
==
4
)
break
;
//
if ( NoChange == 4 )
//
break;
// printf( "%.2f ", dGain );
}
// printf( "Best = %.2f ", dGainBest );
...
...
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