ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
sclLoad.c File Reference
#include "sclSize.h"
Include dependency graph for sclLoad.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START Vec_Flt_tAbc_SclFindWireCaps (SC_WireLoad *pWL, int nFanoutMax)
 DECLARATIONS ///.
 
float Abc_SclFindWireLoad (Vec_Flt_t *vWireCaps, int nFans)
 
void Abc_SclAddWireLoad (SC_Man *p, Abc_Obj_t *pObj, int fSubtr)
 
void Abc_SclComputeLoad (SC_Man *p)
 
void Abc_SclUpdateLoad (SC_Man *p, Abc_Obj_t *pObj, SC_Cell *pOld, SC_Cell *pNew)
 
void Abc_SclUpdateLoadSplit (SC_Man *p, Abc_Obj_t *pBuffer, Abc_Obj_t *pFanout)
 

Function Documentation

◆ Abc_SclAddWireLoad()

void Abc_SclAddWireLoad ( SC_Man * p,
Abc_Obj_t * pObj,
int fSubtr )

Definition at line 102 of file sclLoad.c.

103{
104 float Load = Abc_SclFindWireLoad( p->vWireCaps, Abc_ObjFanoutNum(pObj) );
105 Abc_SclObjLoad(p, pObj)->rise += fSubtr ? -Load : Load;
106 Abc_SclObjLoad(p, pObj)->fall += fSubtr ? -Load : Load;
107}
Cube * p
Definition exorList.c:222
float Abc_SclFindWireLoad(Vec_Flt_t *vWireCaps, int nFans)
Definition sclLoad.c:96
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SclComputeLoad()

void Abc_SclComputeLoad ( SC_Man * p)

Definition at line 108 of file sclLoad.c.

109{
110 Abc_Obj_t * pObj, * pFanin;
111 int i, k;
112 // clear load storage
113 Abc_NtkForEachObj( p->pNtk, pObj, i )
114 {
115 SC_Pair * pLoad = Abc_SclObjLoad( p, pObj );
116 if ( !Abc_ObjIsPo(pObj) )
117 pLoad->rise = pLoad->fall = 0.0;
118 }
119 // add cell load
120 Abc_NtkForEachNode1( p->pNtk, pObj, i )
121 {
122 SC_Cell * pCell = Abc_SclObjCell( pObj );
123 Abc_ObjForEachFanin( pObj, pFanin, k )
124 {
125 SC_Pair * pLoad = Abc_SclObjLoad( p, pFanin );
126 SC_Pin * pPin = SC_CellPin( pCell, k );
127 pLoad->rise += pPin->rise_cap;
128 pLoad->fall += pPin->fall_cap;
129 }
130 }
131 // add PO load
132 Abc_NtkForEachCo( p->pNtk, pObj, i )
133 {
134 SC_Pair * pLoadPo = Abc_SclObjLoad( p, pObj );
135 SC_Pair * pLoad = Abc_SclObjLoad( p, Abc_ObjFanin0(pObj) );
136 pLoad->rise += pLoadPo->rise;
137 pLoad->fall += pLoadPo->fall;
138 }
139 // add wire load
140 if ( p->pWLoadUsed != NULL )
141 {
142 if ( p->vWireCaps == NULL )
143 p->vWireCaps = Abc_SclFindWireCaps( p->pWLoadUsed, Abc_NtkGetFanoutMax(p->pNtk) );
144 Abc_NtkForEachNode1( p->pNtk, pObj, i )
145 Abc_SclAddWireLoad( p, pObj, 0 );
146 Abc_NtkForEachPi( p->pNtk, pObj, i )
147 Abc_SclAddWireLoad( p, pObj, 0 );
148 }
149 // check input loads
150 if ( p->vInDrive != NULL )
151 {
152 Abc_NtkForEachPi( p->pNtk, pObj, i )
153 {
154 SC_Pair * pLoad = Abc_SclObjLoad( p, pObj );
155 if ( Abc_SclObjInDrive(p, pObj) != 0 && (pLoad->rise > Abc_SclObjInDrive(p, pObj) || pLoad->fall > Abc_SclObjInDrive(p, pObj)) )
156 printf( "Maximum input drive strength is exceeded at primary input %d.\n", i );
157 }
158 }
159/*
160 // transfer load from barbufs
161 Abc_NtkForEachBarBuf( p->pNtk, pObj, i )
162 {
163 SC_Pair * pLoad = Abc_SclObjLoad( p, pObj );
164 SC_Pair * pLoadF = Abc_SclObjLoad( p, Abc_ObjFanin(pObj, 0) );
165 SC_PairAdd( pLoadF, pLoad );
166 }
167*/
168 // calculate average load
169// if ( p->EstLoadMax )
170 {
171 double TotalLoad = 0;
172 int nObjs = 0;
173 Abc_NtkForEachNode1( p->pNtk, pObj, i )
174 {
175 SC_Pair * pLoad = Abc_SclObjLoad( p, pObj );
176 TotalLoad += 0.5 * pLoad->fall + 0.5 * pLoad->rise;
177 nObjs++;
178 }
179 Abc_NtkForEachPi( p->pNtk, pObj, i )
180 {
181 SC_Pair * pLoad = Abc_SclObjLoad( p, pObj );
182 TotalLoad += 0.5 * pLoad->fall + 0.5 * pLoad->rise;
183 nObjs++;
184 }
185 p->EstLoadAve = (float)(TotalLoad / nObjs);
186// printf( "Average load = %.2f\n", p->EstLoadAve );
187 }
188}
struct Abc_Obj_t_ Abc_Obj_t
Definition abc.h:116
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition abc.h:522
#define Abc_NtkForEachObj(pNtk, pObj, i)
ITERATORS ///.
Definition abc.h:449
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition abc.h:527
#define Abc_NtkForEachPi(pNtk, pPi, i)
Definition abc.h:516
ABC_DLL int Abc_NtkGetFanoutMax(Abc_Ntk_t *pNtk)
Definition abcUtil.c:497
#define Abc_NtkForEachNode1(pNtk, pNode, i)
Definition abc.h:470
struct SC_Pair_ SC_Pair
Definition sclLib.h:69
struct SC_Pin_ SC_Pin
Definition sclLib.h:126
struct SC_Cell_ SC_Cell
Definition sclLib.h:127
ABC_NAMESPACE_IMPL_START Vec_Flt_t * Abc_SclFindWireCaps(SC_WireLoad *pWL, int nFanoutMax)
DECLARATIONS ///.
Definition sclLoad.c:45
void Abc_SclAddWireLoad(SC_Man *p, Abc_Obj_t *pObj, int fSubtr)
Definition sclLoad.c:102
float fall
Definition sclLib.h:73
float rise
Definition sclLib.h:72
float rise_cap
Definition sclLib.h:188
float fall_cap
Definition sclLib.h:189
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SclFindWireCaps()

ABC_NAMESPACE_IMPL_START Vec_Flt_t * Abc_SclFindWireCaps ( SC_WireLoad * pWL,
int nFanoutMax )

DECLARATIONS ///.

CFile****************************************************************

FileName [sclLoad.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Standard-cell library representation.]

Synopsis [Wire/gate load computations.]

Author [Alan Mishchenko, Niklas Een]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - August 24, 2012.]

Revision [

Id
sclLoad.c,v 1.0 2012/08/24 00:00:00 alanmi Exp

] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Returns estimated wire capacitances for each fanout count.]

Description []

SideEffects []`

SeeAlso []

Definition at line 45 of file sclLoad.c.

46{
47 Vec_Flt_t * vCaps = NULL;
48 float EntryPrev, EntryCur, Slope;
49 int i, iPrev, k, Entry, EntryMax;
50 assert( pWL != NULL );
51 // find the biggest fanout count
52 EntryMax = 0;
53 Vec_IntForEachEntry( &pWL->vFanout, Entry, i )
54 EntryMax = Abc_MaxInt( EntryMax, Entry );
55 // create the array
56 vCaps = Vec_FltStart( Abc_MaxInt(nFanoutMax, EntryMax) + 1 );
57 Vec_IntForEachEntry( &pWL->vFanout, Entry, i )
58 Vec_FltWriteEntry( vCaps, Entry, Vec_FltEntry(&pWL->vLen, i) * pWL->cap );
59 if ( Vec_FltEntry(vCaps, 1) == 0 )
60 return vCaps;
61 // interpolate between the values
62 assert( Vec_FltEntry(vCaps, 1) != 0 );
63 iPrev = 1;
64 EntryPrev = Vec_FltEntry(vCaps, 1);
65 Vec_FltForEachEntryStart( vCaps, EntryCur, i, 2 )
66 {
67 if ( EntryCur == 0 )
68 continue;
69 Slope = (EntryCur - EntryPrev) / (i - iPrev);
70 for ( k = iPrev + 1; k < i; k++ )
71 Vec_FltWriteEntry( vCaps, k, EntryPrev + Slope * (k - iPrev) );
72 EntryPrev = EntryCur;
73 iPrev = i;
74 }
75 // extrapolate after the largest value
76 Slope = pWL->cap * pWL->slope;
77 for ( k = iPrev + 1; k < i; k++ )
78 Vec_FltWriteEntry( vCaps, k, EntryPrev + Slope * (k - iPrev) );
79 // show
80// Vec_FltForEachEntry( vCaps, EntryCur, i )
81// printf( "%3d : %f\n", i, EntryCur );
82 return vCaps;
83}
float cap
Definition sclLib.h:133
Vec_Int_t vFanout
Definition sclLib.h:135
float slope
Definition sclLib.h:134
Vec_Flt_t vLen
Definition sclLib.h:136
#define assert(ex)
Definition util_old.h:213
#define Vec_FltForEachEntryStart(vVec, Entry, i, Start)
Definition vecFlt.h:56
typedefABC_NAMESPACE_HEADER_START struct Vec_Flt_t_ Vec_Flt_t
INCLUDES ///.
Definition vecFlt.h:42
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
Here is the caller graph for this function:

◆ Abc_SclFindWireLoad()

float Abc_SclFindWireLoad ( Vec_Flt_t * vWireCaps,
int nFans )

Function*************************************************************

Synopsis [Computes load for all nodes in the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 96 of file sclLoad.c.

97{
98 if ( vWireCaps == NULL )
99 return 0;
100 return Vec_FltEntry( vWireCaps, Abc_MinInt(nFans, Vec_FltSize(vWireCaps)-1) );
101}
Here is the caller graph for this function:

◆ Abc_SclUpdateLoad()

void Abc_SclUpdateLoad ( SC_Man * p,
Abc_Obj_t * pObj,
SC_Cell * pOld,
SC_Cell * pNew )

Function*************************************************************

Synopsis [Updates load of the node's fanins.]

Description []

SideEffects []

SeeAlso []

Definition at line 201 of file sclLoad.c.

202{
203 Abc_Obj_t * pFanin;
204 int k;
205 Abc_ObjForEachFanin( pObj, pFanin, k )
206 {
207 SC_Pair * pLoad = Abc_SclObjLoad( p, pFanin );
208 SC_Pin * pPinOld = SC_CellPin( pOld, k );
209 SC_Pin * pPinNew = SC_CellPin( pNew, k );
210 pLoad->rise += pPinNew->rise_cap - pPinOld->rise_cap;
211 pLoad->fall += pPinNew->fall_cap - pPinOld->fall_cap;
212 }
213}
Here is the caller graph for this function:

◆ Abc_SclUpdateLoadSplit()

void Abc_SclUpdateLoadSplit ( SC_Man * p,
Abc_Obj_t * pBuffer,
Abc_Obj_t * pFanout )

Definition at line 214 of file sclLoad.c.

215{
216 SC_Pin * pPin;
217 SC_Pair * pLoad;
218 int iFanin = Abc_NodeFindFanin( pFanout, pBuffer );
219 assert( iFanin >= 0 );
220 assert( Abc_ObjFaninNum(pBuffer) == 1 );
221 pPin = SC_CellPin( Abc_SclObjCell(pFanout), iFanin );
222 // update load of the buffer
223 pLoad = Abc_SclObjLoad( p, pBuffer );
224 pLoad->rise -= pPin->rise_cap;
225 pLoad->fall -= pPin->fall_cap;
226 // update load of the fanin
227 pLoad = Abc_SclObjLoad( p, Abc_ObjFanin0(pBuffer) );
228 pLoad->rise += pPin->rise_cap;
229 pLoad->fall += pPin->fall_cap;
230}
ABC_DLL int Abc_NodeFindFanin(Abc_Obj_t *pNode, Abc_Obj_t *pFanin)
Definition abcUtil.c:791
Here is the call graph for this function:
Here is the caller graph for this function: