ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
sclSize.h File Reference
#include "base/abc/abc.h"
#include "misc/vec/vecQue.h"
#include "misc/vec/vecWec.h"
#include "sclLib.h"
Include dependency graph for sclSize.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SC_Man_
 

Typedefs

typedef typedefABC_NAMESPACE_HEADER_START struct SC_Man_ SC_Man
 INCLUDES ///.
 

Functions

Abc_Ntk_tAbc_SclBufferingPerform (Abc_Ntk_t *pNtk, SC_Lib *pLib, SC_BusPars *pPars)
 
int Abc_SclIsInv (Abc_Obj_t *pObj)
 
void Abc_NodeInvUpdateFanPolarity (Abc_Obj_t *pObj)
 
void Abc_NodeInvUpdateObjFanoutPolarity (Abc_Obj_t *pObj, Abc_Obj_t *pFanout)
 
void Abc_SclReportDupFanins (Abc_Ntk_t *pNtk)
 FUNCTION DEFINITIONS ///.
 
Abc_Ntk_tAbc_SclUnBufferPerform (Abc_Ntk_t *pNtk, int fVerbose)
 
Abc_Ntk_tAbc_SclUnBufferPhase (Abc_Ntk_t *pNtk, int fVerbose)
 
Abc_Ntk_tAbc_SclBufferPhase (Abc_Ntk_t *pNtk, int fVerbose)
 
int Abc_SclCheckNtk (Abc_Ntk_t *p, int fVerbose)
 
Abc_Ntk_tAbc_SclPerformBuffering (Abc_Ntk_t *p, int DegreeR, int Degree, int fUseInvs, int fVerbose)
 
Abc_Ntk_tAbc_SclBufPerform (Abc_Ntk_t *pNtk, int FanMin, int FanMax, int fBufPis, int fSkipDup, int fVerbose)
 
void Abc_SclDnsizePerform (SC_Lib *pLib, Abc_Ntk_t *pNtk, SC_SizePars *pPars, void *pFuncFanin)
 
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)
 
Abc_Obj_tAbc_SclFindCriticalCo (SC_Man *p, int *pfRise)
 DECLARATIONS ///.
 
Abc_Obj_tAbc_SclFindMostCriticalFanin (SC_Man *p, int *pfRise, Abc_Obj_t *pNode)
 
void Abc_SclTimeNtkPrint (SC_Man *p, int fShowAll, int fPrintPath)
 
SC_ManAbc_SclManStart (SC_Lib *pLib, Abc_Ntk_t *pNtk, int fUseWireLoads, int fDept, float DUser, int nTreeCRatio)
 
void Abc_SclTimeCone (SC_Man *p, Vec_Int_t *vCone)
 
void Abc_SclTimeNtkRecompute (SC_Man *p, float *pArea, float *pDelay, int fReverse, float DUser)
 
int Abc_SclTimeIncUpdate (SC_Man *p)
 
void Abc_SclTimeIncInsert (SC_Man *p, Abc_Obj_t *pObj)
 
void Abc_SclTimeIncUpdateLevel (Abc_Obj_t *pObj)
 
void Abc_SclTimePerform (SC_Lib *pLib, Abc_Ntk_t *pNtk, int nTreeCRatio, int fUseWireLoads, int fShowAll, int fPrintPath, int fDumpStats)
 
void Abc_SclPrintBuffers (SC_Lib *pLib, Abc_Ntk_t *pNtk, int fVerbose)
 
int Abc_SclCountNearCriticalNodes (SC_Man *p)
 
void Abc_SclUpsizePerform (SC_Lib *pLib, Abc_Ntk_t *pNtk, SC_SizePars *pPars, void *pFuncFanin)
 
void Abc_SclMioGates2SclGates (SC_Lib *pLib, Abc_Ntk_t *p)
 DECLARATIONS ///.
 
void Abc_SclSclGates2MioGates (SC_Lib *pLib, Abc_Ntk_t *p)
 
void Abc_SclTransferGates (Abc_Ntk_t *pOld, Abc_Ntk_t *pNew)
 
void Abc_SclPrintGateSizes (SC_Lib *pLib, Abc_Ntk_t *p)
 
void Abc_SclMinsizePerform (SC_Lib *pLib, Abc_Ntk_t *p, int fUseMax, int fVerbose)
 
int Abc_SclCountMinSize (SC_Lib *pLib, Abc_Ntk_t *p, int fUseMax)
 
Vec_Int_tAbc_SclExtractBarBufs (Abc_Ntk_t *pNtk)
 
void Abc_SclInsertBarBufs (Abc_Ntk_t *pNtk, Vec_Int_t *vBufs)
 

Typedef Documentation

◆ SC_Man

typedef typedefABC_NAMESPACE_HEADER_START struct SC_Man_ SC_Man

INCLUDES ///.

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

FileName [sclSize.h]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Standard-cell library representation.]

Synopsis [Timing/gate-sizing manager.]

Author [Alan Mishchenko, Niklas Een]

Affiliation [UC Berkeley]

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

Revision [

Id
sclSize.h,v 1.0 2012/08/24 00:00:00 alanmi Exp

] PARAMETERS /// STRUCTURE DEFINITIONS ///

Definition at line 44 of file sclSize.h.

Function Documentation

◆ Abc_NodeInvUpdateFanPolarity()

void Abc_NodeInvUpdateFanPolarity ( Abc_Obj_t * pObj)
extern

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

Synopsis [Performs buffering of the mapped network (old code).]

Description []

SideEffects []

SeeAlso []

Definition at line 322 of file sclBuffer.c.

323{
324 Abc_Obj_t * pFanout;
325 int i;
326 assert( Abc_ObjFaninNum(pObj) == 0 || Abc_SclObjIsBufInv(pObj) );
327 Abc_ObjForEachFanout( pObj, pFanout, i )
328 {
329 assert( Abc_ObjFaninNum(pFanout) > 0 );
330 if ( Abc_SclObjIsBufInv(pFanout) )
332 else
333 Abc_ObjFaninFlipPhase( pFanout, Abc_NodeFindFanin(pFanout, pObj) );
334 }
335}
struct Abc_Obj_t_ Abc_Obj_t
Definition abc.h:116
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition abc.h:529
ABC_DLL int Abc_NodeFindFanin(Abc_Obj_t *pNode, Abc_Obj_t *pFanin)
Definition abcUtil.c:791
void Abc_NodeInvUpdateFanPolarity(Abc_Obj_t *pObj)
Definition sclBuffer.c:322
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeInvUpdateObjFanoutPolarity()

void Abc_NodeInvUpdateObjFanoutPolarity ( Abc_Obj_t * pObj,
Abc_Obj_t * pFanout )
extern

Definition at line 336 of file sclBuffer.c.

337{
338 if ( Abc_SclObjIsBufInv(pFanout) )
340 else
341 Abc_ObjFaninFlipPhase( pFanout, Abc_NodeFindFanin(pFanout, pObj) );
342}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SclAddWireLoad()

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

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_SclBufferingPerform()

Abc_Ntk_t * Abc_SclBufferingPerform ( Abc_Ntk_t * pNtk,
SC_Lib * pLib,
SC_BusPars * pPars )
extern

Definition at line 491 of file sclBufSize.c.

492{
493 Abc_Ntk_t * pNtkNew;
494 Bus_Man_t * p;
495 if ( !Abc_SclCheckNtk( pNtk, 0 ) )
496 return NULL;
498 Abc_SclMioGates2SclGates( pLib, pNtk );
499 p = Bus_ManStart( pNtk, pLib, pPars );
501 Abc_SclBufSize( p, 0.01 * pPars->GainRatio );
502 Bus_ManStop( p );
503 Abc_SclSclGates2MioGates( pLib, pNtk );
504 if ( pNtk->vPhases )
505 Vec_IntFillExtra( pNtk->vPhases, Abc_NtkObjNumMax(pNtk), 0 );
506 pNtkNew = Abc_NtkDupDfs( pNtk );
507 return pNtkNew;
508}
ABC_DLL Abc_Ntk_t * Abc_NtkDupDfs(Abc_Ntk_t *pNtk)
Definition abcNtk.c:538
struct Abc_Ntk_t_ Abc_Ntk_t
Definition abc.h:115
void Bus_ManStop(Bus_Man_t *p)
Definition sclBufSize.c:111
typedefABC_NAMESPACE_IMPL_START struct Bus_Man_t_ Bus_Man_t
DECLARATIONS ///.
Definition sclBufSize.c:32
Bus_Man_t * Bus_ManStart(Abc_Ntk_t *pNtk, SC_Lib *pLib, SC_BusPars *pPars)
FUNCTION DEFINITIONS ///.
Definition sclBufSize.c:78
void Bus_ManReadInOutLoads(Bus_Man_t *p)
Definition sclBufSize.c:133
void Abc_SclBufSize(Bus_Man_t *p, float Gain)
Definition sclBufSize.c:396
int Abc_SclCheckNtk(Abc_Ntk_t *p, int fVerbose)
Definition sclBuffer.c:286
void Abc_SclReportDupFanins(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition sclBuffer.c:90
void Abc_SclSclGates2MioGates(SC_Lib *pLib, Abc_Ntk_t *p)
Definition sclUtil.c:70
void Abc_SclMioGates2SclGates(SC_Lib *pLib, Abc_Ntk_t *p)
DECLARATIONS ///.
Definition sclUtil.c:47
Vec_Int_t * vPhases
Definition abc.h:208
int GainRatio
Definition sclLib.h:105
Here is the call graph for this function:

◆ Abc_SclBufferPhase()

Abc_Ntk_t * Abc_SclBufferPhase ( Abc_Ntk_t * pNtk,
int fVerbose )
extern

Definition at line 198 of file sclBuffer.c.

199{
200 Abc_Ntk_t * pNtkNew;
201 Vec_Int_t * vInvs;
202 Abc_Obj_t * pObj, * pFanin, * pFaninNew;
203 int nNodesOld = Abc_NtkObjNumMax(pNtk);
204 int i, k, Counter = 0, Counter2 = 0, Total = 0;
205 assert( pNtk->vPhases != NULL );
206 vInvs = Vec_IntStart( Abc_NtkObjNumMax(pNtk) );
207 Abc_NtkForEachNodeCo( pNtk, pObj, i )
208 {
209 if ( i >= nNodesOld )
210 break;
211 Abc_ObjForEachFanin( pObj, pFanin, k )
212 {
213 Total++;
214 if ( !Abc_ObjFaninPhase(pObj, k) )
215 continue;
216 if ( Vec_IntEntry(vInvs, Abc_ObjId(pFanin)) == 0 || Abc_ObjIsCi(pFanin) ) // allow PIs to have high fanout - to be fixed later
217 {
218 pFaninNew = Abc_NtkCreateNodeInv( pNtk, pFanin );
219 Vec_IntWriteEntry( vInvs, Abc_ObjId(pFanin), Abc_ObjId(pFaninNew) );
220 Counter++;
221 }
222 pFaninNew = Abc_NtkObj( pNtk, Vec_IntEntry(vInvs, Abc_ObjId(pFanin)) );
223 Abc_ObjPatchFanin( pObj, pFanin, pFaninNew );
224 Counter2++;
225 }
226 }
227 if ( fVerbose )
228 printf( "Added %d inverters (%.2f %% fanins) (%.2f %% compl fanins).\n",
229 Counter, 100.0 * Counter / Total, 100.0 * Counter2 / Total );
230 Vec_IntFree( vInvs );
231 Vec_IntFillExtra( pNtk->vPhases, Abc_NtkObjNumMax(pNtk), 0 );
232 // duplicate network in topo order
233 vInvs = pNtk->vPhases;
234 pNtk->vPhases = NULL;
235 pNtkNew = Abc_NtkDupDfs( pNtk );
236 pNtk->vPhases = vInvs;
237 return pNtkNew;
238}
#define Abc_NtkForEachNodeCo(pNtk, pNode, i)
Definition abc.h:494
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition abc.h:527
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeInv(Abc_Ntk_t *pNtk, Abc_Obj_t *pFanin)
Definition abcObj.c:674
ABC_DLL void Abc_ObjPatchFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFaninOld, Abc_Obj_t *pFaninNew)
Definition abcFanio.c:172
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
Here is the call graph for this function:

◆ Abc_SclBufPerform()

Abc_Ntk_t * Abc_SclBufPerform ( Abc_Ntk_t * pNtk,
int FanMin,
int FanMax,
int fBufPis,
int fSkipDup,
int fVerbose )
extern

Definition at line 986 of file sclBuffer.c.

987{
988 Abc_Ntk_t * pNew;
989 Buf_Man_t * p = Buf_ManStart( pNtk, FanMin, FanMax, fBufPis );
990 int i, Limit = ABC_INFINITY;
991 Abc_NtkLevel( pNtk );
992// if ( Abc_NtkNodeNum(pNtk) < 1000 )
993// fSkipDup = 1;
994 for ( i = 0; i < Limit && Vec_QueSize(p->vQue); i++ )
995 Abc_BufPerformOne( p, Vec_QuePop(p->vQue), fSkipDup, fVerbose );
996 Buf_ManStop( p );
997// Abc_BufReplaceBufsByInvs( pNtk );
998 // duplicate network in topo order
999 pNew = Abc_NtkDupDfs( pNtk );
1000 Abc_SclCheckNtk( pNew, fVerbose );
1001 return pNew;
1002}
ABC_DLL int Abc_NtkLevel(Abc_Ntk_t *pNtk)
Definition abcDfs.c:1449
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition abc_global.h:250
void Abc_BufPerformOne(Buf_Man_t *p, int iPivot, int fSkipDup, int fVerbose)
Definition sclBuffer.c:869
void Buf_ManStop(Buf_Man_t *p)
Definition sclBuffer.c:725
Buf_Man_t * Buf_ManStart(Abc_Ntk_t *pNtk, int FanMin, int FanMax, int fBufPis)
Definition sclBuffer.c:671
struct Buf_Man_t_ Buf_Man_t
Definition sclBuffer.c:33
Here is the call graph for this function:

