105 SC_Cell * pCellOld, * pCellNew;
106 float dGain, dGainBest;
118 dGainBest = -DelayGap;
121 if ( pCellNew->
area >= pCellOld->
area )
138 if ( dGainBest < dGain )
141 gateBest = pCellNew->
Id;
152 p->SumArea += pCellNew->
area - pCellOld->
area;
214 printf(
"Total : " );
216 printf(
"%5d : ", Iter );
217 printf(
"Try =%6d ", nAttempts );
218 printf(
"Over =%6d ", nOverlaps );
219 printf(
"Fail =%6d ", nAttempts-nOverlaps-nChanges );
220 printf(
"Win =%6d ", nChanges );
222 printf(
"%.2f ", p->SumArea );
223 printf(
"(%+5.1f %%) ", 100.0 * (p->SumArea - p->SumArea0)/ p->SumArea0 );
225 printf(
"%.2f ps ", p->MaxDelay );
226 printf(
"(%+5.1f %%) ", 100.0 * (p->MaxDelay - p->MaxDelay0)/ p->MaxDelay0 );
227 printf(
"%8.2f sec ", 1.0*(
Abc_Clock() - p->timeTotal)/(CLOCKS_PER_SEC) );
228 printf(
"%c", fVerbose ?
'\n' :
'\r' );
246 Vec_Int_t * vNodes, * vEvals, * vTryLater;
252 printf(
"Parameters: " );
253 printf(
"Iters =%5d. ", pPars->
nIters );
254 printf(
"UseDept =%2d. ", pPars->
fUseDept );
256 printf(
"Target =%5d ps. ", pPars->
DelayUser );
257 printf(
"DelayGap =%3d ps. ", pPars->
DelayGap );
258 printf(
"Timeout =%4d sec", pPars->
TimeOut );
265 assert( p->vGatesBest == NULL );
266 p->vGatesBest =
Vec_IntDup( p->pNtk->vGates );
272 for ( i = 0; i < pPars->
nIters; i++ )
275 int nAttemptAll = 0, nOverlapAll = 0, nChangesAll = 0;
279 int nAttempt = 0, nOverlap = 0, nChanges = 0;
308 nAttemptAll += nAttempt; nOverlapAll += nOverlap; nChangesAll += nChanges;
309 if ( nRuntimeLimit &&
Abc_Clock() > nRuntimeLimit )
316 if ( nRuntimeLimit &&
Abc_Clock() > nRuntimeLimit )
318 if ( nAttemptAll == 0 )
328 p->timeTotal =
Abc_Clock() - p->timeTotal;
331 p->timeOther = p->timeTotal - p->timeCone - p->timeSize - p->timeTime;
332 ABC_PRTP(
"Runtime: Critical path", p->timeCone, p->timeTotal );
333 ABC_PRTP(
"Runtime: Sizing eval ", p->timeSize, p->timeTotal );
334 ABC_PRTP(
"Runtime: Timing update", p->timeTime, p->timeTotal );
335 ABC_PRTP(
"Runtime: Other ", p->timeOther, p->timeTotal );
336 ABC_PRTP(
"Runtime: TOTAL ", p->timeTotal, p->timeTotal );
340 if ( nRuntimeLimit &&
Abc_Clock() > nRuntimeLimit )
341 printf(
"Gate sizing timed out at %d seconds.\n", pPars->
TimeOut );
static unsigned Abc_ObjId(Abc_Obj_t *pObj)
static float Abc_SclReadMaxDelay(SC_Man *p)
void Abc_SclTimeNtkRecompute(SC_Man *p, float *pArea, float *pDelay, int fReverse, float DUser)
ABC_NAMESPACE_IMPL_START void Abc_SclFindWindow(Abc_Obj_t *pPivot, Vec_Int_t **pvNodes, Vec_Int_t **pvEvals)
DECLARATIONS ///.
static int Abc_ObjIsCi(Abc_Obj_t *pObj)
static void Abc_SclConeStore(SC_Man *p, Vec_Int_t *vCone)
void Abc_SclTimeIncInsert(SC_Man *p, Abc_Obj_t *pObj)
static void Vec_FltWriteEntry(Vec_Flt_t *p, int i, float Entry)
static Vec_Int_t * Vec_IntDup(Vec_Int_t *pVec)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static void Abc_SclConeRestore(SC_Man *p, Vec_Int_t *vCone)
static void Abc_SclObjSetCell(Abc_Obj_t *p, SC_Cell *pCell)
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
#define SC_RingForEachCellRev(pRing, pCell, i)
static int Vec_QuePop(Vec_Que_t *p)
typedefABC_NAMESPACE_HEADER_START struct SC_Man_ SC_Man
INCLUDES ///.
static abctime Abc_Clock()
void Abc_NtkCollectNodesByArea(SC_Man *p, Abc_Ntk_t *pNtk)
static Abc_Obj_t * Abc_NtkObj(Abc_Ntk_t *pNtk, int i)
int Abc_SclTimeIncUpdate(SC_Man *p)
static void Abc_SclLoadStore(SC_Man *p, Abc_Obj_t *pObj)
#define ABC_PRTP(a, t, T)
static void Vec_QueClear(Vec_Que_t *p)
static int Vec_QueSize(Vec_Que_t *p)
static void Abc_SclLoadRestore(SC_Man *p, Abc_Obj_t *pObj)
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
static void Abc_SclManFree(SC_Man *p)
static void Abc_SclDumpStats(SC_Man *p, char *pFileName, abctime Time)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
#define Abc_NtkForEachObjVec(vIds, pNtk, pObj, i)
#define ABC_NAMESPACE_IMPL_END
int Abc_SclCheckOverlap(Abc_Ntk_t *pNtk, Vec_Int_t *vNodes)
static int Vec_IntUniqify(Vec_Int_t *p)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
void Abc_SclDnsizePrint(SC_Man *p, int Iter, int nAttempts, int nOverlaps, int nChanges, int fVerbose)
static SC_Cell * SC_LibCell(SC_Lib *p, int i)
void Abc_SclSclGates2MioGates(SC_Lib *pLib, Abc_Ntk_t *p)
static void Abc_SclEvalStore(SC_Man *p, Vec_Int_t *vCone)
#define Abc_NtkForEachNode(pNtk, pNode, i)
#define ABC_NAMESPACE_IMPL_START
void Abc_SclTimeCone(SC_Man *p, Vec_Int_t *vCone)
static int Abc_NodeIsTravIdCurrent(Abc_Obj_t *p)
static int Vec_IntSize(Vec_Int_t *p)
#define Abc_ObjForEachFanout(pObj, pFanout, i)
#define Abc_ObjForEachFanin(pObj, pFanin, i)
static void Abc_NtkIncrementTravId(Abc_Ntk_t *p)
static Abc_Ntk_t * Abc_ObjNtk(Abc_Obj_t *pObj)
int Abc_SclCheckImprovement(SC_Man *p, Abc_Obj_t *pObj, Vec_Int_t *vNodes, Vec_Int_t *vEvals, int Notches, int DelayGap)
static void Vec_IntFree(Vec_Int_t *p)
static void Vec_IntClear(Vec_Int_t *p)
static float Abc_SclEvalPerformLegal(SC_Man *p, Vec_Int_t *vCone, float D)
static void Vec_QuePush(Vec_Que_t *p, int v)
void Abc_SclDnsizePerform(SC_Lib *pLib, Abc_Ntk_t *pNtk, SC_SizePars *pPars)
static void Abc_NodeSetTravIdCurrent(Abc_Obj_t *p)
void Abc_SclUpdateLoad(SC_Man *p, Abc_Obj_t *pObj, SC_Cell *pOld, SC_Cell *pNew)
static SC_Cell * Abc_SclObjCell(Abc_Obj_t *p)
SC_Man * Abc_SclManStart(SC_Lib *pLib, Abc_Ntk_t *pNtk, int fUseWireLoads, int fDept, float DUser, int nTreeCRatio)