abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
sclSize.c File Reference
#include "sclSize.h"
#include "map/mio/mio.h"
#include "misc/vec/vecWec.h"
#include "base/main/main.h"

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START
Abc_Obj_t
Abc_SclFindCriticalCo (SC_Man *p, int *pfRise)
 DECLARATIONS ///. More...
 
Abc_Obj_tAbc_SclFindMostCriticalFanin2 (SC_Man *p, int *pfRise, Abc_Obj_t *pNode)
 
Abc_Obj_tAbc_SclFindMostCriticalFanin (SC_Man *p, int *pfRise, Abc_Obj_t *pNode)
 
static void Abc_SclTimeNodePrint (SC_Man *p, Abc_Obj_t *pObj, int fRise, int Length, float maxDelay)
 
void Abc_SclTimeNtkPrint (SC_Man *p, int fShowAll, int fPrintPath)
 
static void Abc_SclTimeFanin (SC_Man *p, SC_Timing *pTime, Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
 
static void Abc_SclDeptFanin (SC_Man *p, SC_Timing *pTime, Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
 
static void Abc_SclDeptObj (SC_Man *p, Abc_Obj_t *pObj)
 
static float Abc_SclObjLoadValue (SC_Man *p, Abc_Obj_t *pObj)
 
static void Abc_SclTimeCi (SC_Man *p, Abc_Obj_t *pObj)
 
void Abc_SclTimeNode (SC_Man *p, Abc_Obj_t *pObj, int fDept)
 
void Abc_SclTimeCone (SC_Man *p, Vec_Int_t *vCone)
 
void Abc_SclTimeNtkRecompute (SC_Man *p, float *pArea, float *pDelay, int fReverse, float DUser)
 
static void Abc_SclTimeIncUpdateClean (SC_Man *p)
 
static void Abc_SclTimeIncAddNode (SC_Man *p, Abc_Obj_t *pObj)
 
static void Abc_SclTimeIncAddFanins (SC_Man *p, Abc_Obj_t *pObj)
 
static void Abc_SclTimeIncAddFanouts (SC_Man *p, Abc_Obj_t *pObj)
 
static void Abc_SclTimeIncUpdateArrival (SC_Man *p)
 
static void Abc_SclTimeIncUpdateDeparture (SC_Man *p)
 
void Abc_SclTimeIncCheckLevel (Abc_Ntk_t *pNtk)
 
int Abc_SclTimeIncUpdate (SC_Man *p)
 
void Abc_SclTimeIncInsert (SC_Man *p, Abc_Obj_t *pObj)
 
void Abc_SclTimeIncUpdateLevel_rec (Abc_Obj_t *pObj)
 
void Abc_SclTimeIncUpdateLevel (Abc_Obj_t *pObj)
 
void Abc_SclManReadSlewAndLoad (SC_Man *p, Abc_Ntk_t *pNtk)
 
SC_ManAbc_SclManStart (SC_Lib *pLib, Abc_Ntk_t *pNtk, int fUseWireLoads, int fDept, float DUser, int nTreeCRatio)
 
void Abc_SclTimePerform (SC_Lib *pLib, Abc_Ntk_t *pNtk, int nTreeCRatio, int fUseWireLoads, int fShowAll, int fPrintPath, int fDumpStats)
 
int Abc_SclCheckCommonInputs (Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
 
void Abc_SclPrintFaninPairs (SC_Man *p, Abc_Ntk_t *pNtk)
 
static int Abc_ObjIsBuffer (Abc_Obj_t *pObj)
 
int Abc_SclHasBufferFanout (Abc_Obj_t *pObj)
 
int Abc_SclCountBufferFanoutsInt (Abc_Obj_t *pObj)
 
int Abc_SclCountBufferFanouts (Abc_Obj_t *pObj)
 
int Abc_SclCountNonBufferFanoutsInt (Abc_Obj_t *pObj)
 
int Abc_SclCountNonBufferFanouts (Abc_Obj_t *pObj)
 
float Abc_SclCountNonBufferDelayInt (SC_Man *p, Abc_Obj_t *pObj)
 
float Abc_SclCountNonBufferDelay (SC_Man *p, Abc_Obj_t *pObj)
 
float Abc_SclCountNonBufferLoadInt (SC_Man *p, Abc_Obj_t *pObj)
 
float Abc_SclCountNonBufferLoad (SC_Man *p, Abc_Obj_t *pObj)
 
void Abc_SclPrintBuffersOne (SC_Man *p, Abc_Obj_t *pObj, int nOffset)
 
void Abc_SclPrintBuffersInt (SC_Man *p, Abc_Obj_t *pObj, int nOffset)
 
void Abc_SclPrintBufferTrees (SC_Man *p, Abc_Ntk_t *pNtk)
 
void Abc_SclPrintBuffers (SC_Lib *pLib, Abc_Ntk_t *pNtk, int fVerbose)
 

Function Documentation

static int Abc_ObjIsBuffer ( Abc_Obj_t pObj)
inlinestatic

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

Synopsis [Printing out buffer information.]

Description []

SideEffects []

SeeAlso []

Definition at line 737 of file sclSize.c.

737 { return Abc_ObjIsNode(pObj) && Abc_ObjFaninNum(pObj) == 1; }
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Definition: abc.h:364
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
int Abc_SclCheckCommonInputs ( Abc_Obj_t pObj,
Abc_Obj_t pFanin 
)

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

Synopsis [Printing out fanin information.]

Description []

SideEffects []

SeeAlso []

Definition at line 694 of file sclSize.c.

695 {
696  Abc_Obj_t * pTemp;
697  int i;
698  Abc_ObjForEachFanin( pObj, pTemp, i )
699  if ( Abc_NodeFindFanin( pFanin, pTemp ) >= 0 )
700  {
701  printf( "Node %d and its fanin %d have common fanin %d.\n", Abc_ObjId(pObj), Abc_ObjId(pFanin), Abc_ObjId(pTemp) );
702 
703  printf( "%-16s : ", Mio_GateReadName((Mio_Gate_t *)pObj->pData) );
704  Abc_ObjPrint( stdout, pObj );
705 
706  printf( "%-16s : ", Mio_GateReadName((Mio_Gate_t *)pFanin->pData) );
707  Abc_ObjPrint( stdout, pFanin );
708 
709  if ( pTemp->pData )
710  printf( "%-16s : ", Mio_GateReadName((Mio_Gate_t *)pTemp->pData) );
711  Abc_ObjPrint( stdout, pTemp );
712  return 1;
713  }
714  return 0;
715 }
static unsigned Abc_ObjId(Abc_Obj_t *pObj)
Definition: abc.h:329
ABC_DLL void Abc_ObjPrint(FILE *pFile, Abc_Obj_t *pObj)
Definition: abcPrint.c:1287
ABC_DLL int Abc_NodeFindFanin(Abc_Obj_t *pNode, Abc_Obj_t *pFanin)
Definition: abcUtil.c:758
if(last==0)
Definition: sparse_int.h:34
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition: abc.h:524
void * pData
Definition: abc.h:145
char * Mio_GateReadName(Mio_Gate_t *pGate)
Definition: mioApi.c:143
int Abc_SclCountBufferFanouts ( Abc_Obj_t pObj)

Definition at line 756 of file sclSize.c.

757 {
758  return Abc_SclCountBufferFanoutsInt(pObj) - Abc_ObjIsBuffer(pObj);
759 }
static int Abc_ObjIsBuffer(Abc_Obj_t *pObj)
Definition: sclSize.c:737
int Abc_SclCountBufferFanoutsInt(Abc_Obj_t *pObj)
Definition: sclSize.c:747
int Abc_SclCountBufferFanoutsInt ( Abc_Obj_t pObj)

Definition at line 747 of file sclSize.c.

748 {
749  Abc_Obj_t * pFanout;
750  int i, Counter = 0;
751  Abc_ObjForEachFanout( pObj, pFanout, i )
752  if ( Abc_ObjIsBuffer(pFanout) )
753  Counter += Abc_SclCountBufferFanoutsInt( pFanout );
754  return Counter + Abc_ObjIsBuffer(pObj);
755 }
static int Abc_ObjIsBuffer(Abc_Obj_t *pObj)
Definition: sclSize.c:737
if(last==0)
Definition: sparse_int.h:34
static int Counter
int Abc_SclCountBufferFanoutsInt(Abc_Obj_t *pObj)
Definition: sclSize.c:747
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition: abc.h:526
float Abc_SclCountNonBufferDelay ( SC_Man p,
Abc_Obj_t pObj 
)

Definition at line 789 of file sclSize.c.

790 {
791  Abc_Obj_t * pFanout;
792  float Delay = 0;
793  int i;
794  Abc_ObjForEachFanout( pObj, pFanout, i )
795  Delay += Abc_SclCountNonBufferDelayInt( p, pFanout );
796  return Delay;
797 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
float Abc_SclCountNonBufferDelayInt(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.c:778
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition: abc.h:526
float Abc_SclCountNonBufferDelayInt ( SC_Man p,
Abc_Obj_t pObj 
)

Definition at line 778 of file sclSize.c.

779 {
780  Abc_Obj_t * pFanout;
781  float Delay = 0;
782  int i;
783  if ( !Abc_ObjIsBuffer(pObj) )
784  return Abc_SclObjTimeMax(p, pObj);
785  Abc_ObjForEachFanout( pObj, pFanout, i )
786  Delay += Abc_SclCountNonBufferDelayInt( p, pFanout );
787  return Delay;
788 }
static int Abc_ObjIsBuffer(Abc_Obj_t *pObj)
Definition: sclSize.c:737
static Llb_Mgr_t * p
Definition: llb3Image.c:950
float Abc_SclCountNonBufferDelayInt(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.c:778
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition: abc.h:526
static float Abc_SclObjTimeMax(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:121
int Abc_SclCountNonBufferFanouts ( Abc_Obj_t pObj)

Definition at line 770 of file sclSize.c.

771 {
772  Abc_Obj_t * pFanout;
773  int i, Counter = 0;
774  Abc_ObjForEachFanout( pObj, pFanout, i )
775  Counter += Abc_SclCountNonBufferFanoutsInt( pFanout );
776  return Counter;
777 }
static int Counter
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition: abc.h:526
int Abc_SclCountNonBufferFanoutsInt(Abc_Obj_t *pObj)
Definition: sclSize.c:760
int Abc_SclCountNonBufferFanoutsInt ( Abc_Obj_t pObj)

Definition at line 760 of file sclSize.c.

761 {
762  Abc_Obj_t * pFanout;
763  int i, Counter = 0;
764  if ( !Abc_ObjIsBuffer(pObj) )
765  return 1;
766  Abc_ObjForEachFanout( pObj, pFanout, i )
767  Counter += Abc_SclCountNonBufferFanoutsInt( pFanout );
768  return Counter;
769 }
static int Abc_ObjIsBuffer(Abc_Obj_t *pObj)
Definition: sclSize.c:737
static int Counter
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition: abc.h:526
int Abc_SclCountNonBufferFanoutsInt(Abc_Obj_t *pObj)
Definition: sclSize.c:760
float Abc_SclCountNonBufferLoad ( SC_Man p,
Abc_Obj_t pObj 
)

Definition at line 811 of file sclSize.c.

812 {
813  Abc_Obj_t * pFanout;
814  float Load = 0;
815  int i;
816  Abc_ObjForEachFanout( pObj, pFanout, i )
817  Load += Abc_SclCountNonBufferLoadInt( p, pFanout );
818  Load += 0.5 * Abc_SclObjLoad(p, pObj)->rise + 0.5 * Abc_SclObjLoad(p, pObj)->fall;
819  return Load;
820 }
static SC_Pair * Abc_SclObjLoad(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:113
static Llb_Mgr_t * p
Definition: llb3Image.c:950
float Abc_SclCountNonBufferLoadInt(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.c:798
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition: abc.h:526
float Abc_SclCountNonBufferLoadInt ( SC_Man p,
Abc_Obj_t pObj 
)

Definition at line 798 of file sclSize.c.

799 {
800  Abc_Obj_t * pFanout;
801  float Load = 0;
802  int i;
803  if ( !Abc_ObjIsBuffer(pObj) )
804  return 0;
805  Abc_ObjForEachFanout( pObj, pFanout, i )
806  Load += Abc_SclCountNonBufferLoadInt( p, pFanout );
807  Load += 0.5 * Abc_SclObjLoad(p, pObj)->rise + 0.5 * Abc_SclObjLoad(p, pObj)->fall;
808  Load -= 0.5 * SC_CellPin(Abc_SclObjCell(pObj), 0)->rise_cap + 0.5 * SC_CellPin(Abc_SclObjCell(pObj), 0)->fall_cap;
809  return Load;
810 }
static int Abc_ObjIsBuffer(Abc_Obj_t *pObj)
Definition: sclSize.c:737
static SC_Pair * Abc_SclObjLoad(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:113
static Llb_Mgr_t * p
Definition: llb3Image.c:950
float Abc_SclCountNonBufferLoadInt(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.c:798
static SC_Pin * SC_CellPin(SC_Cell *p, int i)
Definition: sclLib.h:241
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition: abc.h:526
static SC_Cell * Abc_SclObjCell(Abc_Obj_t *p)
Definition: sclSize.h:110
static void Abc_SclDeptFanin ( SC_Man p,
SC_Timing pTime,
Abc_Obj_t pObj,
Abc_Obj_t pFanin 
)
inlinestatic

Definition at line 271 of file sclSize.c.

272 {
273  SC_Pair * pDepIn = Abc_SclObjDept( p, pFanin ); // modified
274  SC_Pair * pSlewIn = Abc_SclObjSlew( p, pFanin );
275  SC_Pair * pLoad = Abc_SclObjLoad( p, pObj );
276  SC_Pair * pDepOut = Abc_SclObjDept( p, pObj );
277  Scl_LibPinDeparture( pTime, pDepIn, pSlewIn, pLoad, pDepOut );
278 }
static SC_Pair * Abc_SclObjDept(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:114
static SC_Pair * Abc_SclObjLoad(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:113
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Scl_LibPinDeparture(SC_Timing *pTime, SC_Pair *pDepIn, SC_Pair *pSlewIn, SC_Pair *pLoad, SC_Pair *pDepOut)
Definition: sclLib.h:540
static SC_Pair * Abc_SclObjSlew(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:116
static void Abc_SclDeptObj ( SC_Man p,
Abc_Obj_t pObj 
)
inlinestatic

Definition at line 279 of file sclSize.c.

280 {
281  SC_Timing * pTime;
282  Abc_Obj_t * pFanout;
283  int i;
284  SC_PairClean( Abc_SclObjDept(p, pObj) );
285  Abc_ObjForEachFanout( pObj, pFanout, i )
286  {
287  if ( Abc_ObjIsCo(pFanout) || Abc_ObjIsLatch(pFanout) )
288  continue;
289  pTime = Scl_CellPinTime( Abc_SclObjCell(pFanout), Abc_NodeFindFanin(pFanout, pObj) );
290  Abc_SclDeptFanin( p, pTime, pFanout, pObj );
291  }
292 }
static SC_Pair * Abc_SclObjDept(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:114
static SC_Timing * Scl_CellPinTime(SC_Cell *pCell, int iPin)
Definition: sclLib.h:565
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Abc_ObjIsLatch(Abc_Obj_t *pObj)
Definition: abc.h:356
ABC_DLL int Abc_NodeFindFanin(Abc_Obj_t *pNode, Abc_Obj_t *pFanin)
Definition: abcUtil.c:758
static int Abc_ObjIsCo(Abc_Obj_t *pObj)
Definition: abc.h:352
static void SC_PairClean(SC_Pair *d)
GLOBAL VARIABLES ///.
Definition: sclLib.h:229
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition: abc.h:526
static void Abc_SclDeptFanin(SC_Man *p, SC_Timing *pTime, Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition: sclSize.c:271
static SC_Cell * Abc_SclObjCell(Abc_Obj_t *p)
Definition: sclSize.h:110
ABC_NAMESPACE_IMPL_START Abc_Obj_t* Abc_SclFindCriticalCo ( SC_Man p,
int *  pfRise 
)

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 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition: abc.h:519
static SC_Pair * Abc_SclObjTime(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:115
float rise
Definition: sclLib.h:65
float fall
Definition: sclLib.h:66
static Abc_Obj_t * Abc_NtkPo(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:316
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
#define assert(ex)
Definition: util_old.h:213
Abc_Obj_t* Abc_SclFindMostCriticalFanin ( SC_Man p,
int *  pfRise,
Abc_Obj_t pNode 
)

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 }
static float Abc_SclObjGetSlack(SC_Man *p, Abc_Obj_t *pObj, float D)
Definition: sclSize.h:125
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static SC_Pair * Abc_SclObjTime(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:115
float rise
Definition: sclLib.h:65
float fall
Definition: sclLib.h:66
if(last==0)
Definition: sparse_int.h:34
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition: abc.h:524
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition: abc_global.h:216
Abc_Obj_t* Abc_SclFindMostCriticalFanin2 ( SC_Man p,
int *  pfRise,
Abc_Obj_t pNode 
)

Definition at line 70 of file sclSize.c.

71 {
72  Abc_Obj_t * pFanin, * pPivot = NULL;
73  float fMaxArr = 0;
74  int i;
75  Abc_ObjForEachFanin( pNode, pFanin, i )
76  {
77  SC_Pair * pArr = Abc_SclObjTime( p, pFanin );
78  if ( fMaxArr < pArr->rise ) fMaxArr = pArr->rise, *pfRise = 1, pPivot = pFanin;
79  if ( fMaxArr < pArr->fall ) fMaxArr = pArr->fall, *pfRise = 0, pPivot = pFanin;
80  }
81  return pPivot;
82 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static SC_Pair * Abc_SclObjTime(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:115
float rise
Definition: sclLib.h:65
float fall
Definition: sclLib.h:66
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition: abc.h:524
int Abc_SclHasBufferFanout ( Abc_Obj_t pObj)

Definition at line 738 of file sclSize.c.

739 {
740  Abc_Obj_t * pFanout;
741  int i;
742  Abc_ObjForEachFanout( pObj, pFanout, i )
743  if ( Abc_ObjIsBuffer(pFanout) )
744  return 1;
745  return 0;
746 }
static int Abc_ObjIsBuffer(Abc_Obj_t *pObj)
Definition: sclSize.c:737
if(last==0)
Definition: sparse_int.h:34
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition: abc.h:526
void Abc_SclManReadSlewAndLoad ( SC_Man p,
Abc_Ntk_t pNtk 
)

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

Synopsis [Read input slew and output load.]

Description []

SideEffects []

SeeAlso []

Definition at line 594 of file sclSize.c.

595 {
596  if ( Abc_FrameReadMaxLoad() )
597  {
598  Abc_Obj_t * pObj; int i;
599  float MaxLoad = Abc_FrameReadMaxLoad();
600 // printf( "Default output load is specified (%.2f ff).\n", MaxLoad );
601  Abc_NtkForEachPo( pNtk, pObj, i )
602  {
603  SC_Pair * pLoad = Abc_SclObjLoad( p, pObj );
604  pLoad->rise = pLoad->fall = MaxLoad;
605  }
606  }
607  if ( Abc_FrameReadDrivingCell() )
608  {
609  int iCell = Abc_SclCellFind( p->pLib, Abc_FrameReadDrivingCell() );
610  if ( iCell == -1 )
611  printf( "Cannot find the default PI driving cell (%s) in the library.\n", Abc_FrameReadDrivingCell() );
612  else
613  {
614 // printf( "Default PI driving cell is specified (%s).\n", Abc_FrameReadDrivingCell() );
615  p->pPiDrive = SC_LibCell( p->pLib, iCell );
616  assert( p->pPiDrive != NULL );
617  assert( p->pPiDrive->n_inputs == 1 );
618  }
619  }
620 }
ABC_DLL float Abc_FrameReadMaxLoad()
Definition: mainFrame.c:98
ABC_DLL char * Abc_FrameReadDrivingCell()
Definition: mainFrame.c:97
static SC_Pair * Abc_SclObjLoad(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:113
static Llb_Mgr_t * p
Definition: llb3Image.c:950
float rise
Definition: sclLib.h:65
float fall
Definition: sclLib.h:66
static SC_Cell * SC_LibCell(SC_Lib *p, int i)
Definition: sclLib.h:240
int Abc_SclCellFind(SC_Lib *p, char *pName)
Definition: sclLibUtil.c:79
#define assert(ex)
Definition: util_old.h:213
#define Abc_NtkForEachPo(pNtk, pPo, i)
Definition: abc.h:517
SC_Man* Abc_SclManStart ( SC_Lib pLib,
Abc_Ntk_t pNtk,
int  fUseWireLoads,
int  fDept,
float  DUser,
int  nTreeCRatio 
)

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

Synopsis [Prepare timing manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 633 of file sclSize.c.

634 {
635  SC_Man * p = Abc_SclManAlloc( pLib, pNtk );
636  if ( nTreeCRatio )
637  {
638  p->EstLoadMax = 0.01 * nTreeCRatio; // max ratio of Cout/Cave when the estimation is used
639  p->EstLinear = 100; // linear coefficient
640  }
641  Abc_SclMioGates2SclGates( pLib, pNtk );
642  Abc_SclManReadSlewAndLoad( p, pNtk );
643  if ( fUseWireLoads )
644  {
645  if ( pNtk->pWLoadUsed == NULL )
646  {
647  p->pWLoadUsed = Abc_SclFindWireLoadModel( pLib, Abc_SclGetTotalArea(p->pNtk) );
648  if ( p->pWLoadUsed )
649  pNtk->pWLoadUsed = Abc_UtilStrsav( p->pWLoadUsed->pName );
650  }
651  else
652  p->pWLoadUsed = Abc_SclFetchWireLoadModel( pLib, pNtk->pWLoadUsed );
653  }
654  Abc_SclTimeNtkRecompute( p, &p->SumArea0, &p->MaxDelay0, fDept, DUser );
655  p->SumArea = p->SumArea0;
656  p->MaxDelay = p->MaxDelay0;
657  return p;
658 }
void Abc_SclTimeNtkRecompute(SC_Man *p, float *pArea, float *pDelay, int fReverse, float DUser)
Definition: sclSize.c:400
static SC_Man * Abc_SclManAlloc(SC_Lib *pLib, Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: sclSize.h:147
void Abc_SclManReadSlewAndLoad(SC_Man *p, Abc_Ntk_t *pNtk)
Definition: sclSize.c:594
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_HEADER_START struct SC_Man_ SC_Man
INCLUDES ///.
Definition: sclSize.h:44
static float Abc_SclGetTotalArea(Abc_Ntk_t *pNtk)
Definition: sclSize.h:446
SC_WireLoad * Abc_SclFindWireLoadModel(SC_Lib *p, float Area)
Definition: sclLibUtil.c:247
void Abc_SclMioGates2SclGates(SC_Lib *pLib, Abc_Ntk_t *p)
DECLARATIONS ///.
Definition: sclUtil.c:47
SC_WireLoad * Abc_SclFetchWireLoadModel(SC_Lib *p, char *pName)
Definition: sclLibUtil.c:230
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
char * pWLoadUsed
Definition: abc.h:209
static float Abc_SclObjLoadValue ( SC_Man p,
Abc_Obj_t pObj 
)
inlinestatic

Definition at line 293 of file sclSize.c.

294 {
295 // float Value = Abc_MaxFloat(pLoad->fall, pLoad->rise) / (p->EstLoadAve * p->EstLoadMax);
296  return (0.5 * Abc_SclObjLoad(p, pObj)->fall + 0.5 * Abc_SclObjLoad(p, pObj)->rise) / (p->EstLoadAve * p->EstLoadMax);
297 }
static SC_Pair * Abc_SclObjLoad(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:113
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Abc_SclPrintBuffers ( SC_Lib pLib,
Abc_Ntk_t pNtk,
int  fVerbose 
)

Definition at line 876 of file sclSize.c.

877 {
878  int fUseWireLoads = 0;
879  SC_Man * p;
880  assert( Abc_NtkIsMappedLogic(pNtk) );
881  p = Abc_SclManStart( pLib, pNtk, fUseWireLoads, 1, 0, 10000 );
882  Abc_SclPrintBufferTrees( p, pNtk );
883 // Abc_SclPrintFaninPairs( p, pNtk );
884  Abc_SclManFree( p );
885 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_HEADER_START struct SC_Man_ SC_Man
INCLUDES ///.
Definition: sclSize.h:44
static void Abc_SclManFree(SC_Man *p)
Definition: sclSize.h:192
static int Abc_NtkIsMappedLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:267
void Abc_SclPrintBufferTrees(SC_Man *p, Abc_Ntk_t *pNtk)
Definition: sclSize.c:860
#define assert(ex)
Definition: util_old.h:213
SC_Man * Abc_SclManStart(SC_Lib *pLib, Abc_Ntk_t *pNtk, int fUseWireLoads, int fDept, float DUser, int nTreeCRatio)
Definition: sclSize.c:633
void Abc_SclPrintBuffersInt ( SC_Man p,
Abc_Obj_t pObj,
int  nOffset 
)

Definition at line 850 of file sclSize.c.

851 {
852  Abc_Obj_t * pFanout;
853  int i;
854  Abc_SclPrintBuffersOne( p, pObj, nOffset );
855  assert( Abc_ObjIsBuffer(pObj) );
856  Abc_ObjForEachFanout( pObj, pFanout, i )
857  if ( Abc_ObjIsBuffer(pFanout) )
858  Abc_SclPrintBuffersInt( p, pFanout, nOffset + 1 );
859 }
static int Abc_ObjIsBuffer(Abc_Obj_t *pObj)
Definition: sclSize.c:737
static Llb_Mgr_t * p
Definition: llb3Image.c:950
if(last==0)
Definition: sparse_int.h:34
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition: abc.h:526
#define assert(ex)
Definition: util_old.h:213
void Abc_SclPrintBuffersInt(SC_Man *p, Abc_Obj_t *pObj, int nOffset)
Definition: sclSize.c:850
void Abc_SclPrintBuffersOne(SC_Man *p, Abc_Obj_t *pObj, int nOffset)
Definition: sclSize.c:821
void Abc_SclPrintBuffersOne ( SC_Man p,
Abc_Obj_t pObj,
int  nOffset 
)

Definition at line 821 of file sclSize.c.

822 {
823  int i;
824  for ( i = 0; i < nOffset; i++ )
825  printf( " " );
826  printf( "%6d: %-16s (%2d:%3d:%3d) ",
827  Abc_ObjId(pObj),
828  Abc_ObjIsPi(pObj) ? "pi" : Mio_GateReadName((Mio_Gate_t *)pObj->pData),
829  Abc_ObjFanoutNum(pObj),
832  for ( ; i < 4; i++ )
833  printf( " " );
834  printf( "a =%5.2f ", Abc_ObjIsPi(pObj) ? 0 : Abc_SclObjCell(pObj)->area );
835  printf( "d = (" );
836  printf( "%6.0f ps; ", Abc_SclObjTimeOne(p, pObj, 1) );
837  printf( "%6.0f ps) ", Abc_SclObjTimeOne(p, pObj, 0) );
838  printf( "l =%5.0f ff ", Abc_SclObjLoadMax(p, pObj) );
839  printf( "s =%5.0f ps ", Abc_SclObjSlewMax(p, pObj) );
840  printf( "sl =%5.0f ps ", Abc_SclObjSlackMax(p, pObj, p->MaxDelay0) );
841  if ( nOffset == 0 )
842  {
843  printf( "L =%5.0f ff ", Abc_SclCountNonBufferLoad(p, pObj) );
844  printf( "Lx =%5.0f ff ", 100.0*Abc_SclCountNonBufferLoad(p, pObj)/p->EstLoadAve );
845  printf( "Dx =%5.0f ps ", Abc_SclCountNonBufferDelay(p, pObj)/Abc_SclCountNonBufferFanouts(pObj) - Abc_SclObjTimeOne(p, pObj, 1) );
846  printf( "Cx =%5.0f ps", (Abc_SclCountNonBufferDelay(p, pObj)/Abc_SclCountNonBufferFanouts(pObj) - Abc_SclObjTimeOne(p, pObj, 1))/log(Abc_SclCountNonBufferLoad(p, pObj)/p->EstLoadAve) );
847  }
848  printf( "\n" );
849 }
static unsigned Abc_ObjId(Abc_Obj_t *pObj)
Definition: abc.h:329
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Abc_ObjFanoutNum(Abc_Obj_t *pObj)
Definition: abc.h:365
static int Abc_ObjIsPi(Abc_Obj_t *pObj)
Definition: abc.h:347
static double Abc_SclObjTimeOne(SC_Man *p, Abc_Obj_t *pObj, int fRise)
Definition: sclSize.h:120
float Abc_SclCountNonBufferLoad(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.c:811
float Abc_SclCountNonBufferDelay(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.c:789
static double Abc_SclObjSlewMax(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:122
int Abc_SclCountBufferFanouts(Abc_Obj_t *pObj)
Definition: sclSize.c:756
int Abc_SclCountNonBufferFanouts(Abc_Obj_t *pObj)
Definition: sclSize.c:770
static double Abc_SclObjSlackMax(SC_Man *p, Abc_Obj_t *pObj, float D)
Definition: sclSize.h:126
void * pData
Definition: abc.h:145
char * Mio_GateReadName(Mio_Gate_t *pGate)
Definition: mioApi.c:143
static double Abc_SclObjLoadMax(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:118
static SC_Cell * Abc_SclObjCell(Abc_Obj_t *p)
Definition: sclSize.h:110
void Abc_SclPrintBufferTrees ( SC_Man p,
Abc_Ntk_t pNtk 
)

Definition at line 860 of file sclSize.c.

861 {
862  Abc_Obj_t * pObj, * pFanout;
863  int i, k;
864  Abc_NtkForEachObj( pNtk, pObj, i )
865  {
866  if ( !Abc_ObjIsBuffer(pObj) && Abc_SclCountBufferFanouts(pObj) > 3 )
867  {
868  Abc_SclPrintBuffersOne( p, pObj, 0 );
869  Abc_ObjForEachFanout( pObj, pFanout, k )
870  if ( Abc_ObjIsBuffer(pFanout) )
871  Abc_SclPrintBuffersInt( p, pFanout, 1 );
872  printf( "\n" );
873  }
874  }
875 }
static int Abc_ObjIsBuffer(Abc_Obj_t *pObj)
Definition: sclSize.c:737
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int Abc_SclCountBufferFanouts(Abc_Obj_t *pObj)
Definition: sclSize.c:756
if(last==0)
Definition: sparse_int.h:34
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition: abc.h:526
#define Abc_NtkForEachObj(pNtk, pObj, i)
ITERATORS ///.
Definition: abc.h:446
void Abc_SclPrintBuffersInt(SC_Man *p, Abc_Obj_t *pObj, int nOffset)
Definition: sclSize.c:850
void Abc_SclPrintBuffersOne(SC_Man *p, Abc_Obj_t *pObj, int nOffset)
Definition: sclSize.c:821
void Abc_SclPrintFaninPairs ( SC_Man p,
Abc_Ntk_t pNtk 
)

Definition at line 716 of file sclSize.c.

717 {
718  Abc_Obj_t * pObj, * pFanin;
719  int i, k;
720  Abc_NtkForEachNode( pNtk, pObj, i )
721  Abc_ObjForEachFanin( pObj, pFanin, k )
722  if ( Abc_ObjIsNode(pFanin) && Abc_ObjFanoutNum(pFanin) == 1 )
723  Abc_SclCheckCommonInputs( pObj, pFanin );
724 }
static int Abc_ObjFanoutNum(Abc_Obj_t *pObj)
Definition: abc.h:365
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
int Abc_SclCheckCommonInputs(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition: sclSize.c:694
if(last==0)
Definition: sparse_int.h:34
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition: abc.h:461
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition: abc.h:524
static void Abc_SclTimeCi ( SC_Man p,
Abc_Obj_t pObj 
)
inlinestatic

Definition at line 298 of file sclSize.c.

299 {
300  if ( p->pPiDrive != NULL )
301  {
302  SC_Pair * pLoad = Abc_SclObjLoad( p, pObj );
303  SC_Pair * pTime = Abc_SclObjTime( p, pObj );
304  SC_Pair * pSlew = Abc_SclObjSlew( p, pObj );
305  Scl_LibHandleInputDriver( p->pPiDrive, pLoad, pTime, pSlew );
306  }
307 }
static SC_Pair * Abc_SclObjLoad(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:113
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static SC_Pair * Abc_SclObjTime(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:115
static SC_Pair * Abc_SclObjSlew(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:116
static void Scl_LibHandleInputDriver(SC_Cell *pCell, SC_Pair *pLoadIn, SC_Pair *pArrOut, SC_Pair *pSlewOut)
Definition: sclLib.h:591
void Abc_SclTimeCone ( SC_Man p,
Vec_Int_t vCone 
)

Definition at line 383 of file sclSize.c.

384 {
385  int fVerbose = 0;
386  Abc_Obj_t * pObj;
387  int i;
388  Abc_SclConeClean( p, vCone );
389  Abc_NtkForEachObjVec( vCone, p->pNtk, pObj, i )
390  {
391  if ( fVerbose && Abc_ObjIsNode(pObj) )
392  printf( " Updating node %d with gate %s\n", Abc_ObjId(pObj), Abc_SclObjCell(pObj)->pName );
393  if ( fVerbose && Abc_ObjIsNode(pObj) )
394  printf( " before (%6.1f ps %6.1f ps) ", Abc_SclObjTimeOne(p, pObj, 1), Abc_SclObjTimeOne(p, pObj, 0) );
395  Abc_SclTimeNode( p, pObj, 0 );
396  if ( fVerbose && Abc_ObjIsNode(pObj) )
397  printf( "after (%6.1f ps %6.1f ps)\n", Abc_SclObjTimeOne(p, pObj, 1), Abc_SclObjTimeOne(p, pObj, 0) );
398  }
399 }
static unsigned Abc_ObjId(Abc_Obj_t *pObj)
Definition: abc.h:329
void Abc_SclTimeNode(SC_Man *p, Abc_Obj_t *pObj, int fDept)
Definition: sclSize.c:308
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static double Abc_SclObjTimeOne(SC_Man *p, Abc_Obj_t *pObj, int fRise)
Definition: sclSize.h:120
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
static void Abc_SclConeClean(SC_Man *p, Vec_Int_t *vCone)
Definition: sclSize.h:406
#define Abc_NtkForEachObjVec(vIds, pNtk, pObj, i)
Definition: abc.h:452
static SC_Cell * Abc_SclObjCell(Abc_Obj_t *p)
Definition: sclSize.h:110
static void Abc_SclTimeFanin ( SC_Man p,
SC_Timing pTime,
Abc_Obj_t pObj,
Abc_Obj_t pFanin 
)
inlinestatic

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

Synopsis [Timing computation for pin/gate/cone/network.]

Description []

SideEffects []

SeeAlso []

Definition at line 262 of file sclSize.c.

263 {
264  SC_Pair * pArrIn = Abc_SclObjTime( p, pFanin );
265  SC_Pair * pSlewIn = Abc_SclObjSlew( p, pFanin );
266  SC_Pair * pLoad = Abc_SclObjLoad( p, pObj );
267  SC_Pair * pArrOut = Abc_SclObjTime( p, pObj ); // modified
268  SC_Pair * pSlewOut = Abc_SclObjSlew( p, pObj ); // modified
269  Scl_LibPinArrival( pTime, pArrIn, pSlewIn, pLoad, pArrOut, pSlewOut );
270 }
static SC_Pair * Abc_SclObjLoad(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:113
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static SC_Pair * Abc_SclObjTime(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:115
static SC_Pair * Abc_SclObjSlew(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:116
static void Scl_LibPinArrival(SC_Timing *pTime, SC_Pair *pArrIn, SC_Pair *pSlewIn, SC_Pair *pLoad, SC_Pair *pArrOut, SC_Pair *pSlewOut)
Definition: sclLib.h:523
static void Abc_SclTimeIncAddFanins ( SC_Man p,
Abc_Obj_t pObj 
)
inlinestatic

Definition at line 463 of file sclSize.c.

464 {
465  Abc_Obj_t * pFanin;
466  int i;
467  Abc_ObjForEachFanin( pObj, pFanin, i )
468 // if ( !pFanin->fMarkC && Abc_ObjIsNode(pFanin) )
469  if ( !pFanin->fMarkC && !Abc_ObjIsLatch(pFanin) )
470  Abc_SclTimeIncAddNode( p, pFanin );
471 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Abc_ObjIsLatch(Abc_Obj_t *pObj)
Definition: abc.h:356
if(last==0)
Definition: sparse_int.h:34
static void Abc_SclTimeIncAddNode(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.c:455
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition: abc.h:524
static void Abc_SclTimeIncAddFanouts ( SC_Man p,
Abc_Obj_t pObj 
)
inlinestatic

Definition at line 472 of file sclSize.c.

473 {
474  Abc_Obj_t * pFanout;
475  int i;
476  Abc_ObjForEachFanout( pObj, pFanout, i )
477  if ( !pFanout->fMarkC && !Abc_ObjIsLatch(pFanout) )
478  Abc_SclTimeIncAddNode( p, pFanout );
479 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Abc_ObjIsLatch(Abc_Obj_t *pObj)
Definition: abc.h:356
if(last==0)
Definition: sparse_int.h:34
static void Abc_SclTimeIncAddNode(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.c:455
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition: abc.h:526
static void Abc_SclTimeIncAddNode ( SC_Man p,
Abc_Obj_t pObj 
)
inlinestatic

Definition at line 455 of file sclSize.c.

456 {
457  assert( !Abc_ObjIsLatch(pObj) );
458  assert( pObj->fMarkC == 0 );
459  pObj->fMarkC = 1;
460  Vec_IntPush( Vec_WecEntry(p->vLevels, Abc_ObjLevel(pObj)), Abc_ObjId(pObj) );
461  p->nIncUpdates++;
462 }
static unsigned Abc_ObjId(Abc_Obj_t *pObj)
Definition: abc.h:329
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Abc_ObjIsLatch(Abc_Obj_t *pObj)
Definition: abc.h:356
static int Abc_ObjLevel(Abc_Obj_t *pObj)
Definition: abc.h:330
unsigned fMarkC
Definition: abc.h:136
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
static Vec_Int_t * Vec_WecEntry(Vec_Wec_t *p, int i)
Definition: vecWec.h:142
#define assert(ex)
Definition: util_old.h:213
void Abc_SclTimeIncCheckLevel ( Abc_Ntk_t pNtk)

Definition at line 532 of file sclSize.c.

533 {
534  Abc_Obj_t * pObj;
535  int i;
536  Abc_NtkForEachObj( pNtk, pObj, i )
537  if ( (int)pObj->Level != Abc_ObjLevelNew(pObj) )
538  printf( "Level of node %d is out of date!\n", i );
539 }
if(last==0)
Definition: sparse_int.h:34
#define Abc_NtkForEachObj(pNtk, pObj, i)
ITERATORS ///.
Definition: abc.h:446
ABC_DLL int Abc_ObjLevelNew(Abc_Obj_t *pObj)
Definition: abcTiming.c:1058
void Abc_SclTimeIncInsert ( SC_Man p,
Abc_Obj_t pObj 
)

Definition at line 562 of file sclSize.c.

563 {
564  Vec_IntPush( p->vChanged, Abc_ObjId(pObj) );
565 }
static unsigned Abc_ObjId(Abc_Obj_t *pObj)
Definition: abc.h:329
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
int Abc_SclTimeIncUpdate ( SC_Man p)

Definition at line 540 of file sclSize.c.

541 {
542  Abc_Obj_t * pObj;
543  int i, RetValue;
544  if ( Vec_IntSize(p->vChanged) == 0 )
545  return 0;
546 // Abc_SclTimeIncCheckLevel( p->pNtk );
547  Abc_NtkForEachObjVec( p->vChanged, p->pNtk, pObj, i )
548  {
549  Abc_SclTimeIncAddFanins( p, pObj );
550  if ( pObj->fMarkC )
551  continue;
552  Abc_SclTimeIncAddNode( p, pObj );
553  }
554  Vec_IntClear( p->vChanged );
558  RetValue = p->nIncUpdates;
559  p->nIncUpdates = 0;
560  return RetValue;
561 }
static void Abc_SclTimeIncAddFanins(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.c:463
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define Abc_NtkForEachObjVec(vIds, pNtk, pObj, i)
Definition: abc.h:452
unsigned fMarkC
Definition: abc.h:136
static void Abc_SclTimeIncUpdateClean(SC_Man *p)
Definition: sclSize.c:440
static void Abc_SclTimeIncAddNode(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.c:455
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static void Abc_SclTimeIncUpdateDeparture(SC_Man *p)
Definition: sclSize.c:511
static void Abc_SclTimeIncUpdateArrival(SC_Man *p)
Definition: sclSize.c:480
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
static void Abc_SclTimeIncUpdateArrival ( SC_Man p)
inlinestatic

Definition at line 480 of file sclSize.c.

481 {
482  Vec_Int_t * vLevel;
483  SC_Pair ArrOut, SlewOut;
484  SC_Pair * pArrOut, *pSlewOut;
485  Abc_Obj_t * pObj;
486  float E = (float)0.1;
487  int i, k;
488  Vec_WecForEachLevel( p->vLevels, vLevel, i )
489  {
490  Abc_NtkForEachObjVec( vLevel, p->pNtk, pObj, k )
491  {
492  if ( Abc_ObjIsCo(pObj) )
493  {
494  Abc_SclObjDupFanin( p, pObj );
495  Vec_FltWriteEntry( p->vTimesOut, pObj->iData, Abc_SclObjTimeMax(p, pObj) );
496  Vec_QueUpdate( p->vQue, pObj->iData );
497  continue;
498  }
499  pArrOut = Abc_SclObjTime( p, pObj );
500  pSlewOut = Abc_SclObjSlew( p, pObj );
501  SC_PairMove( &ArrOut, pArrOut );
502  SC_PairMove( &SlewOut, pSlewOut );
503  Abc_SclTimeNode( p, pObj, 0 );
504 // if ( !SC_PairEqual(&ArrOut, pArrOut) || !SC_PairEqual(&SlewOut, pSlewOut) )
505  if ( !SC_PairEqualE(&ArrOut, pArrOut, E) || !SC_PairEqualE(&SlewOut, pSlewOut, E) )
506  Abc_SclTimeIncAddFanouts( p, pObj );
507  }
508  }
509  p->MaxDelay = Abc_SclReadMaxDelay( p );
510 }
static float Abc_SclReadMaxDelay(SC_Man *p)
Definition: sclSize.h:474
void Abc_SclTimeNode(SC_Man *p, Abc_Obj_t *pObj, int fDept)
Definition: sclSize.c:308
static void Vec_FltWriteEntry(Vec_Flt_t *p, int i, float Entry)
Definition: vecFlt.h:364
int iData
Definition: abc.h:146
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Abc_ObjIsCo(Abc_Obj_t *pObj)
Definition: abc.h:352
static SC_Pair * Abc_SclObjTime(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:115
#define Vec_WecForEachLevel(vGlob, vVec, i)
MACRO DEFINITIONS ///.
Definition: vecWec.h:55
#define Abc_NtkForEachObjVec(vIds, pNtk, pObj, i)
Definition: abc.h:452
static SC_Pair * Abc_SclObjSlew(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:116
static int SC_PairEqualE(SC_Pair *d, SC_Pair *s, float E)
Definition: sclLib.h:237
static void Vec_QueUpdate(Vec_Que_t *p, int v)
Definition: vecQue.h:199
static void Abc_SclObjDupFanin(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:127
static float Abc_SclObjTimeMax(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:121
static void SC_PairMove(SC_Pair *d, SC_Pair *s)
Definition: sclLib.h:234
static void Abc_SclTimeIncAddFanouts(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.c:472
static void Abc_SclTimeIncUpdateClean ( SC_Man p)
inlinestatic

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

Synopsis [Incremental timing update.]

Description []

SideEffects []

SeeAlso []

Definition at line 440 of file sclSize.c.

441 {
442  Vec_Int_t * vLevel;
443  Abc_Obj_t * pObj;
444  int i, k;
445  Vec_WecForEachLevel( p->vLevels, vLevel, i )
446  {
447  Abc_NtkForEachObjVec( vLevel, p->pNtk, pObj, k )
448  {
449  assert( pObj->fMarkC == 1 );
450  pObj->fMarkC = 0;
451  }
452  Vec_IntClear( vLevel );
453  }
454 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
#define Vec_WecForEachLevel(vGlob, vVec, i)
MACRO DEFINITIONS ///.
Definition: vecWec.h:55
#define Abc_NtkForEachObjVec(vIds, pNtk, pObj, i)
Definition: abc.h:452
unsigned fMarkC
Definition: abc.h:136
#define assert(ex)
Definition: util_old.h:213
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
static void Abc_SclTimeIncUpdateDeparture ( SC_Man p)
inlinestatic

Definition at line 511 of file sclSize.c.

512 {
513  Vec_Int_t * vLevel;
514  SC_Pair DepOut, * pDepOut;
515  Abc_Obj_t * pObj;
516  float E = (float)0.1;
517  int i, k;
518  Vec_WecForEachLevelReverse( p->vLevels, vLevel, i )
519  {
520  Abc_NtkForEachObjVec( vLevel, p->pNtk, pObj, k )
521  {
522  pDepOut = Abc_SclObjDept( p, pObj );
523  SC_PairMove( &DepOut, pDepOut );
524  Abc_SclDeptObj( p, pObj );
525 // if ( !SC_PairEqual(&DepOut, pDepOut) )
526  if ( !SC_PairEqualE(&DepOut, pDepOut, E) )
527  Abc_SclTimeIncAddFanins( p, pObj );
528  }
529  }
530  p->MaxDelay = Abc_SclReadMaxDelay( p );
531 }
static float Abc_SclReadMaxDelay(SC_Man *p)
Definition: sclSize.h:474
static SC_Pair * Abc_SclObjDept(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:114
static void Abc_SclTimeIncAddFanins(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.c:463
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static void Abc_SclDeptObj(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.c:279
#define Abc_NtkForEachObjVec(vIds, pNtk, pObj, i)
Definition: abc.h:452
static int SC_PairEqualE(SC_Pair *d, SC_Pair *s, float E)
Definition: sclLib.h:237
#define Vec_WecForEachLevelReverse(vGlob, vVec, i)
Definition: vecWec.h:65
static void SC_PairMove(SC_Pair *d, SC_Pair *s)
Definition: sclLib.h:234
void Abc_SclTimeIncUpdateLevel ( Abc_Obj_t pObj)

Definition at line 576 of file sclSize.c.

577 {
579 }
void Abc_SclTimeIncUpdateLevel_rec(Abc_Obj_t *pObj)
Definition: sclSize.c:566
void Abc_SclTimeIncUpdateLevel_rec ( Abc_Obj_t pObj)

Definition at line 566 of file sclSize.c.

567 {
568  Abc_Obj_t * pFanout;
569  int i, LevelNew = Abc_ObjLevelNew(pObj);
570  if ( LevelNew == (int)pObj->Level )
571  return;
572  pObj->Level = LevelNew;
573  Abc_ObjForEachFanout( pObj, pFanout, i )
575 }
void Abc_SclTimeIncUpdateLevel_rec(Abc_Obj_t *pObj)
Definition: sclSize.c:566
unsigned Level
Definition: abc.h:142
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition: abc.h:526
ABC_DLL int Abc_ObjLevelNew(Abc_Obj_t *pObj)
Definition: abcTiming.c:1058
void Abc_SclTimeNode ( SC_Man p,
Abc_Obj_t pObj,
int  fDept 
)

Definition at line 308 of file sclSize.c.

309 {
310  SC_Timing * pTime;
311  SC_Cell * pCell;
312  int k;
313  SC_Pair * pLoad = Abc_SclObjLoad( p, pObj );
314  float LoadRise = pLoad->rise;
315  float LoadFall = pLoad->fall;
316  float DeptRise = 0;
317  float DeptFall = 0;
318  float Value = p->EstLoadMax ? Abc_SclObjLoadValue( p, pObj ) : 0;
319  Abc_Obj_t * pFanin;
320  if ( Abc_ObjIsCi(pObj) )
321  {
322  assert( !fDept );
323  Abc_SclTimeCi( p, pObj );
324  return;
325  }
326  if ( Abc_ObjIsCo(pObj) )
327  {
328  if ( !fDept )
329  {
330  Abc_SclObjDupFanin( p, pObj );
331  Vec_FltWriteEntry( p->vTimesOut, pObj->iData, Abc_SclObjTimeMax(p, pObj) );
332  Vec_QueUpdate( p->vQue, pObj->iData );
333  }
334  return;
335  }
336  assert( Abc_ObjIsNode(pObj) );
337 // if ( !(Abc_ObjFaninNum(pObj) == 1 && Abc_ObjIsPi(Abc_ObjFanin0(pObj))) && p->EstLoadMax && Value > 1 )
338  if ( p->EstLoadMax && Value > 1 )
339  {
340  pLoad->rise = p->EstLoadAve * p->EstLoadMax;
341  pLoad->fall = p->EstLoadAve * p->EstLoadMax;
342  if ( fDept )
343  {
344  SC_Pair * pDepOut = Abc_SclObjDept( p, pObj );
345  float EstDelta = p->EstLinear * log( Value );
346  DeptRise = pDepOut->rise;
347  DeptFall = pDepOut->fall;
348  pDepOut->rise += EstDelta;
349  pDepOut->fall += EstDelta;
350  }
351  p->nEstNodes++;
352  }
353  // get the library cell
354  pCell = Abc_SclObjCell( pObj );
355  // compute for each fanin
356  Abc_ObjForEachFanin( pObj, pFanin, k )
357  {
358  pTime = Scl_CellPinTime( pCell, k );
359  if ( fDept )
360  Abc_SclDeptFanin( p, pTime, pObj, pFanin );
361  else
362  Abc_SclTimeFanin( p, pTime, pObj, pFanin );
363  }
364  if ( p->EstLoadMax && Value > 1 )
365  {
366  pLoad->rise = LoadRise;
367  pLoad->fall = LoadFall;
368  if ( fDept )
369  {
370  SC_Pair * pDepOut = Abc_SclObjDept( p, pObj );
371  pDepOut->rise = DeptRise;
372  pDepOut->fall = DeptFall;
373  }
374  else
375  {
376  SC_Pair * pArrOut = Abc_SclObjTime( p, pObj );
377  float EstDelta = p->EstLinear * log( Value );
378  pArrOut->rise += EstDelta;
379  pArrOut->fall += EstDelta;
380  }
381  }
382 }
static SC_Pair * Abc_SclObjDept(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:114
static SC_Timing * Scl_CellPinTime(SC_Cell *pCell, int iPin)
Definition: sclLib.h:565
static int Abc_ObjIsCi(Abc_Obj_t *pObj)
Definition: abc.h:351
static SC_Pair * Abc_SclObjLoad(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:113
static void Vec_FltWriteEntry(Vec_Flt_t *p, int i, float Entry)
Definition: vecFlt.h:364
static void Abc_SclTimeCi(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.c:298
int iData
Definition: abc.h:146
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Abc_ObjIsCo(Abc_Obj_t *pObj)
Definition: abc.h:352
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
static SC_Pair * Abc_SclObjTime(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:115
float rise
Definition: sclLib.h:65
static void Abc_SclTimeFanin(SC_Man *p, SC_Timing *pTime, Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition: sclSize.c:262
float fall
Definition: sclLib.h:66
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition: abc.h:524
static void Vec_QueUpdate(Vec_Que_t *p, int v)
Definition: vecQue.h:199
static void Abc_SclObjDupFanin(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:127
static float Abc_SclObjLoadValue(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.c:293
#define assert(ex)
Definition: util_old.h:213
static float Abc_SclObjTimeMax(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:121
static void Abc_SclDeptFanin(SC_Man *p, SC_Timing *pTime, Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition: sclSize.c:271
static SC_Cell * Abc_SclObjCell(Abc_Obj_t *p)
Definition: sclSize.h:110
static void Abc_SclTimeNodePrint ( SC_Man p,
Abc_Obj_t pObj,
int  fRise,
int  Length,
float  maxDelay 
)
inlinestatic

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

Synopsis [Printing timing information for the node/network.]

Description []

SideEffects []

SeeAlso []

Definition at line 117 of file sclSize.c.

118 {
119  SC_Cell * pCell = Abc_ObjIsNode(pObj) ? Abc_SclObjCell(pObj) : NULL;
120  printf( "%8d : ", Abc_ObjId(pObj) );
121  printf( "%d ", Abc_ObjFaninNum(pObj) );
122  printf( "%4d ", Abc_ObjFanoutNum(pObj) );
123  printf( "%-*s ", Length, pCell ? pCell->pName : "pi" );
124  printf( "A =%7.2f ", pCell ? pCell->area : 0.0 );
125  printf( "D%s =", fRise ? "r" : "f" );
126  printf( "%6.1f", Abc_SclObjTimeMax(p, pObj) );
127  printf( "%7.1f ps ", -Abc_AbsFloat(Abc_SclObjTimeOne(p, pObj, 0) - Abc_SclObjTimeOne(p, pObj, 1)) );
128  printf( "S =%6.1f ps ", Abc_SclObjSlewMax(p, pObj) );
129  printf( "Cin =%5.1f ff ", pCell ? SC_CellPinCapAve(pCell) : 0.0 );
130  printf( "Cout =%6.1f ff ", Abc_SclObjLoadMax(p, pObj) );
131  printf( "Cmax =%6.1f ff ", pCell ? SC_CellPin(pCell, pCell->n_inputs)->max_out_cap : 0.0 );
132  printf( "G =%5d ", pCell ? (int)(100.0 * Abc_SclObjLoadAve(p, pObj) / SC_CellPinCapAve(pCell)) : 0 );
133 // printf( "SL =%6.1f ps", Abc_SclObjSlackMax(p, pObj, p->MaxDelay0) );
134  printf( "\n" );
135 }
static unsigned Abc_ObjId(Abc_Obj_t *pObj)
Definition: abc.h:329
static float Abc_AbsFloat(float a)
Definition: abc_global.h:242
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Abc_ObjFanoutNum(Abc_Obj_t *pObj)
Definition: abc.h:365
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Definition: abc.h:364
static double Abc_SclObjTimeOne(SC_Man *p, Abc_Obj_t *pObj, int fRise)
Definition: sclSize.h:120
static float SC_CellPinCapAve(SC_Cell *p)
Definition: sclLib.h:244
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
float area
Definition: sclLib.h:188
static double Abc_SclObjSlewMax(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:122
char * pName
Definition: sclLib.h:183
static SC_Pin * SC_CellPin(SC_Cell *p, int i)
Definition: sclLib.h:241
static float Abc_SclObjLoadAve(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:119
int n_inputs
Definition: sclLib.h:192
static float Abc_SclObjTimeMax(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:121
float max_out_cap
Definition: sclLib.h:174
static double Abc_SclObjLoadMax(SC_Man *p, Abc_Obj_t *pObj)
Definition: sclSize.h:118
static SC_Cell * Abc_SclObjCell(Abc_Obj_t *p)
Definition: sclSize.h:110
void Abc_SclTimeNtkPrint ( SC_Man p,
int  fShowAll,
int  fPrintPath 
)

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 
144 #ifdef WIN32
145  printf( "WireLoad = \"%s\" ", p->pWLoadUsed ? p->pWLoadUsed->pName : "none" );
146  SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), 14 ); // yellow
147  printf( "Gates =%7d ", Abc_NtkNodeNum(p->pNtk) );
148  SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), 7 ); // normal
149  printf( "(%5.1f %%) ", 100.0 * Abc_SclGetBufInvCount(p->pNtk) / Abc_NtkNodeNum(p->pNtk) );
150  SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), 10 ); // green
151  printf( "Cap =%5.1f ff ", p->EstLoadAve );
152  SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), 7 ); // normal
153  printf( "(%5.1f %%) ", Abc_SclGetAverageSize(p->pNtk) );
154  SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), 11 ); // blue
155  printf( "Area =%12.2f ", Abc_SclGetTotalArea(p->pNtk) );
156  SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), 7 ); // normal
157  printf( "(%5.1f %%) ", 100.0 * Abc_SclCountMinSize(p->pLib, p->pNtk, 0) / Abc_NtkNodeNum(p->pNtk) );
158  SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), 13 ); // magenta
159  printf( "Delay =%9.2f ps ", maxDelay );
160  SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), 7 ); // normal
161  printf( "(%5.1f %%) ", 100.0 * Abc_SclCountNearCriticalNodes(p) / Abc_NtkNodeNum(p->pNtk) );
162  printf( " \n" );
163 #else
164  Abc_Print( 1, "WireLoad = \"%s\" ", p->pWLoadUsed ? p->pWLoadUsed->pName : "none" );
165  Abc_Print( 1, "%sGates =%7d%s ", "\033[1;33m", Abc_NtkNodeNum(p->pNtk), "\033[0m" ); // yellow
166  Abc_Print( 1, "(%5.1f %%) ", 100.0 * Abc_SclGetBufInvCount(p->pNtk) / Abc_NtkNodeNum(p->pNtk) );
167  Abc_Print( 1, "%sCap =%5.1f ff%s ", "\033[1;32m", p->EstLoadAve, "\033[0m" ); // green
168  Abc_Print( 1, "(%5.1f %%) ", Abc_SclGetAverageSize(p->pNtk) );
169  Abc_Print( 1, "%sArea =%12.2f%s ", "\033[1;36m", Abc_SclGetTotalArea(p->pNtk), "\033[0m" ); // blue
170  Abc_Print( 1, "(%5.1f %%) ", 100.0 * Abc_SclCountMinSize(p->pLib, p->pNtk, 0) / Abc_NtkNodeNum(p->pNtk) );
171  Abc_Print( 1, "%sDelay =%9.2f ps%s ", "\033[1;35m", maxDelay, "\033[0m" ); // magenta
172  Abc_Print( 1, "(%5.1f %%) ", 100.0 * Abc_SclCountNearCriticalNodes(p) / Abc_NtkNodeNum(p->pNtk) );
173  Abc_Print( 1, " \n" );
174 #endif
175 
176  if ( fShowAll )
177  {
178 // printf( "Timing information for all nodes: \n" );
179  // find the longest cell name
180  Abc_NtkForEachNodeReverse( p->pNtk, pObj, i )
181  if ( Abc_ObjFaninNum(pObj) > 0 )
182  nLength = Abc_MaxInt( nLength, strlen(Abc_SclObjCell(pObj)->pName) );
183  // print timing
184  Abc_NtkForEachNodeReverse( p->pNtk, pObj, i )
185  if ( Abc_ObjFaninNum(pObj) > 0 )
186  Abc_SclTimeNodePrint( p, pObj, -1, nLength, maxDelay );
187  }
188  if ( fPrintPath )
189  {
190  Abc_Obj_t * pTemp, * pPrev = NULL;
191  int iStart = -1, iEnd = -1;
192  Vec_Ptr_t * vPath;
193 // printf( "Critical path: \n" );
194  // find the longest cell name
195  pObj = Abc_ObjFanin0(pPivot);
196  i = 0;
197  while ( pObj && Abc_ObjIsNode(pObj) )
198  {
199  i++;
200  nLength = Abc_MaxInt( nLength, strlen(Abc_SclObjCell(pObj)->pName) );
201  pObj = Abc_SclFindMostCriticalFanin( p, &fRise, pObj );
202  }
203 
204  // print timing
205  if ( !fReversePath )
206  {
207  // print timing
208  pObj = Abc_ObjFanin0(pPivot);
209  while ( pObj )//&& Abc_ObjIsNode(pObj) )
210  {
211  printf( "Path%3d --", i-- );
212  Abc_SclTimeNodePrint( p, pObj, fRise, nLength, maxDelay );
213  pPrev = pObj;
214  pObj = Abc_SclFindMostCriticalFanin( p, &fRise, pObj );
215  }
216  }
217  else
218  {
219  // collect path nodes
220  vPath = Vec_PtrAlloc( 100 );
221  Vec_PtrPush( vPath, pPivot );
222  pObj = Abc_ObjFanin0(pPivot);
223  while ( pObj )//&& Abc_ObjIsNode(pObj) )
224  {
225  Vec_PtrPush( vPath, pObj );
226  pPrev = pObj;
227  pObj = Abc_SclFindMostCriticalFanin( p, &fRise, pObj );
228  }
229  Vec_PtrForEachEntryReverse( Abc_Obj_t *, vPath, pObj, i )
230  {
231  printf( "Path%3d --", Vec_PtrSize(vPath)-1-i );
232  Abc_SclTimeNodePrint( p, pObj, fRise, nLength, maxDelay );
233  if ( i == 1 )
234  break;
235  }
236  Vec_PtrFree( vPath );
237  }
238  // print start-point and end-point
239  Abc_NtkForEachPi( p->pNtk, pTemp, iStart )
240  if ( pTemp == pPrev )
241  break;
242  Abc_NtkForEachPo( p->pNtk, pTemp, iEnd )
243  if ( pTemp == pPivot )
244  break;
245  printf( "Start-point = pi%0*d. End-point = po%0*d.\n",
246  Abc_Base10Log( Abc_NtkPiNum(p->pNtk) ), iStart,
247  Abc_Base10Log( Abc_NtkPoNum(p->pNtk) ), iEnd );
248  }
249 }
int Abc_SclCountNearCriticalNodes(SC_Man *p)
Definition: sclUpsize.c:187
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
Abc_Obj_t * Abc_SclFindMostCriticalFanin(SC_Man *p, int *pfRise, Abc_Obj_t *pNode)
Definition: sclSize.c:84
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define Vec_PtrForEachEntryReverse(Type, vVec, pEntry, i)
Definition: vecPtr.h:63
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Definition: abc.h:364
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static double Abc_SclObjTimeOne(SC_Man *p, Abc_Obj_t *pObj, int fRise)
Definition: sclSize.h:120
static int Abc_MaxInt(int a, int b)
Definition: abc_global.h:238
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
static int Abc_SclGetBufInvCount(Abc_Ntk_t *pNtk)
Definition: sclSize.h:429
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
static float Abc_SclGetTotalArea(Abc_Ntk_t *pNtk)
Definition: sclSize.h:446
static int Abc_NtkNodeNum(Abc_Ntk_t *pNtk)
Definition: abc.h:293
static int Abc_Base10Log(unsigned n)
Definition: abc_global.h:252
if(last==0)
Definition: sparse_int.h:34
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
static void Abc_SclTimeNodePrint(SC_Man *p, Abc_Obj_t *pObj, int fRise, int Length, float maxDelay)
Definition: sclSize.c:117
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
ABC_NAMESPACE_IMPL_START Abc_Obj_t * Abc_SclFindCriticalCo(SC_Man *p, int *pfRise)
DECLARATIONS ///.
Definition: sclSize.c:52
#define Abc_NtkForEachNodeReverse(pNtk, pNode, i)
Definition: abc.h:473
int strlen()
static float Abc_SclGetAverageSize(Abc_Ntk_t *pNtk)
Definition: sclSize.h:437
#define Abc_NtkForEachPo(pNtk, pPo, i)
Definition: abc.h:517
int Abc_SclCountMinSize(SC_Lib *pLib, Abc_Ntk_t *p, int fUseMax)
Definition: sclUtil.c:203
#define Abc_NtkForEachPi(pNtk, pPi, i)
Definition: abc.h:513
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
static SC_Cell * Abc_SclObjCell(Abc_Obj_t *p)
Definition: sclSize.h:110
void Abc_SclTimeNtkRecompute ( SC_Man p,
float *  pArea,
float *  pDelay,
int  fReverse,
float  DUser 
)

Definition at line 400 of file sclSize.c.

401 {
402  Abc_Obj_t * pObj;
403  float D;
404  int i;
407  p->nEstNodes = 0;
408  Abc_NtkForEachCi( p->pNtk, pObj, i )
409  Abc_SclTimeNode( p, pObj, 0 );
410  Abc_NtkForEachNode1( p->pNtk, pObj, i )
411  Abc_SclTimeNode( p, pObj, 0 );
412  Abc_NtkForEachCo( p->pNtk, pObj, i )
413  Abc_SclTimeNode( p, pObj, 0 );
414  D = Abc_SclReadMaxDelay( p );
415  if ( fReverse && DUser > 0 && D < DUser )
416  D = DUser;
417  if ( pArea )
418  *pArea = Abc_SclGetTotalArea(p->pNtk);
419  if ( pDelay )
420  *pDelay = D;
421  if ( fReverse )
422  {
423  p->nEstNodes = 0;
424  Abc_NtkForEachNodeReverse1( p->pNtk, pObj, i )
425  Abc_SclTimeNode( p, pObj, 1 );
426  }
427 }
#define Abc_NtkForEachNode1(pNtk, pNode, i)
Definition: abc.h:467
static float Abc_SclReadMaxDelay(SC_Man *p)
Definition: sclSize.h:474
void Abc_SclTimeNode(SC_Man *p, Abc_Obj_t *pObj, int fDept)
Definition: sclSize.c:308
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Abc_SclComputeLoad(SC_Man *p)
Definition: sclLoad.c:106
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition: abc.h:519
#define Abc_NtkForEachNodeReverse1(pNtk, pNode, i)
Definition: abc.h:476
static float Abc_SclGetTotalArea(Abc_Ntk_t *pNtk)
Definition: sclSize.h:446
if(last==0)
Definition: sparse_int.h:34
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition: abc.h:515
static void Abc_SclManCleanTime(SC_Man *p)
Definition: sclSize.h:256
void Abc_SclTimePerform ( SC_Lib pLib,
Abc_Ntk_t pNtk,
int  nTreeCRatio,
int  fUseWireLoads,
int  fShowAll,
int  fPrintPath,
int  fDumpStats 
)

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

Synopsis [Printing out timing information for the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 671 of file sclSize.c.

672 {
673  SC_Man * p;
674  p = Abc_SclManStart( pLib, pNtk, fUseWireLoads, 1, 0, nTreeCRatio );
675  Abc_SclTimeNtkPrint( p, fShowAll, fPrintPath );
676  if ( fDumpStats )
677  Abc_SclDumpStats( p, "stats.txt", 0 );
678  Abc_SclManFree( p );
679 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_HEADER_START struct SC_Man_ SC_Man
INCLUDES ///.
Definition: sclSize.h:44
static void Abc_SclManFree(SC_Man *p)
Definition: sclSize.h:192
static void Abc_SclDumpStats(SC_Man *p, char *pFileName, abctime Time)
Definition: sclSize.h:510
SC_Man * Abc_SclManStart(SC_Lib *pLib, Abc_Ntk_t *pNtk, int fUseWireLoads, int fDept, float DUser, int nTreeCRatio)
Definition: sclSize.c:633
void Abc_SclTimeNtkPrint(SC_Man *p, int fShowAll, int fPrintPath)
Definition: sclSize.c:136