From 70a3474849b049c149ac1b5c4ec34dee731859d5 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Mon, 25 Aug 2014 20:47:11 -0500 Subject: Improvements to the timing manager. --- src/aig/gia/giaIf.c | 6 +----- src/aig/gia/giaMan.c | 6 ++++-- src/map/if/ifLibBox.c | 4 ++-- src/misc/tim/timMan.c | 5 ++++- src/misc/tim/timTime.c | 6 ++++-- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/aig/gia/giaIf.c b/src/aig/gia/giaIf.c index 839fa4c1..6a2520eb 100644 --- a/src/aig/gia/giaIf.c +++ b/src/aig/gia/giaIf.c @@ -1671,6 +1671,7 @@ Gia_Man_t * Gia_ManPerformMappingInt( Gia_Man_t * p, If_Par_t * pPars ) } if ( p->pManTime ) pIfMan->pManTim = Tim_ManDup( (Tim_Man_t *)p->pManTime, pPars->fDelayOpt || pPars->fDelayOptLut || pPars->fDsdBalance || pPars->fUserRecLib ); +// Tim_ManPrint( pIfMan->pManTim ); if ( !If_ManPerformMapping( pIfMan ) ) { If_ManStop( pIfMan ); @@ -1694,8 +1695,6 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp ) Gia_Man_t * pNew; if ( p->pManTime && Tim_ManBoxNum(p->pManTime) && Gia_ManIsNormalized(p) ) { - Tim_Man_t * pTimOld = (Tim_Man_t *)p->pManTime; - p->pManTime = Tim_ManDup( pTimOld, 1 ); pNew = Gia_ManDupUnnormalize( p ); if ( pNew == NULL ) return NULL; @@ -1714,9 +1713,6 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp ) Gia_ManTransferPacking( pNew, p ); Gia_ManTransferTiming( pNew, p ); Gia_ManStop( p ); - // cleanup - Tim_ManStop( (Tim_Man_t *)pNew->pManTime ); - pNew->pManTime = pTimOld; assert( Gia_ManIsNormalized(pNew) ); } else diff --git a/src/aig/gia/giaMan.c b/src/aig/gia/giaMan.c index 80473d19..bcb62c4b 100644 --- a/src/aig/gia/giaMan.c +++ b/src/aig/gia/giaMan.c @@ -427,6 +427,8 @@ void Gia_ManPrintStats( Gia_Man_t * p, Gps_Par_t * pPars ) Abc_Print( 1, " mem =%5.2f MB", Gia_ManMemory(p)/(1<<20) ); if ( Gia_ManHasChoices(p) ) Abc_Print( 1, " ch =%5d", Gia_ManChoiceNum(p) ); + if ( p->pManTime ) + Abc_Print( 1, " box =%d", Tim_ManBoxNum((Tim_Man_t *)p->pManTime) ); if ( pPars && pPars->fMuxXor ) printf( "\nXOR/MUX " ), Gia_ManPrintMuxStats( p ); if ( pPars && pPars->fSwitch ) @@ -456,8 +458,8 @@ void Gia_ManPrintStats( Gia_Man_t * p, Gps_Par_t * pPars ) Gia_ManPrintLutStats( p ); if ( p->pPlacement ) Gia_ManPrintPlacement( p ); - if ( p->pManTime ) - Tim_ManPrintStats( (Tim_Man_t *)p->pManTime, p->nAnd2Delay ); +// if ( p->pManTime ) +// Tim_ManPrintStats( (Tim_Man_t *)p->pManTime, p->nAnd2Delay ); // print register classes Gia_ManPrintFlopClasses( p ); Gia_ManPrintGateClasses( p ); diff --git a/src/map/if/ifLibBox.c b/src/map/if/ifLibBox.c index 799d2aed..a4aa5960 100644 --- a/src/map/if/ifLibBox.c +++ b/src/map/if/ifLibBox.c @@ -323,7 +323,7 @@ If_LibBox_t * If_LibBoxRead( char * pFileName ) for ( i = 0; i < nPis * nPos; i++ ) { pToken = If_LibBoxGetToken( pFile ); - pBox->pDelays[i] = (pToken[0] == '-') ? -1 : atoi(pToken); + pBox->pDelays[i] = (pToken[0] == '-') ? -ABC_INFINITY : atoi(pToken); } // extract next name pToken = If_LibBoxGetToken( pFile ); @@ -342,7 +342,7 @@ void If_LibBoxPrint( FILE * pFile, If_LibBox_t * p ) fprintf( pFile, "%s %d %d %d %d\n", pBox->pName, pBox->Id, !pBox->fBlack, pBox->nPis, pBox->nPos ); for ( j = 0; j < pBox->nPos; j++, printf("\n") ) for ( k = 0; k < pBox->nPis; k++ ) - if ( pBox->pDelays[j * pBox->nPis + k] == -1 ) + if ( pBox->pDelays[j * pBox->nPis + k] == -ABC_INFINITY ) fprintf( pFile, " - " ); else fprintf( pFile, "%5d ", pBox->pDelays[j * pBox->nPis + k] ); diff --git a/src/misc/tim/timMan.c b/src/misc/tim/timMan.c index 0900b7ae..93c69146 100644 --- a/src/misc/tim/timMan.c +++ b/src/misc/tim/timMan.c @@ -128,7 +128,10 @@ Tim_Man_t * Tim_ManDup( Tim_Man_t * p, int fUnitDelay ) pDelayTableNew[1] = (int)pDelayTable[1]; pDelayTableNew[2] = (int)pDelayTable[2]; for ( k = 0; k < nInputs * nOutputs; k++ ) - pDelayTableNew[3+k] = fUnitDelay ? (float)fUnitDelay : pDelayTable[3+k]; + if ( pDelayTable[3+k] == -ABC_INFINITY ) + pDelayTableNew[3+k] = -ABC_INFINITY; + else + pDelayTableNew[3+k] = fUnitDelay ? (float)fUnitDelay : pDelayTable[3+k]; // assert( (int)pDelayTableNew[0] == Vec_PtrSize(pNew->vDelayTables) ); assert( Vec_PtrEntry(pNew->vDelayTables, i) == NULL ); Vec_PtrWriteEntry( pNew->vDelayTables, i, pDelayTableNew ); diff --git a/src/misc/tim/timTime.c b/src/misc/tim/timTime.c index 7d3dd082..c766fb7f 100644 --- a/src/misc/tim/timTime.c +++ b/src/misc/tim/timTime.c @@ -200,7 +200,8 @@ float Tim_ManGetCiArrival( Tim_Man_t * p, int iCi ) pDelays = pTable + 3 + i * pBox->nInputs; DelayBest = -TIM_ETERNITY; Tim_ManBoxForEachInput( p, pBox, pObj, k ) - DelayBest = Abc_MaxInt( DelayBest, pObj->timeArr + pDelays[k] ); + if ( pDelays[k] != -ABC_INFINITY ) + DelayBest = Abc_MaxInt( DelayBest, pObj->timeArr + pDelays[k] ); pObjRes->timeArr = DelayBest; pObjRes->TravId = p->nTravIds; } @@ -248,7 +249,8 @@ float Tim_ManGetCoRequired( Tim_Man_t * p, int iCo ) Tim_ManBoxForEachOutput( p, pBox, pObj, k ) { pDelays = pTable + 3 + k * pBox->nInputs; - DelayBest = Abc_MinFloat( DelayBest, pObj->timeReq - pDelays[i] ); + if ( pDelays[k] != -ABC_INFINITY ) + DelayBest = Abc_MinFloat( DelayBest, pObj->timeReq - pDelays[i] ); } pObjRes->timeReq = DelayBest; pObjRes->TravId = p->nTravIds; -- cgit v1.2.3