◆ Abc_SclCheckNtk()

int Abc_SclCheckNtk ( Abc_Ntk_t * p,
int fVerbose )
extern

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

Synopsis [Make sure the network is in topo order without dangling nodes.]

Description [Returns 1 iff the network is fine.]

SideEffects []

SeeAlso []

Definition at line 286 of file sclBuffer.c.

287{
288 Abc_Obj_t * pObj, * pFanin;
289 int i, k, fFlag = 1;
290 Abc_NtkIncrementTravId( p );
291 Abc_NtkForEachCi( p, pObj, i )
292 Abc_NodeSetTravIdCurrent( pObj );
293 Abc_NtkForEachNode( p, pObj, i )
294 {
295 Abc_ObjForEachFanin( pObj, pFanin, k )
296 if ( !Abc_NodeIsTravIdCurrent( pFanin ) )
297 printf( "obj %d and its fanin %d are not in the topo order\n", Abc_ObjId(pObj), Abc_ObjId(pFanin) ), fFlag = 0;
298 Abc_NodeSetTravIdCurrent( pObj );
299 if ( Abc_ObjIsBarBuf(pObj) )
300 continue;
301 if ( Abc_ObjFanoutNum(pObj) == 0 )
302 printf( "node %d has no fanout\n", Abc_ObjId(pObj) ), fFlag = 0;
303 if ( !fFlag )
304 break;
305 }
306 if ( fFlag && fVerbose )
307 printf( "The network is in topo order and no dangling nodes.\n" );
308 return fFlag;
309}
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition abc.h:518
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition abc.h:464
Here is the caller graph for this function:

◆ Abc_SclComputeLoad()

void Abc_SclComputeLoad ( SC_Man * p)
extern

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}
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition abc.h:522
#define Abc_NtkForEachObj(pNtk, pObj, i)
ITERATORS ///.
Definition abc.h:449
#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_SclCountMinSize()

int Abc_SclCountMinSize ( SC_Lib * pLib,
Abc_Ntk_t * p,
int fUseMax )
extern

Definition at line 222 of file sclUtil.c.

223{
224 Vec_Int_t * vMinCells;
225 Abc_Obj_t * pObj;
226 int i, gateId, Counter = 0;
227 vMinCells = Abc_SclFindMinAreas( pLib, fUseMax );
229 {
230 gateId = Vec_IntEntry( p->vGates, i );
231 Counter += ( gateId == Vec_IntEntry(vMinCells, gateId) );
232 }
233 Vec_IntFree( vMinCells );
234 return Counter;
235}
#define Abc_NtkForEachNodeNotBarBuf1(pNtk, pNode, i)
Definition abc.h:473
Vec_Int_t * Abc_SclFindMinAreas(SC_Lib *pLib, int fUseMax)
Definition sclUtil.c:189
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SclCountNearCriticalNodes()

int Abc_SclCountNearCriticalNodes ( SC_Man * p)
extern

Definition at line 187 of file sclUpsize.c.

188{
189 int RetValue;
190 Vec_Int_t * vPathPos, * vPathNodes;
191 vPathPos = Abc_SclFindCriticalCoWindow( p, 5 );
192 vPathNodes = Abc_SclFindCriticalNodeWindow( p, vPathPos, 5, 0 );
193 RetValue = Vec_IntSize(vPathNodes);
194 Abc_SclUnmarkCriticalNodeWindow( p, vPathNodes );
196 Vec_IntFree( vPathPos );
197 Vec_IntFree( vPathNodes );
198 return RetValue;
199}
Vec_Int_t * Abc_SclFindCriticalCoWindow(SC_Man *p, int Window)
Definition sclUpsize.c:98
Vec_Int_t * Abc_SclFindCriticalNodeWindow(SC_Man *p, Vec_Int_t *vPathCos, int Window, int fDept)
Definition sclUpsize.c:159
void Abc_SclUnmarkCriticalNodeWindow(SC_Man *p, Vec_Int_t *vPath)
Definition sclUpsize.c:180
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SclDnsizePerform()

void Abc_SclDnsizePerform ( SC_Lib * pLib,
Abc_Ntk_t * pNtk,
SC_SizePars * pPars,
void * pFuncFanin )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 361 of file sclDnsize.c.

362{
363 Abc_Ntk_t * pNtkNew = pNtk;
364 if ( pNtk->nBarBufs2 > 0 )
365 pNtkNew = Abc_NtkDupDfsNoBarBufs( pNtk );
366 Abc_SclDnsizePerformInt( pLib, pNtkNew, pPars, pFuncFanin );
367 if ( pNtk->nBarBufs2 > 0 )
368 Abc_SclTransferGates( pNtk, pNtkNew );
369 if ( pNtk->nBarBufs2 > 0 )
370 Abc_NtkDelete( pNtkNew );
371}
ABC_DLL Abc_Ntk_t * Abc_NtkDupDfsNoBarBufs(Abc_Ntk_t *pNtk)
Definition abcNtk.c:578
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition abcNtk.c:1421
void Abc_SclDnsizePerformInt(SC_Lib *pLib, Abc_Ntk_t *pNtk, SC_SizePars *pPars, void *pFuncFanin)
Definition sclDnsize.c:242
void Abc_SclTransferGates(Abc_Ntk_t *pOld, Abc_Ntk_t *pNew)
Definition sclUtil.c:102
int nBarBufs2
Definition abc.h:175
Here is the call graph for this function:

◆ Abc_SclExtractBarBufs()

Vec_Int_t * Abc_SclExtractBarBufs ( Abc_Ntk_t * pNtk)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 287 of file sclUtil.c.

288{
289 Vec_Int_t * vBufs;
290 Mio_Gate_t * pBuffer;
291 Abc_Obj_t * pObj; int i;
292 pBuffer = Mio_LibraryReadBuf( (Mio_Library_t *)pNtk->pManFunc );
293 if ( pBuffer == NULL )
294 {
295 printf( "Cannot find buffer in the current library. Quitting.\n" );
296 return NULL;
297 }
298 vBufs = Vec_IntAlloc( 100 );
299 Abc_NtkForEachBarBuf( pNtk, pObj, i )
300 {
301 assert( pObj->pData == NULL );
302 pObj->pData = pBuffer;
303 Vec_IntPush( vBufs, i );
304 }
305 return vBufs;
306}
#define Abc_NtkForEachBarBuf(pNtk, pNode, i)
Definition abc.h:482
struct Mio_LibraryStruct_t_ Mio_Library_t
Definition mio.h:42
struct Mio_GateStruct_t_ Mio_Gate_t
Definition mio.h:43
Mio_Gate_t * Mio_LibraryReadBuf(Mio_Library_t *pLib)
Definition mioApi.c:49
void * pManFunc
Definition abc.h:191
void * pData
Definition abc.h:145
Here is the call graph for this function:

◆ Abc_SclFindCriticalCo()

Abc_Obj_t * Abc_SclFindCriticalCo ( SC_Man * p,
int * pfRise )
extern

DECLARATIONS ///.

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

FileName [sclSize.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Standard-cell library representation.]

Synopsis [Core timing analysis used in gate-sizing.]

Author [Alan Mishchenko, Niklas Een]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [Finding most critical objects.]

Description []

SideEffects []

SeeAlso []

Definition at line 52 of file sclSize.c.

53{
54 Abc_Obj_t * pObj, * pPivot = NULL;
55 float fMaxArr = 0;
56 int i;
57 assert( Abc_NtkPoNum(p->pNtk) > 0 );
58 Abc_NtkForEachCo( p->pNtk, pObj, i )
59 {
60 SC_Pair * pArr = Abc_SclObjTime( p, pObj );
61 if ( fMaxArr < pArr->rise ) fMaxArr = pArr->rise, *pfRise = 1, pPivot = pObj;
62 if ( fMaxArr < pArr->fall ) fMaxArr = pArr->fall, *pfRise = 0, pPivot = pObj;
63 }
64 if ( fMaxArr == 0 )
65 pPivot = Abc_NtkPo(p->pNtk, 0);
66 assert( pPivot != NULL );
67 return pPivot;
68}
Here is the caller graph for this function:

◆ Abc_SclFindMostCriticalFanin()

Abc_Obj_t * Abc_SclFindMostCriticalFanin ( SC_Man * p,
int * pfRise,
Abc_Obj_t * pNode )
extern

Definition at line 84 of file sclSize.c.

85{
86 Abc_Obj_t * pFanin, * pPivot = NULL;
87 float fMinSlack = ABC_INFINITY;
88 SC_Pair * pArr;
89 int i;
90 *pfRise = 0;
91 // find min-slack node
92 Abc_ObjForEachFanin( pNode, pFanin, i )
93 if ( fMinSlack > Abc_SclObjGetSlack( p, pFanin, p->MaxDelay0 ) )
94 {
95 fMinSlack = Abc_SclObjGetSlack( p, pFanin, p->MaxDelay0 );
96 pPivot = pFanin;
97 }
98 if ( pPivot == NULL )
99 return NULL;
100 // find its leading phase
101 pArr = Abc_SclObjTime( p, pPivot );
102 *pfRise = (pArr->rise >= pArr->fall);
103 return pPivot;
104}
Here is the caller graph for this function:

◆ Abc_SclFindWireCaps()

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

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 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 )
extern

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_SclInsertBarBufs()

void Abc_SclInsertBarBufs ( Abc_Ntk_t * pNtk,
Vec_Int_t * vBufs )
extern

Definition at line 307 of file sclUtil.c.

308{
309 Abc_Obj_t * pObj; int i;
310 Abc_NtkForEachObjVec( vBufs, pNtk, pObj, i )
311 pObj->pData = NULL;
312}
#define Abc_NtkForEachObjVec(vIds, pNtk, pObj, i)
Definition abc.h:455

◆ Abc_SclIsInv()

int Abc_SclIsInv ( Abc_Obj_t * pObj)
extern

Definition at line 116 of file sclBuffer.c.

117{
118 assert( Abc_ObjIsNode(pObj) );
119 return Mio_GateReadTruth((Mio_Gate_t *)pObj->pData) == ABC_CONST(0x5555555555555555);
120}
#define ABC_CONST(number)
PARAMETERS ///.
Definition abc_global.h:240
word Mio_GateReadTruth(Mio_Gate_t *pGate)
Definition mioApi.c:181
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SclManStart()

SC_Man * Abc_SclManStart ( SC_Lib * pLib,
Abc_Ntk_t * pNtk,
int fUseWireLoads,
int fDept,
float DUser,
int nTreeCRatio )
extern

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

Synopsis [Prepare timing manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 648 of file sclSize.c.

649{
650 SC_Man * p = Abc_SclManAlloc( pLib, pNtk );
651 if ( nTreeCRatio )
652 {
653 p->EstLoadMax = 0.01 * nTreeCRatio; // max ratio of Cout/Cave when the estimation is used
654 p->EstLinear = 100; // linear coefficient
655 }
656 Abc_SclMioGates2SclGates( pLib, pNtk );
658 if ( fUseWireLoads )
659 {
660 if ( pNtk->pWLoadUsed == NULL )
661 {
662 p->pWLoadUsed = Abc_SclFindWireLoadModel( pLib, Abc_SclGetTotalArea(p->pNtk) );
663 if ( p->pWLoadUsed )
664 pNtk->pWLoadUsed = Abc_UtilStrsav( p->pWLoadUsed->pName );
665 }
666 else
667 p->pWLoadUsed = Abc_SclFetchWireLoadModel( pLib, pNtk->pWLoadUsed );
668 }
669 Abc_SclTimeNtkRecompute( p, &p->SumArea0, &p->MaxDelay0, fDept, DUser );
670 p->SumArea = p->SumArea0;
671 p->MaxDelay = p->MaxDelay0;
672 return p;
673}
SC_WireLoad * Abc_SclFetchWireLoadModel(SC_Lib *p, char *pName)
Definition sclLibUtil.c:365
SC_WireLoad * Abc_SclFindWireLoadModel(SC_Lib *p, float Area)
Definition sclLibUtil.c:382
void Abc_SclManReadSlewAndLoad(SC_Man *p, Abc_Ntk_t *pNtk)
Definition sclSize.c:609
void Abc_SclTimeNtkRecompute(SC_Man *p, float *pArea, float *pDelay, int fReverse, float DUser)
Definition sclSize.c:415
typedefABC_NAMESPACE_HEADER_START struct SC_Man_ SC_Man
INCLUDES ///.
Definition sclSize.h:44
char * pWLoadUsed
Definition abc.h:209
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SclMinsizePerform()

void Abc_SclMinsizePerform ( SC_Lib * pLib,
Abc_Ntk_t * p,
int fUseMax,
int fVerbose )
extern

Definition at line 204 of file sclUtil.c.

205{
206 Vec_Int_t * vMinCells;
207 Abc_Obj_t * pObj;
208 int i, gateId;
209 vMinCells = Abc_SclFindMinAreas( pLib, fUseMax );
212 {
213 gateId = Vec_IntEntry( p->vGates, i );
214 assert( gateId >= 0 && gateId < Vec_PtrSize(&pLib->vCells) );
215 gateId = Vec_IntEntry( vMinCells, gateId );
216 assert( gateId >= 0 && gateId < Vec_PtrSize(&pLib->vCells) );
217 Vec_IntWriteEntry( p->vGates, i, gateId );
218 }
220 Vec_IntFree( vMinCells );
221}
void Abc_SclSclGates2MioGates(SC_Lib *pLib, Abc_Ntk_t *p)
Definition sclUtil.c:70
ABC_NAMESPACE_IMPL_START void Abc_SclMioGates2SclGates(SC_Lib *pLib, Abc_Ntk_t *p)
DECLARATIONS ///.
Definition sclUtil.c:47
Vec_Ptr_t vCells
Definition sclLib.h:236
Here is the call graph for this function:

◆ Abc_SclMioGates2SclGates()

void Abc_SclMioGates2SclGates ( SC_Lib * pLib,
Abc_Ntk_t * p )
extern

DECLARATIONS ///.

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

FileName [sclUtil.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Standard-cell library representation.]

Synopsis [Various utilities.]

Author [Alan Mishchenko, Niklas Een]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [Converts pNode->pData gates into array of SC_Lit gate IDs and back.]

Description []

SideEffects []

SeeAlso []

Definition at line 47 of file sclUtil.c.

48{
49 Abc_Obj_t * pObj;
50 int i, gateId, bufferId;
51 // find buffer
52 if ( Mio_LibraryReadBuf((Mio_Library_t *)p->pManFunc) == NULL )
53 {
54 printf( "Cannot find buffer in the current library. Quitting.\n" );
55 return;
56 }
57 bufferId = Abc_SclCellFind( pLib, Mio_GateReadName(Mio_LibraryReadBuf((Mio_Library_t *)p->pManFunc)) );
58 assert( bufferId >= 0 );
59 // remap cells
60 assert( p->vGates == NULL );
61 p->vGates = Vec_IntStartFull( Abc_NtkObjNumMax(p) );
63 {
64 gateId = Abc_SclCellFind( pLib, Mio_GateReadName((Mio_Gate_t *)pObj->pData) );
65 assert( gateId >= 0 );
66 Vec_IntWriteEntry( p->vGates, i, gateId );
67 }
68 p->pSCLib = pLib;
69}
char * Mio_GateReadName(Mio_Gate_t *pGate)
Definition mioApi.c:169
int Abc_SclCellFind(SC_Lib *p, char *pName)
Definition sclLibUtil.c:81
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SclPerformBuffering()

Abc_Ntk_t * Abc_SclPerformBuffering ( Abc_Ntk_t * p,
int DegreeR,
int Degree,
int fUseInvs,
int fVerbose )
extern

Definition at line 459 of file sclBuffer.c.

460{
461 Vec_Int_t * vCiLevs;
462 Abc_Ntk_t * pNew;
463 Abc_Obj_t * pObj;
464 int i;
465 assert( Abc_NtkHasMapping(p) );
466 if ( fUseInvs )
467 {
468 printf( "Warning!!! Using inverters instead of buffers.\n" );
469 if ( p->vPhases == NULL )
470 printf( "The phases are not given. The result will not verify.\n" );
471 }
472 // remember CI levels
473 vCiLevs = Vec_IntAlloc( Abc_NtkCiNum(p) );
474 Abc_NtkForEachCi( p, pObj, i )
475 Vec_IntPush( vCiLevs, Abc_ObjLevel(pObj) );
476 // perform buffering
477 Abc_NtkIncrementTravId( p );
478 Abc_NtkForEachCi( p, pObj, i )
479 Abc_SclPerformBuffering_rec( pObj, DegreeR, Degree, fUseInvs, fVerbose );
480 // recompute logic levels
481 Abc_NtkForEachCi( p, pObj, i )
482 pObj->Level = Vec_IntEntry( vCiLevs, i );
483 Abc_NtkForEachNode( p, pObj, i )
484 Abc_ObjLevelNew( pObj );
485 Vec_IntFree( vCiLevs );
486 // if phases are present
487 if ( p->vPhases )
488 Vec_IntFillExtra( p->vPhases, Abc_NtkObjNumMax(p), 0 );
489 // duplication in topo order
490 pNew = Abc_NtkDupDfs( p );
491 Abc_SclCheckNtk( pNew, fVerbose );
492// Abc_NtkDelete( pNew );
493 return pNew;
494}
ABC_DLL int Abc_ObjLevelNew(Abc_Obj_t *pObj)
Definition abcTiming.c:1170
void Abc_SclPerformBuffering_rec(Abc_Obj_t *pObj, int DegreeR, int Degree, int fUseInvs, int fVerbose)
Definition sclBuffer.c:419
unsigned Level
Definition abc.h:142
Here is the call graph for this function:

◆ Abc_SclPrintBuffers()

void Abc_SclPrintBuffers ( SC_Lib * pLib,
Abc_Ntk_t * pNtk,
int fVerbose )
extern

Definition at line 912 of file sclSize.c.

913{
914 int fUseWireLoads = 0;
915 SC_Man * p;
916 assert( Abc_NtkIsMappedLogic(pNtk) );
917 p = Abc_SclManStart( pLib, pNtk, fUseWireLoads, 1, 0, 10000 );
918 Abc_SclPrintBufferTrees( p, pNtk );
919// Abc_SclPrintFaninPairs( p, pNtk );
920 Abc_SclManFree( p );
921}
void Abc_SclPrintBufferTrees(SC_Man *p, Abc_Ntk_t *pNtk)
Definition sclSize.c:896
SC_Man * Abc_SclManStart(SC_Lib *pLib, Abc_Ntk_t *pNtk, int fUseWireLoads, int fDept, float DUser, int nTreeCRatio)
Definition sclSize.c:648
Here is the call graph for this function:

◆ Abc_SclPrintGateSizes()

void Abc_SclPrintGateSizes ( SC_Lib * pLib,
Abc_Ntk_t * p )
extern

Definition at line 156 of file sclUtil.c.

157{
159 Abc_SclManPrintGateSizes( pLib, p, p->vGates );
161 Vec_IntFreeP( &p->vGates );
162 p->pSCLib = NULL;
163}
void Abc_SclManPrintGateSizes(SC_Lib *pLib, Abc_Ntk_t *p, Vec_Int_t *vGates)
Definition sclUtil.c:128
Here is the call graph for this function:

◆ Abc_SclReportDupFanins()

void Abc_SclReportDupFanins ( Abc_Ntk_t * pNtk)
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Make sure fanins of gates are not duplicated.]

Description []

SideEffects []

SeeAlso []

Definition at line 90 of file sclBuffer.c.

91{
92 Abc_Obj_t * pObj, * pFanin, * pFanin2;
93 int i, k, k2;
94 Abc_NtkForEachNode( pNtk, pObj, i )
95 Abc_ObjForEachFanin( pObj, pFanin, k )
96 Abc_ObjForEachFanin( pObj, pFanin2, k2 )
97 if ( k != k2 && pFanin == pFanin2 )
98 printf( "Node %d has dup fanin %d.\n", i, Abc_ObjId(pFanin) );
99}
Here is the caller graph for this function:

◆ Abc_SclSclGates2MioGates()

void Abc_SclSclGates2MioGates ( SC_Lib * pLib,
Abc_Ntk_t * p )
extern

Definition at line 70 of file sclUtil.c.

71{
72 Abc_Obj_t * pObj;
73 SC_Cell * pCell;
74 int i, Counter = 0, CounterAll = 0;
75 assert( p->vGates != NULL );
77 {
78 pCell = Abc_SclObjCell(pObj);
79 assert( pCell->n_inputs == Abc_ObjFaninNum(pObj) );
80 pObj->pData = Mio_LibraryReadGateByName( (Mio_Library_t *)p->pManFunc, pCell->pName, NULL );
81 Counter += (pObj->pData == NULL);
82 assert( pObj->fMarkA == 0 && pObj->fMarkB == 0 );
83 CounterAll++;
84 }
85 if ( Counter )
86 printf( "Could not find %d (out of %d) gates in the current library.\n", Counter, CounterAll );
87 Vec_IntFreeP( &p->vGates );
88 p->pSCLib = NULL;
89}
Mio_Gate_t * Mio_LibraryReadGateByName(Mio_Library_t *pLib, char *pName, char *pOutName)
Definition mioApi.c:105
unsigned fMarkB
Definition abc.h:135
unsigned fMarkA
Definition abc.h:134
char * pName
Definition sclLib.h:202
int n_inputs
Definition sclLib.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SclTimeCone()

void Abc_SclTimeCone ( SC_Man * p,
Vec_Int_t * vCone )
extern

Definition at line 398 of file sclSize.c.

399{
400 int fVerbose = 0;
401 Abc_Obj_t * pObj;
402 int i;
403 Abc_SclConeClean( p, vCone );
404 Abc_NtkForEachObjVec( vCone, p->pNtk, pObj, i )
405 {
406 if ( fVerbose && Abc_ObjIsNode(pObj) )
407 printf( " Updating node %d with gate %s\n", Abc_ObjId(pObj), Abc_SclObjCell(pObj)->pName );
408 if ( fVerbose && Abc_ObjIsNode(pObj) )
409 printf( " before (%6.1f ps %6.1f ps) ", Abc_SclObjTimeOne(p, pObj, 1), Abc_SclObjTimeOne(p, pObj, 0) );
410 Abc_SclTimeNode( p, pObj, 0 );
411 if ( fVerbose && Abc_ObjIsNode(pObj) )
412 printf( "after (%6.1f ps %6.1f ps)\n", Abc_SclObjTimeOne(p, pObj, 1), Abc_SclObjTimeOne(p, pObj, 0) );
413 }
414}
void Abc_SclTimeNode(SC_Man *p, Abc_Obj_t *pObj, int fDept)
Definition sclSize.c:323
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SclTimeIncInsert()

void Abc_SclTimeIncInsert ( SC_Man * p,
Abc_Obj_t * pObj )
extern

Definition at line 577 of file sclSize.c.

578{
579 Vec_IntPush( p->vChanged, Abc_ObjId(pObj) );
580}
Here is the caller graph for this function:

◆ Abc_SclTimeIncUpdate()

int Abc_SclTimeIncUpdate ( SC_Man * p)
extern

Definition at line 555 of file sclSize.c.

556{
557 Abc_Obj_t * pObj;
558 int i, RetValue;
559 if ( Vec_IntSize(p->vChanged) == 0 )
560 return 0;
561// Abc_SclTimeIncCheckLevel( p->pNtk );
562 Abc_NtkForEachObjVec( p->vChanged, p->pNtk, pObj, i )
563 {
564 Abc_SclTimeIncAddFanins( p, pObj );
565 if ( pObj->fMarkC )
566 continue;
567 Abc_SclTimeIncAddNode( p, pObj );
568 }
569 Vec_IntClear( p->vChanged );
570 Abc_SclTimeIncUpdateArrival( p );
571 Abc_SclTimeIncUpdateDeparture( p );
572 Abc_SclTimeIncUpdateClean( p );
573 RetValue = p->nIncUpdates;
574 p->nIncUpdates = 0;
575 return RetValue;
576}
unsigned fMarkC
Definition abc.h:136
Here is the caller graph for this function:

◆ Abc_SclTimeIncUpdateLevel()

void Abc_SclTimeIncUpdateLevel ( Abc_Obj_t * pObj)
extern

Definition at line 591 of file sclSize.c.

592{
594}
void Abc_SclTimeIncUpdateLevel_rec(Abc_Obj_t *pObj)
Definition sclSize.c:581
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SclTimeNtkPrint()

void Abc_SclTimeNtkPrint ( SC_Man * p,
int fShowAll,
int fPrintPath )
extern

Definition at line 136 of file sclSize.c.

137{
138 int fReversePath = 1;
139 int i, nLength = 0, fRise = 0;
140 Abc_Obj_t * pObj, * pPivot = Abc_SclFindCriticalCo( p, &fRise );
141 float maxDelay = Abc_SclObjTimeOne( p, pPivot, fRise );
142 p->ReportDelay = maxDelay;
143 // used for Floyds cycle detection algorithm
144 unsigned int tortoiseIndex = 0;
145 int tortoiseStep = 0;
146
147#ifdef WIN32
148 printf( "WireLoad = \"%s\" ", p->pWLoadUsed ? p->pWLoadUsed->pName : "none" );
149 SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), 14 ); // yellow
150 printf( "Gates =%7d ", Abc_NtkNodeNum(p->pNtk) );
151 SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), 7 ); // normal
152 printf( "(%5.1f %%) ", 100.0 * Abc_SclGetBufInvCount(p->pNtk) / Abc_NtkNodeNum(p->pNtk) );
153 SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), 10 ); // green
154 printf( "Cap =%5.1f ff ", p->EstLoadAve );
155 SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), 7 ); // normal
156 printf( "(%5.1f %%) ", Abc_SclGetAverageSize(p->pNtk) );
157 SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), 11 ); // blue
158 printf( "Area =%12.2f ", Abc_SclGetTotalArea(p->pNtk) );
159 SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), 7 ); // normal
160 printf( "(%5.1f %%) ", 100.0 * Abc_SclCountMinSize(p->pLib, p->pNtk, 0) / Abc_NtkNodeNum(p->pNtk) );
161 SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), 13 ); // magenta
162 printf( "Delay =%9.2f ps ", maxDelay );
163 SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), 7 ); // normal
164 printf( "(%5.1f %%) ", 100.0 * Abc_SclCountNearCriticalNodes(p) / Abc_NtkNodeNum(p->pNtk) );
165 printf( " \n" );
166#else
167 Abc_Print( 1, "WireLoad = \"%s\" ", p->pWLoadUsed ? p->pWLoadUsed->pName : "none" );
168 Abc_Print( 1, "%sGates =%7d%s ", "\033[1;33m", Abc_NtkNodeNum(p->pNtk), "\033[0m" ); // yellow
169 Abc_Print( 1, "(%5.1f %%) ", 100.0 * Abc_SclGetBufInvCount(p->pNtk) / Abc_NtkNodeNum(p->pNtk) );
170 Abc_Print( 1, "%sCap =%5.1f ff%s ", "\033[1;32m", p->EstLoadAve, "\033[0m" ); // green
171 Abc_Print( 1, "(%5.1f %%) ", Abc_SclGetAverageSize(p->pNtk) );
172 Abc_Print( 1, "%sArea =%12.2f%s ", "\033[1;36m", Abc_SclGetTotalArea(p->pNtk), "\033[0m" ); // blue
173 Abc_Print( 1, "(%5.1f %%) ", 100.0 * Abc_SclCountMinSize(p->pLib, p->pNtk, 0) / Abc_NtkNodeNum(p->pNtk) );
174 Abc_Print( 1, "%sDelay =%9.2f ps%s ", "\033[1;35m", maxDelay, "\033[0m" ); // magenta
175 Abc_Print( 1, "(%5.1f %%) ", 100.0 * Abc_SclCountNearCriticalNodes(p) / Abc_NtkNodeNum(p->pNtk) );
176 Abc_Print( 1, " \n" );
177#endif
178
179 if ( fShowAll )
180 {
181// printf( "Timing information for all nodes: \n" );
182 // find the longest cell name
183 Abc_NtkForEachNodeReverse( p->pNtk, pObj, i )
184 if ( Abc_ObjFaninNum(pObj) > 0 )
185 nLength = Abc_MaxInt( nLength, strlen(Abc_SclObjCell(pObj)->pName) );
186 // print timing
187 Abc_NtkForEachNodeReverse( p->pNtk, pObj, i )
188 if ( Abc_ObjFaninNum(pObj) > 0 )
189 Abc_SclTimeNodePrint( p, pObj, -1, nLength, maxDelay );
190 }
191 if ( fPrintPath )
192 {
193 Abc_Obj_t * pTemp, * pPrev = NULL;
194 int iStart = -1, iEnd = -1;
195 Vec_Ptr_t * vPath;
196// printf( "Critical path: \n" );
197 // find the longest cell name
198 pObj = Abc_ObjFanin0(pPivot);
199 i = 0;
200 while ( pObj && Abc_ObjIsNode(pObj) )
201 {
202 i++;
203 nLength = Abc_MaxInt( nLength, Abc_SclObjCell(pObj) ? strlen(Abc_SclObjCell(pObj)->pName) : 2 /* strlen("pi") */ );
204 pObj = Abc_SclFindMostCriticalFanin( p, &fRise, pObj );
205 }
206
207 // print timing
208 if ( !fReversePath )
209 {
210 // print timing
211 pObj = Abc_ObjFanin0(pPivot);
212 while ( pObj )//&& Abc_ObjIsNode(pObj) )
213 {
214 printf( "Path%3d --", i-- );
215 Abc_SclTimeNodePrint( p, pObj, fRise, nLength, maxDelay );
216 pPrev = pObj;
217 pObj = Abc_SclFindMostCriticalFanin( p, &fRise, pObj );
218 }
219 }
220 else
221 {
222 // collect path nodes
223 vPath = Vec_PtrAlloc( 100 );
224 Vec_PtrPush( vPath, pPivot );
225 pObj = Abc_ObjFanin0(pPivot);
226 while ( pObj )//&& Abc_ObjIsNode(pObj) )
227 {
228 Vec_PtrPush( vPath, pObj );
229 pPrev = pObj;
230 pObj = Abc_SclFindMostCriticalFanin( p, &fRise, pObj );
231
232 // move the tortoise at half the speed (trailing)
233 tortoiseStep = (tortoiseStep + 1) % 2;
234 tortoiseIndex += tortoiseStep;
235 // if they see the same element, we are in a loop
236 if(vPath->pArray[tortoiseIndex] == pObj) {
237 break;
238 }
239 }
240 Vec_PtrForEachEntryReverse( Abc_Obj_t *, vPath, pObj, i )
241 {
242 printf( "Path%3d --", Vec_PtrSize(vPath)-1-i );
243 Abc_SclTimeNodePrint( p, pObj, fRise, nLength, maxDelay );
244 if ( i == 1 )
245 break;
246 }
247 Vec_PtrFree( vPath );
248 }
249 // print start-point and end-point
250 Abc_NtkForEachPi( p->pNtk, pTemp, iStart )
251 if ( pTemp == pPrev )
252 break;
253 Abc_NtkForEachPo( p->pNtk, pTemp, iEnd )
254 if ( pTemp == pPivot )
255 break;
256 printf( "Start-point = pi%0*d. End-point = po%0*d.\n",
257 Abc_Base10Log( Abc_NtkPiNum(p->pNtk) ), iStart,
258 Abc_Base10Log( Abc_NtkPoNum(p->pNtk) ), iEnd );
259 }
260}
#define Abc_NtkForEachPo(pNtk, pPo, i)
Definition abc.h:520
#define Abc_NtkForEachNodeReverse(pNtk, pNode, i)
Definition abc.h:476
ABC_NAMESPACE_IMPL_START Abc_Obj_t * Abc_SclFindCriticalCo(SC_Man *p, int *pfRise)
DECLARATIONS ///.
Definition sclSize.c:52
Abc_Obj_t * Abc_SclFindMostCriticalFanin(SC_Man *p, int *pfRise, Abc_Obj_t *pNode)
Definition sclSize.c:84
int Abc_SclCountMinSize(SC_Lib *pLib, Abc_Ntk_t *p, int fUseMax)
Definition sclUtil.c:222
int Abc_SclCountNearCriticalNodes(SC_Man *p)
Definition sclUpsize.c:187
int strlen()
#define Vec_PtrForEachEntryReverse(Type, vVec, pEntry, i)
Definition vecPtr.h:63
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SclTimeNtkRecompute()

void Abc_SclTimeNtkRecompute ( SC_Man * p,
float * pArea,
float * pDelay,
int fReverse,
float DUser )
extern

Definition at line 415 of file sclSize.c.

416{
417 Abc_Obj_t * pObj;
418 float D;
419 int i;
421 Abc_SclManCleanTime( p );
422 p->nEstNodes = 0;
423 Abc_NtkForEachCi( p->pNtk, pObj, i )
424 Abc_SclTimeNode( p, pObj, 0 );
425 Abc_NtkForEachNode1( p->pNtk, pObj, i )
426 Abc_SclTimeNode( p, pObj, 0 );
427 Abc_NtkForEachCo( p->pNtk, pObj, i )
428 Abc_SclTimeNode( p, pObj, 0 );
429 D = Abc_SclReadMaxDelay( p );
430 if ( fReverse && DUser > 0 && D < DUser )
431 D = DUser;
432 if ( pArea )
433 *pArea = Abc_SclGetTotalArea(p->pNtk);
434 if ( pDelay )
435 *pDelay = D;
436 if ( fReverse )
437 {
438 p->nEstNodes = 0;
439 Abc_NtkForEachNodeReverse1( p->pNtk, pObj, i )
440 Abc_SclTimeNode( p, pObj, 1 );
441 }
442}
#define Abc_NtkForEachNodeReverse1(pNtk, pNode, i)
Definition abc.h:479
void Abc_SclComputeLoad(SC_Man *p)
Definition sclLoad.c:108
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SclTimePerform()

void Abc_SclTimePerform ( SC_Lib * pLib,
Abc_Ntk_t * pNtk,
int nTreeCRatio,
int fUseWireLoads,
int fShowAll,
int fPrintPath,
int fDumpStats )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 707 of file sclSize.c.

708{
709 Abc_Ntk_t * pNtkNew = pNtk;
710 if ( pNtk->nBarBufs2 > 0 )
711 pNtkNew = Abc_NtkDupDfsNoBarBufs( pNtk );
712 Abc_SclTimePerformInt( pLib, pNtkNew, nTreeCRatio, fUseWireLoads, fShowAll, fPrintPath, fDumpStats );
713 if ( pNtk->nBarBufs2 > 0 )
714 Abc_NtkDelete( pNtkNew );
715}
void Abc_SclTimePerformInt(SC_Lib *pLib, Abc_Ntk_t *pNtk, int nTreeCRatio, int fUseWireLoads, int fShowAll, int fPrintPath, int fDumpStats)
Definition sclSize.c:686
Here is the call graph for this function:

◆ Abc_SclTransferGates()

void Abc_SclTransferGates ( Abc_Ntk_t * pOld,
Abc_Ntk_t * pNew )
extern

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

Synopsis [Transfer gate sizes from AIG without barbufs.]

Description []

SideEffects []

SeeAlso []

Definition at line 102 of file sclUtil.c.

103{
104 Abc_Obj_t * pObj; int i;
105 assert( pOld->nBarBufs2 > 0 );
106 assert( pNew->nBarBufs2 == 0 );
107 Abc_NtkForEachNodeNotBarBuf( pOld, pObj, i )
108 {
109 if ( pObj->pCopy == NULL )
110 continue;
111 assert( Abc_ObjNtk(pObj->pCopy) == pNew );
112 pObj->pData = pObj->pCopy->pData;
113 }
114}
#define Abc_NtkForEachNodeNotBarBuf(pNtk, pNode, i)
Definition abc.h:467
Abc_Obj_t * pCopy
Definition abc.h:148
Here is the caller graph for this function:

◆ Abc_SclUnBufferPerform()

Abc_Ntk_t * Abc_SclUnBufferPerform ( Abc_Ntk_t * pNtk,
int fVerbose )
extern

Definition at line 129 of file sclBuffer.c.

130{
131 Vec_Int_t * vLits;
132 Abc_Obj_t * pObj, * pFanin, * pFaninNew;
133 int i, k, iLit, nNodesOld = Abc_NtkObjNumMax(pNtk);
134 // assign inverters
135 vLits = Vec_IntStartFull( Abc_NtkObjNumMax(pNtk) );
136 Abc_NtkForEachNode( pNtk, pObj, i )
137 if ( Abc_SclIsInv(pObj) && !Abc_SclObjIsBufInv(Abc_ObjFanin0(pObj)) )
138 Vec_IntWriteEntry( vLits, Abc_ObjFaninId0(pObj), Abc_ObjId(pObj) );
139 // transfer fanins
140 Abc_NtkForEachNodeCo( pNtk, pObj, i )
141 {
142 if ( i >= nNodesOld )
143 break;
144 Abc_ObjForEachFanin( pObj, pFanin, k )
145 {
146 if ( !Abc_SclObjIsBufInv(pFanin) )
147 continue;
148 iLit = Abc_SclGetRealFaninLit( pFanin );
149 pFaninNew = Abc_NtkObj( pNtk, Abc_Lit2Var(iLit) );
150 if ( Abc_LitIsCompl(iLit) )
151 {
152 if ( Vec_IntEntry( vLits, Abc_Lit2Var(iLit) ) == -1 )
153 {
154 pFaninNew = Abc_NtkCreateNodeInv( pNtk, pFaninNew );
155 Vec_IntWriteEntry( vLits, Abc_Lit2Var(iLit), Abc_ObjId(pFaninNew) );
156 }
157 else
158 pFaninNew = Abc_NtkObj( pNtk, Vec_IntEntry( vLits, Abc_Lit2Var(iLit) ) );
159 assert( Abc_ObjFaninNum(pFaninNew) == 1 );
160 }
161 if ( pFanin != pFaninNew )
162 Abc_ObjPatchFanin( pObj, pFanin, pFaninNew );
163 }
164 }
165 Vec_IntFree( vLits );
166 // duplicate network in topo order
167 return Abc_NtkDupDfs( pNtk );
168}
int Abc_SclIsInv(Abc_Obj_t *pObj)
Definition sclBuffer.c:116
int Abc_SclGetRealFaninLit(Abc_Obj_t *pObj)
Definition sclBuffer.c:121
Here is the call graph for this function:

◆ Abc_SclUnBufferPhase()

Abc_Ntk_t * Abc_SclUnBufferPhase ( Abc_Ntk_t * pNtk,
int fVerbose )
extern

Definition at line 239 of file sclBuffer.c.

240{
241 Abc_Ntk_t * pNtkNew;
242 Abc_Obj_t * pObj, * pFanin, * pFaninNew;
243 int i, k, iLit, Counter = 0, Total = 0;
244 assert( pNtk->vPhases == NULL );
245 pNtk->vPhases = Vec_IntStart( Abc_NtkObjNumMax(pNtk) );
246 Abc_NtkForEachNodeCo( pNtk, pObj, i )
247 {
248 if ( Abc_SclObjIsBufInv(pObj) )
249 continue;
250 Abc_ObjForEachFanin( pObj, pFanin, k )
251 {
252 Total++;
253 iLit = Abc_SclGetRealFaninLit( pFanin );
254 pFaninNew = Abc_NtkObj( pNtk, Abc_Lit2Var(iLit) );
255 if ( pFaninNew == pFanin )
256 continue;
257 // skip fanins which are already fanins of the node
258 if ( Abc_NodeFindFanin( pObj, pFaninNew ) >= 0 )
259 continue;
260 Abc_ObjPatchFanin( pObj, pFanin, pFaninNew );
261 if ( Abc_LitIsCompl(iLit) )
262 Abc_ObjFaninFlipPhase( pObj, k ), Counter++;
263 }
264 }
265 if ( fVerbose )
266 printf( "Saved %d (%.2f %%) fanin phase bits. ", Counter, 100.0 * Counter / Total );
267 // duplicate network in topo order
268 pNtkNew = Abc_NtkDupDfs( pNtk );
269 if ( fVerbose )
270 printf( "Max depth = %d.\n", Abc_SclCountMaxPhases(pNtkNew) );
271 Abc_SclReportDupFanins( pNtkNew );
272 return pNtkNew;
273}
int Abc_SclCountMaxPhases(Abc_Ntk_t *pNtk)
Definition sclBuffer.c:181
Here is the call graph for this function:

◆ Abc_SclUpdateLoad()

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

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 )
extern

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}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SclUpsizePerform()

void Abc_SclUpsizePerform ( SC_Lib * pLib,
Abc_Ntk_t * pNtk,
SC_SizePars * pPars,
void * pFuncFanin )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 1028 of file sclUpsize.c.

1029{
1030 Abc_Ntk_t * pNtkNew = pNtk;
1031 if ( pNtk->nBarBufs2 > 0 )
1032 pNtkNew = Abc_NtkDupDfsNoBarBufs( pNtk );
1033 Abc_SclUpsizePerformInt( pLib, pNtkNew, pPars, pFuncFanin );
1034 if ( pNtk->nBarBufs2 > 0 )
1035 Abc_SclTransferGates( pNtk, pNtkNew );
1036 if ( pNtk->nBarBufs2 > 0 )
1037 Abc_NtkDelete( pNtkNew );
1038}
void Abc_SclUpsizePerformInt(SC_Lib *pLib, Abc_Ntk_t *pNtk, SC_SizePars *pPars, void *pFuncFanin)
Definition sclUpsize.c:868
Here is the call graph for this function: