Commit 70a34748 by Alan Mishchenko

Improvements to the timing manager.

parent 5c30eb10
...@@ -1671,6 +1671,7 @@ Gia_Man_t * Gia_ManPerformMappingInt( Gia_Man_t * p, If_Par_t * pPars ) ...@@ -1671,6 +1671,7 @@ Gia_Man_t * Gia_ManPerformMappingInt( Gia_Man_t * p, If_Par_t * pPars )
} }
if ( p->pManTime ) if ( p->pManTime )
pIfMan->pManTim = Tim_ManDup( (Tim_Man_t *)p->pManTime, pPars->fDelayOpt || pPars->fDelayOptLut || pPars->fDsdBalance || pPars->fUserRecLib ); 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 ( !If_ManPerformMapping( pIfMan ) )
{ {
If_ManStop( pIfMan ); If_ManStop( pIfMan );
...@@ -1694,8 +1695,6 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp ) ...@@ -1694,8 +1695,6 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp )
Gia_Man_t * pNew; Gia_Man_t * pNew;
if ( p->pManTime && Tim_ManBoxNum(p->pManTime) && Gia_ManIsNormalized(p) ) 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 ); pNew = Gia_ManDupUnnormalize( p );
if ( pNew == NULL ) if ( pNew == NULL )
return NULL; return NULL;
...@@ -1714,9 +1713,6 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp ) ...@@ -1714,9 +1713,6 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp )
Gia_ManTransferPacking( pNew, p ); Gia_ManTransferPacking( pNew, p );
Gia_ManTransferTiming( pNew, p ); Gia_ManTransferTiming( pNew, p );
Gia_ManStop( p ); Gia_ManStop( p );
// cleanup
Tim_ManStop( (Tim_Man_t *)pNew->pManTime );
pNew->pManTime = pTimOld;
assert( Gia_ManIsNormalized(pNew) ); assert( Gia_ManIsNormalized(pNew) );
} }
else else
......
...@@ -427,6 +427,8 @@ void Gia_ManPrintStats( Gia_Man_t * p, Gps_Par_t * pPars ) ...@@ -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) ); Abc_Print( 1, " mem =%5.2f MB", Gia_ManMemory(p)/(1<<20) );
if ( Gia_ManHasChoices(p) ) if ( Gia_ManHasChoices(p) )
Abc_Print( 1, " ch =%5d", Gia_ManChoiceNum(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 ) if ( pPars && pPars->fMuxXor )
printf( "\nXOR/MUX " ), Gia_ManPrintMuxStats( p ); printf( "\nXOR/MUX " ), Gia_ManPrintMuxStats( p );
if ( pPars && pPars->fSwitch ) if ( pPars && pPars->fSwitch )
...@@ -456,8 +458,8 @@ void Gia_ManPrintStats( Gia_Man_t * p, Gps_Par_t * pPars ) ...@@ -456,8 +458,8 @@ void Gia_ManPrintStats( Gia_Man_t * p, Gps_Par_t * pPars )
Gia_ManPrintLutStats( p ); Gia_ManPrintLutStats( p );
if ( p->pPlacement ) if ( p->pPlacement )
Gia_ManPrintPlacement( p ); Gia_ManPrintPlacement( p );
if ( p->pManTime ) // if ( p->pManTime )
Tim_ManPrintStats( (Tim_Man_t *)p->pManTime, p->nAnd2Delay ); // Tim_ManPrintStats( (Tim_Man_t *)p->pManTime, p->nAnd2Delay );
// print register classes // print register classes
Gia_ManPrintFlopClasses( p ); Gia_ManPrintFlopClasses( p );
Gia_ManPrintGateClasses( p ); Gia_ManPrintGateClasses( p );
......
...@@ -323,7 +323,7 @@ If_LibBox_t * If_LibBoxRead( char * pFileName ) ...@@ -323,7 +323,7 @@ If_LibBox_t * If_LibBoxRead( char * pFileName )
for ( i = 0; i < nPis * nPos; i++ ) for ( i = 0; i < nPis * nPos; i++ )
{ {
pToken = If_LibBoxGetToken( pFile ); pToken = If_LibBoxGetToken( pFile );
pBox->pDelays[i] = (pToken[0] == '-') ? -1 : atoi(pToken); pBox->pDelays[i] = (pToken[0] == '-') ? -ABC_INFINITY : atoi(pToken);
} }
// extract next name // extract next name
pToken = If_LibBoxGetToken( pFile ); pToken = If_LibBoxGetToken( pFile );
...@@ -342,7 +342,7 @@ void If_LibBoxPrint( FILE * pFile, If_LibBox_t * p ) ...@@ -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 ); 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 ( j = 0; j < pBox->nPos; j++, printf("\n") )
for ( k = 0; k < pBox->nPis; k++ ) 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, " - " ); fprintf( pFile, " - " );
else else
fprintf( pFile, "%5d ", pBox->pDelays[j * pBox->nPis + k] ); fprintf( pFile, "%5d ", pBox->pDelays[j * pBox->nPis + k] );
......
...@@ -128,6 +128,9 @@ Tim_Man_t * Tim_ManDup( Tim_Man_t * p, int fUnitDelay ) ...@@ -128,6 +128,9 @@ Tim_Man_t * Tim_ManDup( Tim_Man_t * p, int fUnitDelay )
pDelayTableNew[1] = (int)pDelayTable[1]; pDelayTableNew[1] = (int)pDelayTable[1];
pDelayTableNew[2] = (int)pDelayTable[2]; pDelayTableNew[2] = (int)pDelayTable[2];
for ( k = 0; k < nInputs * nOutputs; k++ ) for ( k = 0; k < nInputs * nOutputs; k++ )
if ( pDelayTable[3+k] == -ABC_INFINITY )
pDelayTableNew[3+k] = -ABC_INFINITY;
else
pDelayTableNew[3+k] = fUnitDelay ? (float)fUnitDelay : pDelayTable[3+k]; pDelayTableNew[3+k] = fUnitDelay ? (float)fUnitDelay : pDelayTable[3+k];
// assert( (int)pDelayTableNew[0] == Vec_PtrSize(pNew->vDelayTables) ); // assert( (int)pDelayTableNew[0] == Vec_PtrSize(pNew->vDelayTables) );
assert( Vec_PtrEntry(pNew->vDelayTables, i) == NULL ); assert( Vec_PtrEntry(pNew->vDelayTables, i) == NULL );
......
...@@ -200,6 +200,7 @@ float Tim_ManGetCiArrival( Tim_Man_t * p, int iCi ) ...@@ -200,6 +200,7 @@ float Tim_ManGetCiArrival( Tim_Man_t * p, int iCi )
pDelays = pTable + 3 + i * pBox->nInputs; pDelays = pTable + 3 + i * pBox->nInputs;
DelayBest = -TIM_ETERNITY; DelayBest = -TIM_ETERNITY;
Tim_ManBoxForEachInput( p, pBox, pObj, k ) Tim_ManBoxForEachInput( p, pBox, pObj, k )
if ( pDelays[k] != -ABC_INFINITY )
DelayBest = Abc_MaxInt( DelayBest, pObj->timeArr + pDelays[k] ); DelayBest = Abc_MaxInt( DelayBest, pObj->timeArr + pDelays[k] );
pObjRes->timeArr = DelayBest; pObjRes->timeArr = DelayBest;
pObjRes->TravId = p->nTravIds; pObjRes->TravId = p->nTravIds;
...@@ -248,6 +249,7 @@ float Tim_ManGetCoRequired( Tim_Man_t * p, int iCo ) ...@@ -248,6 +249,7 @@ float Tim_ManGetCoRequired( Tim_Man_t * p, int iCo )
Tim_ManBoxForEachOutput( p, pBox, pObj, k ) Tim_ManBoxForEachOutput( p, pBox, pObj, k )
{ {
pDelays = pTable + 3 + k * pBox->nInputs; pDelays = pTable + 3 + k * pBox->nInputs;
if ( pDelays[k] != -ABC_INFINITY )
DelayBest = Abc_MinFloat( DelayBest, pObj->timeReq - pDelays[i] ); DelayBest = Abc_MinFloat( DelayBest, pObj->timeReq - pDelays[i] );
} }
pObjRes->timeReq = DelayBest; pObjRes->timeReq = DelayBest;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment