ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
sclBufSize.c File Reference
#include "sclSize.h"
#include "map/mio/mio.h"
#include "base/main/main.h"
Include dependency graph for sclBufSize.c:

Go to the source code of this file.

Classes

struct  Bus_Man_t_
 

Typedefs

typedef typedefABC_NAMESPACE_IMPL_START struct Bus_Man_t_ Bus_Man_t
 DECLARATIONS ///.
 

Functions

Bus_Man_tBus_ManStart (Abc_Ntk_t *pNtk, SC_Lib *pLib, SC_BusPars *pPars)
 FUNCTION DEFINITIONS ///.
 
void Bus_ManStop (Bus_Man_t *p)
 
void Bus_ManReadInOutLoads (Bus_Man_t *p)
 
float Abc_NtkComputeNodeDeparture (Abc_Obj_t *pObj, float Slew)
 
void Abc_NtkComputeFanoutInfo (Abc_Obj_t *pObj, float Slew)
 
float Abc_NtkComputeNodeLoad (Bus_Man_t *p, Abc_Obj_t *pObj)
 
float Abc_NtkComputeFanoutLoad (Bus_Man_t *p, Vec_Ptr_t *vFanouts)
 
void Abc_NtkPrintFanoutProfile (Abc_Obj_t *pObj)
 
void Abc_NtkPrintFanoutProfileVec (Abc_Obj_t *pObj, Vec_Ptr_t *vFanouts)
 
int Bus_SclCompareFanouts (Abc_Obj_t **pp1, Abc_Obj_t **pp2)
 
void Bus_SclInsertFanout (Vec_Ptr_t *vFanouts, Abc_Obj_t *pObj)
 
void Bus_SclCheckSortedFanout (Vec_Ptr_t *vFanouts)
 
void Abc_SclOneNodePrint (Bus_Man_t *p, Abc_Obj_t *pObj)
 
Abc_Obj_tAbc_SclAddOneInv (Bus_Man_t *p, Abc_Obj_t *pObj, Vec_Ptr_t *vFanouts, float Gain)
 
void Abc_SclBufSize (Bus_Man_t *p, float Gain)
 
Abc_Ntk_tAbc_SclBufferingPerform (Abc_Ntk_t *pNtk, SC_Lib *pLib, SC_BusPars *pPars)
 

Typedef Documentation

◆ Bus_Man_t

typedef typedefABC_NAMESPACE_IMPL_START struct Bus_Man_t_ Bus_Man_t

DECLARATIONS ///.

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

FileName [sclBufSize.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Standard-cell library representation.]

Synopsis [Buffering and sizing combined.]

Author [Alan Mishchenko, Niklas Een]

Affiliation [UC Berkeley]

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

Revision [

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

]

Definition at line 32 of file sclBufSize.c.

Function Documentation

◆ Abc_NtkComputeFanoutInfo()

void Abc_NtkComputeFanoutInfo ( Abc_Obj_t * pObj,
float Slew )

Definition at line 192 of file sclBufSize.c.

193{
194 Abc_Obj_t * pFanout;
195 int i;
196 Abc_ObjForEachFanout( pObj, pFanout, i )
197 {
198 if ( Abc_ObjIsBarBuf(pFanout) )
199 {
200 Bus_SclObjSetETime( pFanout, Bus_SclObjDept(pFanout) );
201 Bus_SclObjSetCin( pFanout, Bus_SclObjLoad(pFanout) );
202 }
203 else if ( !Abc_ObjIsCo(pFanout) )
204 {
205 int iFanin = Abc_NodeFindFanin(pFanout, pObj);
206 Bus_SclObjSetETime( pFanout, Abc_NtkComputeEdgeDept(pFanout, iFanin, Slew) );
207 Bus_SclObjSetCin( pFanout, SC_CellPinCap( Abc_SclObjCell(pFanout), iFanin ) );
208 }
209 }
210}
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
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkComputeFanoutLoad()

float Abc_NtkComputeFanoutLoad ( Bus_Man_t * p,
Vec_Ptr_t * vFanouts )

Definition at line 223 of file sclBufSize.c.

224{
225 Abc_Obj_t * pFanout;
226 float Load;
227 int i;
228 Load = Abc_SclFindWireLoad( p->vWireCaps, Vec_PtrSize(vFanouts) );
229 Vec_PtrForEachEntry( Abc_Obj_t *, vFanouts, pFanout, i )
230 Load += Bus_SclObjCin( pFanout );
231 return Load;
232}
Cube * p
Definition exorList.c:222
float Abc_SclFindWireLoad(Vec_Flt_t *vWireCaps, int nFans)
Definition sclLoad.c:96
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkComputeNodeDeparture()

float Abc_NtkComputeNodeDeparture ( Abc_Obj_t * pObj,
float Slew )

Definition at line 178 of file sclBufSize.c.

179{
180 Abc_Obj_t * pFanout;
181 int i;
182 assert( Bus_SclObjDept(pObj) == 0 );
183 Abc_ObjForEachFanout( pObj, pFanout, i )
184 {
185 if ( Abc_ObjIsBarBuf(pFanout) )
186 Bus_SclObjUpdateDept( pObj, Bus_SclObjDept(pFanout) );
187 else if ( !Abc_ObjIsCo(pFanout) ) // add required times here
188 Bus_SclObjUpdateDept( pObj, Abc_NtkComputeEdgeDept(pFanout, Abc_NodeFindFanin(pFanout, pObj), Slew) );
189 }
190 return Bus_SclObjDept( pObj );
191}
#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_NtkComputeNodeLoad()

float Abc_NtkComputeNodeLoad ( Bus_Man_t * p,
Abc_Obj_t * pObj )

Definition at line 211 of file sclBufSize.c.

212{
213 Abc_Obj_t * pFanout;
214 float Load;
215 int i;
216 assert( Bus_SclObjLoad(pObj) == 0 );
217 Load = Abc_SclFindWireLoad( p->vWireCaps, Abc_ObjFanoutNum(pObj) );
218 Abc_ObjForEachFanout( pObj, pFanout, i )
219 Load += Bus_SclObjCin( pFanout );
220 Bus_SclObjSetLoad( pObj, Load );
221 return Load;
222}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkPrintFanoutProfile()

void Abc_NtkPrintFanoutProfile ( Abc_Obj_t * pObj)

Definition at line 233 of file sclBufSize.c.

234{
235 Abc_Obj_t * pFanout;
236 int i;
237 printf( "Obj %6d fanouts (%d):\n", Abc_ObjId(pObj), Abc_ObjFanoutNum(pObj) );
238 Abc_ObjForEachFanout( pObj, pFanout, i )
239 {
240 printf( "%3d : time = %7.2f ps load = %7.2f ff ", i, Bus_SclObjETime(pFanout), Bus_SclObjCin(pFanout) );
241 printf( "%s\n", Abc_ObjFaninPhase( pFanout, Abc_NodeFindFanin(pFanout, pObj) ) ? "*" : " " );
242 }
243 printf( "\n" );
244}
Here is the call graph for this function:

◆ Abc_NtkPrintFanoutProfileVec()

void Abc_NtkPrintFanoutProfileVec ( Abc_Obj_t * pObj,
Vec_Ptr_t * vFanouts )

Definition at line 245 of file sclBufSize.c.

246{
247 Abc_Obj_t * pFanout;
248 int i;
249 printf( "Fanout profile (%d):\n", Vec_PtrSize(vFanouts) );
250 Vec_PtrForEachEntry( Abc_Obj_t *, vFanouts, pFanout, i )
251 {
252 printf( "%3d : time = %7.2f ps load = %7.2f ff ", i, Bus_SclObjETime(pFanout), Bus_SclObjCin(pFanout) );
253 if ( pObj->pNtk->vPhases )
254 printf( "%s", (pObj && Abc_ObjFanoutNum(pObj) == Vec_PtrSize(vFanouts) && Abc_ObjFaninPhase( pFanout, Abc_NodeFindFanin(pFanout, pObj) )) ? "*" : " " );
255 printf( "\n" );
256 }
257 printf( "\n" );
258}
Vec_Int_t * vPhases
Definition abc.h:208
Abc_Ntk_t * pNtk
Definition abc.h:130
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SclAddOneInv()

Abc_Obj_t * Abc_SclAddOneInv ( Bus_Man_t * p,
Abc_Obj_t * pObj,
Vec_Ptr_t * vFanouts,
float Gain )

Definition at line 343 of file sclBufSize.c.

344{
345 SC_Cell * pCellNew;
346 Abc_Obj_t * pFanout, * pInv;
347 float Target = SC_CellPinCap(p->pInv, 0) * Gain;
348 float LoadWirePrev, LoadWireThis, Load = 0;
349 int Limit = Abc_MinInt( p->pPars->nDegree, Vec_PtrSize(vFanouts) );
350 int i, iStop;
351 Bus_SclCheckSortedFanout( vFanouts );
352 Vec_PtrForEachEntryStop( Abc_Obj_t *, vFanouts, pFanout, iStop, Limit )
353 {
354 LoadWirePrev = Abc_SclFindWireLoad( p->vWireCaps, iStop );
355 LoadWireThis = Abc_SclFindWireLoad( p->vWireCaps, iStop+1 );
356 Load += Bus_SclObjCin( pFanout ) - LoadWirePrev + LoadWireThis;
357 if ( Load > Target )
358 {
359 iStop++;
360 break;
361 }
362 }
363 // create inverter
364 if ( p->pPars->fAddBufs )
365 pInv = Abc_NtkCreateNodeBuf( p->pNtk, NULL );
366 else
367 pInv = Abc_NtkCreateNodeInv( p->pNtk, NULL );
368 assert( (int)Abc_ObjId(pInv) == Vec_FltSize(p->vCins) );
369 Vec_FltPush( p->vCins, 0 );
370 Vec_FltPush( p->vETimes, 0 );
371 Vec_FltPush( p->vLoads, 0 );
372 Vec_FltPush( p->vDepts, 0 );
373 Limit = Abc_MinInt( Abc_MaxInt(iStop, 2), Vec_PtrSize(vFanouts) );
374 Vec_PtrForEachEntryStop( Abc_Obj_t *, vFanouts, pFanout, i, Limit )
375 {
376 Vec_PtrWriteEntry( vFanouts, i, NULL );
377 if ( Abc_ObjFaninNum(pFanout) == 0 )
378 Abc_ObjAddFanin( pFanout, pInv );
379 else
380 Abc_ObjPatchFanin( pFanout, pObj, pInv );
381 }
382 // set the gate
383 pCellNew = Abc_SclFindSmallestGate( p->pInv, Load / Gain );
384 Vec_IntSetEntry( p->pNtk->vGates, Abc_ObjId(pInv), pCellNew->Id );
385 // set departure and load
386 Abc_NtkComputeNodeDeparture( pInv, p->pPars->Slew );
387 Abc_NtkComputeNodeLoad( p, pInv );
388 // set fanout info for the inverter
389 Bus_SclObjSetCin( pInv, SC_CellPinCap(pCellNew, 0) );
390 Bus_SclObjSetETime( pInv, Abc_NtkComputeEdgeDept(pInv, 0, p->pPars->Slew) );
391 // update phases
392 if ( p->pNtk->vPhases && Abc_SclIsInv(pInv) )
394 return pInv;
395}
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition abcFanio.c:84
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeBuf(Abc_Ntk_t *pNtk, Abc_Obj_t *pFanin)
Definition abcObj.c:706
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
void Bus_SclCheckSortedFanout(Vec_Ptr_t *vFanouts)
Definition sclBufSize.c:304
float Abc_NtkComputeNodeDeparture(Abc_Obj_t *pObj, float Slew)
Definition sclBufSize.c:178
float Abc_NtkComputeNodeLoad(Bus_Man_t *p, Abc_Obj_t *pObj)
Definition sclBufSize.c:211
void Abc_NodeInvUpdateFanPolarity(Abc_Obj_t *pObj)
Definition sclBuffer.c:322
int Abc_SclIsInv(Abc_Obj_t *pObj)
Definition sclBuffer.c:116
SC_Cell * Abc_SclFindSmallestGate(SC_Cell *p, float CinMin)
Definition sclLibUtil.c:343
struct SC_Cell_ SC_Cell
Definition sclLib.h:127
int Id
Definition sclLib.h:203
#define Vec_PtrForEachEntryStop(Type, vVec, pEntry, i, Stop)
Definition vecPtr.h:59
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 )

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
int GainRatio
Definition sclLib.h:105
Here is the call graph for this function:

◆ Abc_SclBufSize()

void Abc_SclBufSize ( Bus_Man_t * p,
float Gain )

Definition at line 396 of file sclBufSize.c.

397{
398 SC_Cell * pCell, * pCellNew;
399 Abc_Obj_t * pObj, * pFanout;
400 abctime clk = Abc_Clock();
401 int i, k, nObjsOld = Abc_NtkObjNumMax(p->pNtk);
402 float GainGate, GainInv, Load, Cin, DeptMax = 0;
403 GainGate = p->pPars->fAddBufs ? (float)pow( (double)Gain, (double)2.0 ) : Gain;
404 GainInv = p->pPars->fAddBufs ? (float)pow( (double)Gain, (double)2.0 ) : Gain;
405 Abc_NtkForEachObjReverse( p->pNtk, pObj, i )
406 {
407 if ( !((Abc_ObjIsNode(pObj) && Abc_ObjFaninNum(pObj) > 0) || (Abc_ObjIsCi(pObj) && p->pPiDrive)) )
408 continue;
409 if ( 2 * nObjsOld < Abc_NtkObjNumMax(p->pNtk) )
410 {
411 printf( "Buffering could not be completed because the gain value (%d) is too low.\n", p->pPars->GainRatio );
412 break;
413 }
414 // compute load
415 Abc_NtkComputeFanoutInfo( pObj, p->pPars->Slew );
416 Load = Abc_NtkComputeNodeLoad( p, pObj );
417 // consider the gate
418 if ( Abc_ObjIsCi(pObj) || Abc_ObjIsBarBuf(pObj) )
419 {
420 pCell = p->pPiDrive;
421 // if PI driver is not given, assume Cin to be equal to Load
422 // this way, buffering of the PIs is performed
423 Cin = pCell ? SC_CellPinCapAve(pCell) : Load;
424 }
425 else
426 {
427 pCell = Abc_SclObjCell( pObj );
428 Cin = SC_CellPinCapAve( pCell->pAve );
429// Cin = SC_CellPinCapAve( pCell->pRepr->pNext );
430 }
431 // consider buffering this gate
432 if ( !p->pPars->fSizeOnly && (Abc_ObjFanoutNum(pObj) > p->pPars->nDegree || Load > GainGate * Cin) )
433 {
434 // add one or more inverters
435// Abc_NtkPrintFanoutProfile( pObj );
436 Abc_NodeCollectFanouts( pObj, p->vFanouts );
437 Vec_PtrSort( p->vFanouts, (int(*)(const void *, const void *))Bus_SclCompareFanouts );
438 do
439 {
440 Abc_Obj_t * pInv;
441 if ( p->pPars->fVeryVerbose )//|| Vec_PtrSize(p->vFanouts) == Abc_ObjFanoutNum(pObj) )
442 Abc_NtkPrintFanoutProfileVec( pObj, p->vFanouts );
443 pInv = Abc_SclAddOneInv( p, pObj, p->vFanouts, GainInv );
444 if ( p->pPars->fVeryVerbose )
445 Abc_SclOneNodePrint( p, pInv );
446 Bus_SclInsertFanout( p->vFanouts, pInv );
447 Load = Abc_NtkComputeFanoutLoad( p, p->vFanouts );
448 }
449 while ( Vec_PtrSize(p->vFanouts) > p->pPars->nDegree || (Vec_PtrSize(p->vFanouts) > 1 && Load > GainGate * Cin) );
450 // update node fanouts
451 Vec_PtrForEachEntry( Abc_Obj_t *, p->vFanouts, pFanout, k )
452 if ( Abc_ObjFaninNum(pFanout) == 0 )
453 Abc_ObjAddFanin( pFanout, pObj );
454 Bus_SclObjSetLoad( pObj, 0 );
455 Abc_NtkComputeNodeLoad( p, pObj );
456 }
457 if ( Abc_ObjIsCi(pObj) )
458 continue;
459 Abc_NtkComputeNodeDeparture( pObj, p->pPars->Slew );
460 if ( Abc_ObjIsBarBuf(pObj) )
461 continue;
462 // create cell
463 pCellNew = Abc_SclFindSmallestGate( pCell, Load / GainGate );
464 Abc_SclObjSetCell( pObj, pCellNew );
465 if ( p->pPars->fVeryVerbose )
466 Abc_SclOneNodePrint( p, pObj );
467 assert( p->pPars->fSizeOnly || Abc_ObjFanoutNum(pObj) <= p->pPars->nDegree );
468 }
469 // compute departure time of the PI
470 if ( i < 0 ) // finished buffering
471 Abc_NtkForEachCi( p->pNtk, pObj, i )
472 {
473 float DeptCur = Abc_NtkComputeNodeDeparture(pObj, p->pPars->Slew);
474 if ( p->pPiDrive )
475 {
476 float Load = Bus_SclObjLoad( pObj );
477 SC_Pair ArrOut, SlewOut, LoadIn = { Load, Load };
478 Scl_LibHandleInputDriver( p->pPiDrive, &LoadIn, &ArrOut, &SlewOut );
479 DeptCur += 0.5 * ArrOut.fall + 0.5 * ArrOut.rise;
480 }
481 DeptMax = Abc_MaxFloat( DeptMax, DeptCur );
482 }
483 if ( p->pPars->fVerbose )
484 {
485 printf( "WireLoads = %d Degree = %d Target slew =%4d ps Gain2 =%5d Buf = %6d Delay =%7.0f ps ",
486 p->pPars->fUseWireLoads, p->pPars->nDegree, p->pPars->Slew, p->pPars->GainRatio,
487 Abc_NtkObjNumMax(p->pNtk) - nObjsOld, DeptMax );
488 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
489 }
490}
ABC_DLL void Abc_NodeCollectFanouts(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
Definition abcUtil.c:1647
#define Abc_NtkForEachObjReverse(pNtk, pNode, i)
Definition abc.h:452
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition abc.h:518
ABC_INT64_T abctime
Definition abc_global.h:332
int Bus_SclCompareFanouts(Abc_Obj_t **pp1, Abc_Obj_t **pp2)
Definition sclBufSize.c:271
void Abc_NtkPrintFanoutProfileVec(Abc_Obj_t *pObj, Vec_Ptr_t *vFanouts)
Definition sclBufSize.c:245
void Abc_NtkComputeFanoutInfo(Abc_Obj_t *pObj, float Slew)
Definition sclBufSize.c:192
void Bus_SclInsertFanout(Vec_Ptr_t *vFanouts, Abc_Obj_t *pObj)
Definition sclBufSize.c:284
Abc_Obj_t * Abc_SclAddOneInv(Bus_Man_t *p, Abc_Obj_t *pObj, Vec_Ptr_t *vFanouts, float Gain)
Definition sclBufSize.c:343
float Abc_NtkComputeFanoutLoad(Bus_Man_t *p, Vec_Ptr_t *vFanouts)
Definition sclBufSize.c:223
void Abc_SclOneNodePrint(Bus_Man_t *p, Abc_Obj_t *pObj)
Definition sclBufSize.c:332
struct SC_Pair_ SC_Pair
Definition sclLib.h:69
SC_Cell * pAve
Definition sclLib.h:218
float fall
Definition sclLib.h:73
float rise
Definition sclLib.h:72
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_SclOneNodePrint()

void Abc_SclOneNodePrint ( Bus_Man_t * p,
Abc_Obj_t * pObj )

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 332 of file sclBufSize.c.

333{
334 SC_Cell * pCell = Abc_SclObjCell(pObj);
335 printf( "%s%7d : ", (Abc_ObjFaninNum(pObj) == 0) ? " Inv" : "Node", Abc_ObjId(pObj) );
336 printf( "%d/%2d ", Abc_ObjFaninNum(pObj) ? Abc_ObjFaninNum(pObj) : 1, Abc_ObjFanoutNum(pObj) );
337 printf( "%12s ", pCell->pName );
338 printf( "(%2d/%2d) ", pCell->Order, pCell->nGates );
339 printf( "gain =%5d ", (int)(100.0 * Bus_SclObjLoad(pObj) / SC_CellPinCapAve(pCell)) );
340 printf( "dept =%7.0f ps ", Bus_SclObjDept(pObj) );
341 printf( "\n" );
342}
char * pName
Definition sclLib.h:202
int nGates
Definition sclLib.h:220
int Order
Definition sclLib.h:219
Here is the caller graph for this function:

◆ Bus_ManReadInOutLoads()

void Bus_ManReadInOutLoads ( Bus_Man_t * p)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 133 of file sclBufSize.c.

134{
135 if ( Abc_FrameReadMaxLoad() )
136 {
137 Abc_Obj_t * pObj; int i;
138 float MaxLoad = Abc_FrameReadMaxLoad();
139 Abc_NtkForEachCo( p->pNtk, pObj, i )
140 Bus_SclObjSetCin( pObj, MaxLoad );
141// printf( "Default output load is specified (%f ff).\n", MaxLoad );
142 }
144 {
145 int iCell = Abc_SclCellFind( p->pLib, Abc_FrameReadDrivingCell() );
146 if ( iCell == -1 )
147 printf( "Cannot find the default PI driving cell (%s) in the library.\n", Abc_FrameReadDrivingCell() );
148 else
149 {
150// printf( "Default PI driving cell is specified (%s).\n", Abc_FrameReadDrivingCell() );
151 p->pPiDrive = SC_LibCell( p->pLib, iCell );
152 assert( p->pPiDrive != NULL );
153 assert( p->pPiDrive->n_inputs == 1 );
154// printf( "Default input driving cell is specified (%s).\n", p->pPiDrive->pName );
155 }
156 }
157}
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition abc.h:522
ABC_DLL float Abc_FrameReadMaxLoad()
Definition mainFrame.c:117
ABC_DLL char * Abc_FrameReadDrivingCell()
Definition mainFrame.c:116
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:

◆ Bus_ManStart()

Bus_Man_t * Bus_ManStart ( Abc_Ntk_t * pNtk,
SC_Lib * pLib,
SC_BusPars * pPars )

FUNCTION DEFINITIONS ///.

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 78 of file sclBufSize.c.

79{
80 Bus_Man_t * p;
81 p = ABC_CALLOC( Bus_Man_t, 1 );
82 p->pPars = pPars;
83 p->pNtk = pNtk;
84 p->pLib = pLib;
85 p->pInv = Abc_SclFindInvertor(pLib, pPars->fAddBufs)->pRepr->pPrev;//->pAve;
86 if ( pPars->fUseWireLoads )
87 {
88 if ( pNtk->pWLoadUsed == NULL )
89 {
90 p->pWLoadUsed = Abc_SclFindWireLoadModel( pLib, Abc_SclGetTotalArea(pNtk) );
91 if ( p->pWLoadUsed )
92 pNtk->pWLoadUsed = Abc_UtilStrsav( p->pWLoadUsed->pName );
93 }
94 else
95 p->pWLoadUsed = Abc_SclFetchWireLoadModel( pLib, pNtk->pWLoadUsed );
96 }
97 if ( p->pWLoadUsed )
98 p->vWireCaps = Abc_SclFindWireCaps( p->pWLoadUsed, Abc_NtkGetFanoutMax(pNtk) );
99 p->vFanouts = Vec_PtrAlloc( 100 );
100 p->vCins = Vec_FltAlloc( 2*Abc_NtkObjNumMax(pNtk) + 1000 );
101 p->vETimes = Vec_FltAlloc( 2*Abc_NtkObjNumMax(pNtk) + 1000 );
102 p->vLoads = Vec_FltAlloc( 2*Abc_NtkObjNumMax(pNtk) + 1000 );
103 p->vDepts = Vec_FltAlloc( 2*Abc_NtkObjNumMax(pNtk) + 1000 );
104 Vec_FltFill( p->vCins, Abc_NtkObjNumMax(pNtk), 0 );
105 Vec_FltFill( p->vETimes, Abc_NtkObjNumMax(pNtk), 0 );
106 Vec_FltFill( p->vLoads, Abc_NtkObjNumMax(pNtk), 0 );
107 Vec_FltFill( p->vDepts, Abc_NtkObjNumMax(pNtk), 0 );
108 pNtk->pBSMan = p;
109 return p;
110}
ABC_DLL int Abc_NtkGetFanoutMax(Abc_Ntk_t *pNtk)
Definition abcUtil.c:497
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
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
SC_Cell * Abc_SclFindInvertor(SC_Lib *p, int fFindBuff)
Definition sclLibUtil.c:332
ABC_NAMESPACE_IMPL_START Vec_Flt_t * Abc_SclFindWireCaps(SC_WireLoad *pWL, int nFanoutMax)
DECLARATIONS ///.
Definition sclLoad.c:45
char * pWLoadUsed
Definition abc.h:209
void * pBSMan
Definition abc.h:205
int fUseWireLoads
Definition sclLib.h:111
int fAddBufs
Definition sclLib.h:109
SC_Cell * pPrev
Definition sclLib.h:216
SC_Cell * pRepr
Definition sclLib.h:217
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Bus_ManStop()

void Bus_ManStop ( Bus_Man_t * p)

Definition at line 111 of file sclBufSize.c.

112{
113 Vec_PtrFreeP( &p->vFanouts );
114 Vec_FltFreeP( &p->vWireCaps );
115 Vec_FltFreeP( &p->vCins );
116 Vec_FltFreeP( &p->vETimes );
117 Vec_FltFreeP( &p->vLoads );
118 Vec_FltFreeP( &p->vDepts );
119 ABC_FREE( p );
120}
#define ABC_FREE(obj)
Definition abc_global.h:267
Here is the caller graph for this function:

◆ Bus_SclCheckSortedFanout()

void Bus_SclCheckSortedFanout ( Vec_Ptr_t * vFanouts)

Definition at line 304 of file sclBufSize.c.

305{
306 Abc_Obj_t * pObj, * pNext;
307 int i;
308 for ( i = 0; i < Vec_PtrSize(vFanouts) - 1; i++ )
309 {
310 pObj = (Abc_Obj_t *)Vec_PtrEntry(vFanouts, i);
311 pNext = (Abc_Obj_t *)Vec_PtrEntry(vFanouts, i+1);
312 if ( Bus_SclCompareFanouts( &pObj, &pNext ) != -1 )
313 {
314 printf( "Fanouts %d and %d are out of order.\n", i, i+1 );
315 Abc_NtkPrintFanoutProfileVec( NULL, vFanouts );
316 return;
317 }
318 }
319}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Bus_SclCompareFanouts()

int Bus_SclCompareFanouts ( Abc_Obj_t ** pp1,
Abc_Obj_t ** pp2 )

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

Synopsis [Compare two fanouts by their departure times.]

Description []

SideEffects []

SeeAlso []

Definition at line 271 of file sclBufSize.c.

272{
273 float Espilon = 0;//10; // 10 ps
274 if ( Bus_SclObjETime(*pp1) < Bus_SclObjETime(*pp2) - Espilon )
275 return -1;
276 if ( Bus_SclObjETime(*pp1) > Bus_SclObjETime(*pp2) + Espilon )
277 return 1;
278 if ( Bus_SclObjCin(*pp1) > Bus_SclObjCin(*pp2) )
279 return -1;
280 if ( Bus_SclObjCin(*pp1) < Bus_SclObjCin(*pp2) )
281 return 1;
282 return -1;
283}
Here is the caller graph for this function:

◆ Bus_SclInsertFanout()

void Bus_SclInsertFanout ( Vec_Ptr_t * vFanouts,
Abc_Obj_t * pObj )

Definition at line 284 of file sclBufSize.c.

285{
286 Abc_Obj_t * pCur;
287 int i, k;
288 // compact array
289 for ( i = k = 0; i < Vec_PtrSize(vFanouts); i++ )
290 if ( Vec_PtrEntry(vFanouts, i) != NULL )
291 Vec_PtrWriteEntry( vFanouts, k++, Vec_PtrEntry(vFanouts, i) );
292 Vec_PtrShrink( vFanouts, k );
293 // insert new entry
294 Vec_PtrPush( vFanouts, pObj );
295 for ( i = Vec_PtrSize(vFanouts) - 1; i > 0; i-- )
296 {
297 pCur = (Abc_Obj_t *)Vec_PtrEntry(vFanouts, i-1);
298 pObj = (Abc_Obj_t *)Vec_PtrEntry(vFanouts, i);
299 if ( Bus_SclCompareFanouts( &pCur, &pObj ) == -1 )
300 break;
301 ABC_SWAP( void *, Vec_PtrArray(vFanouts)[i-1], Vec_PtrArray(vFanouts)[i] );
302 }
303}
#define ABC_SWAP(Type, a, b)
Definition abc_global.h:253
Here is the call graph for this function:
Here is the caller graph for this function: