Commit ef20b0c5 by Alan Mishchenko

Version abc80404

parent 69b5bcad
...@@ -199,6 +199,14 @@ void Dar_BalancePermute( Aig_Man_t * p, Vec_Ptr_t * vSuper, int LeftBound, int f ...@@ -199,6 +199,14 @@ void Dar_BalancePermute( Aig_Man_t * p, Vec_Ptr_t * vSuper, int LeftBound, int f
Vec_PtrWriteEntry( vSuper, RightBound, pObj3 ); Vec_PtrWriteEntry( vSuper, RightBound, pObj3 );
return; return;
} }
if ( Aig_Regular(pObj1) == Aig_Regular(pObj3) )
{
if ( pObj3 == pObj2 )
return;
Vec_PtrWriteEntry( vSuper, i, pObj2 );
Vec_PtrWriteEntry( vSuper, RightBound, pObj3 );
return;
}
pGhost = Aig_ObjCreateGhost( p, pObj1, pObj3, fExor? AIG_OBJ_EXOR : AIG_OBJ_AND ); pGhost = Aig_ObjCreateGhost( p, pObj1, pObj3, fExor? AIG_OBJ_EXOR : AIG_OBJ_AND );
if ( Aig_TableLookup( p, pGhost ) ) if ( Aig_TableLookup( p, pGhost ) )
{ {
...@@ -394,7 +402,7 @@ Aig_Man_t * Dar_ManBalance( Aig_Man_t * p, int fUpdateLevel ) ...@@ -394,7 +402,7 @@ Aig_Man_t * Dar_ManBalance( Aig_Man_t * p, int fUpdateLevel )
pObjNew = Aig_ObjCreatePi(pNew); pObjNew = Aig_ObjCreatePi(pNew);
pObj->pData = pObjNew; pObj->pData = pObjNew;
// set the arrival time of the new PI // set the arrival time of the new PI
arrTime = Tim_ManGetPiArrival( p->pManTime, Aig_ObjPioNum(pObj) ); arrTime = Tim_ManGetCiArrival( p->pManTime, Aig_ObjPioNum(pObj) );
pObjNew->Level = (int)arrTime; pObjNew->Level = (int)arrTime;
} }
else if ( Aig_ObjIsPo(pObj) ) else if ( Aig_ObjIsPo(pObj) )
...@@ -406,7 +414,7 @@ Aig_Man_t * Dar_ManBalance( Aig_Man_t * p, int fUpdateLevel ) ...@@ -406,7 +414,7 @@ Aig_Man_t * Dar_ManBalance( Aig_Man_t * p, int fUpdateLevel )
Aig_ObjCreatePo( pNew, pObjNew ); Aig_ObjCreatePo( pNew, pObjNew );
// save arrival time of the output // save arrival time of the output
arrTime = (float)Aig_Regular(pObjNew)->Level; arrTime = (float)Aig_Regular(pObjNew)->Level;
Tim_ManSetPoArrival( p->pManTime, Aig_ObjPioNum(pObj), arrTime ); Tim_ManSetCoArrival( p->pManTime, Aig_ObjPioNum(pObj), arrTime );
} }
else else
assert( 0 ); assert( 0 );
......
...@@ -600,10 +600,21 @@ p->timeOther = p->timeTotal - p->timeCuts - p->timeEval; ...@@ -600,10 +600,21 @@ p->timeOther = p->timeTotal - p->timeCuts - p->timeEval;
Aig_ManFanoutStop( pAig ); Aig_ManFanoutStop( pAig );
if ( p->pPars->fUpdateLevel ) if ( p->pPars->fUpdateLevel )
Aig_ManStopReverseLevels( pAig ); Aig_ManStopReverseLevels( pAig );
/*
Aig_ManForEachObj( p->pAig, pObj, i )
if ( Aig_ObjIsNode(pObj) && Aig_ObjRefs(pObj) == 0 )
{
printf( "Unreferenced " );
Aig_ObjPrintVerbose( pObj, 0 );
printf( "\n" );
}
*/
// remove dangling nodes (they should not be here!)
Aig_ManCleanup( pAig );
// stop the rewriting manager // stop the rewriting manager
Dar_ManRefStop( p ); Dar_ManRefStop( p );
Aig_ManCheckPhase( pAig ); // Aig_ManCheckPhase( pAig );
if ( !Aig_ManCheck( pAig ) ) if ( !Aig_ManCheck( pAig ) )
{ {
printf( "Dar_ManRefactor: The network check has failed.\n" ); printf( "Dar_ManRefactor: The network check has failed.\n" );
......
...@@ -387,7 +387,7 @@ int Ntl_ManExtract_rec( Ntl_Man_t * p, Ntl_Net_t * pNet ) ...@@ -387,7 +387,7 @@ int Ntl_ManExtract_rec( Ntl_Man_t * p, Ntl_Net_t * pNet )
// add box inputs/outputs to COs/CIs // add box inputs/outputs to COs/CIs
if ( Ntl_ObjIsBox(pObj) ) if ( Ntl_ObjIsBox(pObj) )
{ {
int LevelCur, LevelMax = -TIME_ETERNITY; int LevelCur, LevelMax = -TIM_ETERNITY;
Vec_IntPush( p->vBox1Cos, Aig_ManPoNum(p->pAig) ); Vec_IntPush( p->vBox1Cos, Aig_ManPoNum(p->pAig) );
Ntl_ObjForEachFanin( pObj, pNetFanin, i ) Ntl_ObjForEachFanin( pObj, pNetFanin, i )
{ {
......
...@@ -974,9 +974,9 @@ static int Ioa_ReadParseLineTimes( Ioa_ReadMod_t * p, char * pLine, int fOutput ...@@ -974,9 +974,9 @@ static int Ioa_ReadParseLineTimes( Ioa_ReadMod_t * p, char * pLine, int fOutput
// find the delay number // find the delay number
pTokenNum = Vec_PtrEntryLast(vTokens); pTokenNum = Vec_PtrEntryLast(vTokens);
if ( !strcmp( pTokenNum, "-inf" ) ) if ( !strcmp( pTokenNum, "-inf" ) )
Delay = -TIME_ETERNITY; Delay = -TIM_ETERNITY;
else if ( !strcmp( pTokenNum, "inf" ) ) else if ( !strcmp( pTokenNum, "inf" ) )
Delay = TIME_ETERNITY; Delay = TIM_ETERNITY;
else else
Delay = atof( pTokenNum ); Delay = atof( pTokenNum );
if ( Delay == 0.0 && pTokenNum[0] != '0' ) if ( Delay == 0.0 && pTokenNum[0] != '0' )
......
...@@ -90,11 +90,11 @@ Tim_Man_t * Ntl_ManCreateTiming( Ntl_Man_t * p ) ...@@ -90,11 +90,11 @@ Tim_Man_t * Ntl_ManCreateTiming( Ntl_Man_t * p )
// unpack the data in the arrival times // unpack the data in the arrival times
if ( pRoot->vArrivals ) if ( pRoot->vArrivals )
Vec_IntForEachEntry( pRoot->vArrivals, Entry, i ) Vec_IntForEachEntry( pRoot->vArrivals, Entry, i )
Tim_ManInitPiArrival( pMan, Entry, Aig_Int2Float(Vec_IntEntry(pRoot->vArrivals,++i)) ); Tim_ManInitCiArrival( pMan, Entry, Aig_Int2Float(Vec_IntEntry(pRoot->vArrivals,++i)) );
// unpack the data in the required times // unpack the data in the required times
if ( pRoot->vRequireds ) if ( pRoot->vRequireds )
Vec_IntForEachEntry( pRoot->vRequireds, Entry, i ) Vec_IntForEachEntry( pRoot->vRequireds, Entry, i )
Tim_ManInitPoRequired( pMan, Entry, Aig_Int2Float(Vec_IntEntry(pRoot->vRequireds,++i)) ); Tim_ManInitCoRequired( pMan, Entry, Aig_Int2Float(Vec_IntEntry(pRoot->vRequireds,++i)) );
// derive timing tables // derive timing tables
vDelayTables = Vec_PtrAlloc( Vec_PtrSize(p->vModels) ); vDelayTables = Vec_PtrAlloc( Vec_PtrSize(p->vModels) );
Ntl_ManForEachModel( p, pModel, i ) Ntl_ManForEachModel( p, pModel, i )
......
...@@ -114,14 +114,14 @@ int Nwk_ManLevelBackup( Nwk_Man_t * pNtk ) ...@@ -114,14 +114,14 @@ int Nwk_ManLevelBackup( Nwk_Man_t * pNtk )
{ {
if ( Nwk_ObjIsCi(pObj) ) if ( Nwk_ObjIsCi(pObj) )
{ {
Level = pManTimeUnit? (int)Tim_ManGetPiArrival( pManTimeUnit, pObj->PioId ) : 0; Level = pManTimeUnit? (int)Tim_ManGetCiArrival( pManTimeUnit, pObj->PioId ) : 0;
Nwk_ObjSetLevel( pObj, Level ); Nwk_ObjSetLevel( pObj, Level );
} }
else if ( Nwk_ObjIsCo(pObj) ) else if ( Nwk_ObjIsCo(pObj) )
{ {
Level = Nwk_ObjLevel( Nwk_ObjFanin0(pObj) ); Level = Nwk_ObjLevel( Nwk_ObjFanin0(pObj) );
if ( pManTimeUnit ) if ( pManTimeUnit )
Tim_ManSetPoArrival( pManTimeUnit, pObj->PioId, (float)Level ); Tim_ManSetCoArrival( pManTimeUnit, pObj->PioId, (float)Level );
Nwk_ObjSetLevel( pObj, Level ); Nwk_ObjSetLevel( pObj, Level );
if ( LevelMax < Nwk_ObjLevel(pObj) ) if ( LevelMax < Nwk_ObjLevel(pObj) )
LevelMax = Nwk_ObjLevel(pObj); LevelMax = Nwk_ObjLevel(pObj);
......
...@@ -52,7 +52,7 @@ void Nwk_ManSetIfParsDefault( If_Par_t * pPars ) ...@@ -52,7 +52,7 @@ void Nwk_ManSetIfParsDefault( If_Par_t * pPars )
pPars->nFlowIters = 1; pPars->nFlowIters = 1;
pPars->nAreaIters = 2; pPars->nAreaIters = 2;
pPars->DelayTarget = -1; pPars->DelayTarget = -1;
pPars->Epsilon = (float)0.001; pPars->Epsilon = (float)0.005;
pPars->fPreprocess = 1; pPars->fPreprocess = 1;
pPars->fArea = 0; pPars->fArea = 0;
pPars->fFancy = 0; pPars->fFancy = 0;
......
...@@ -114,14 +114,14 @@ Aig_Man_t * Nwk_ManStrash( Nwk_Man_t * pNtk ) ...@@ -114,14 +114,14 @@ Aig_Man_t * Nwk_ManStrash( Nwk_Man_t * pNtk )
if ( Nwk_ObjIsCi(pObj) ) if ( Nwk_ObjIsCi(pObj) )
{ {
pObjNew = Aig_ObjCreatePi(pMan); pObjNew = Aig_ObjCreatePi(pMan);
Level = Tim_ManGetPiArrival( pMan->pManTime, pObj->PioId ); Level = Tim_ManGetCiArrival( pMan->pManTime, pObj->PioId );
Aig_ObjSetLevel( pObjNew, Level ); Aig_ObjSetLevel( pObjNew, Level );
} }
else if ( Nwk_ObjIsCo(pObj) ) else if ( Nwk_ObjIsCo(pObj) )
{ {
pObjNew = Aig_ObjCreatePo( pMan, Aig_NotCond(Nwk_ObjFanin0(pObj)->pCopy, pObj->fCompl) ); pObjNew = Aig_ObjCreatePo( pMan, Aig_NotCond(Nwk_ObjFanin0(pObj)->pCopy, pObj->fCompl) );
Level = Aig_ObjLevel( pObjNew ); Level = Aig_ObjLevel( pObjNew );
Tim_ManSetPoArrival( pMan->pManTime, pObj->PioId, (float)Level ); Tim_ManSetCoArrival( pMan->pManTime, pObj->PioId, (float)Level );
} }
else if ( Nwk_ObjIsNode(pObj) ) else if ( Nwk_ObjIsNode(pObj) )
{ {
......
...@@ -46,7 +46,7 @@ void Nwk_ManCleanTiming( Nwk_Man_t * pNtk ) ...@@ -46,7 +46,7 @@ void Nwk_ManCleanTiming( Nwk_Man_t * pNtk )
Nwk_ManForEachObj( pNtk, pObj, i ) Nwk_ManForEachObj( pNtk, pObj, i )
{ {
pObj->tArrival = pObj->tSlack = 0.0; pObj->tArrival = pObj->tSlack = 0.0;
pObj->tRequired = TIME_ETERNITY; pObj->tRequired = TIM_ETERNITY;
} }
} }
...@@ -138,7 +138,7 @@ float Nwk_NodeComputeArrival( Nwk_Obj_t * pObj, int fUseSorting ) ...@@ -138,7 +138,7 @@ float Nwk_NodeComputeArrival( Nwk_Obj_t * pObj, int fUseSorting )
return Nwk_ObjArrival(pObj); return Nwk_ObjArrival(pObj);
if ( Nwk_ObjIsCo(pObj) ) if ( Nwk_ObjIsCo(pObj) )
return Nwk_ObjArrival( Nwk_ObjFanin0(pObj) ); return Nwk_ObjArrival( Nwk_ObjFanin0(pObj) );
tArrival = -TIME_ETERNITY; tArrival = -TIM_ETERNITY;
if ( pLutLib == NULL ) if ( pLutLib == NULL )
{ {
Nwk_ObjForEachFanin( pObj, pFanin, k ) Nwk_ObjForEachFanin( pObj, pFanin, k )
...@@ -196,7 +196,7 @@ float Nwk_NodeComputeRequired( Nwk_Obj_t * pObj, int fUseSorting ) ...@@ -196,7 +196,7 @@ float Nwk_NodeComputeRequired( Nwk_Obj_t * pObj, int fUseSorting )
assert( Nwk_ObjIsNode(pObj) || Nwk_ObjIsCi(pObj) || Nwk_ObjIsCo(pObj) ); assert( Nwk_ObjIsNode(pObj) || Nwk_ObjIsCi(pObj) || Nwk_ObjIsCo(pObj) );
if ( Nwk_ObjIsCo(pObj) ) if ( Nwk_ObjIsCo(pObj) )
return Nwk_ObjRequired(pObj); return Nwk_ObjRequired(pObj);
tRequired = TIME_ETERNITY; tRequired = TIM_ETERNITY;
if ( pLutLib == NULL ) if ( pLutLib == NULL )
{ {
Nwk_ObjForEachFanout( pObj, pFanout, k ) Nwk_ObjForEachFanout( pObj, pFanout, k )
...@@ -321,6 +321,7 @@ float Nwk_NodePropagateRequired( Nwk_Obj_t * pObj, int fUseSorting ) ...@@ -321,6 +321,7 @@ float Nwk_NodePropagateRequired( Nwk_Obj_t * pObj, int fUseSorting )
***********************************************************************/ ***********************************************************************/
float Nwk_ManDelayTraceLut( Nwk_Man_t * pNtk ) float Nwk_ManDelayTraceLut( Nwk_Man_t * pNtk )
{ {
Vec_Ptr_t * vObjs;
int fUseSorting = 1; int fUseSorting = 1;
If_Lib_t * pLutLib = pNtk->pLutLib; If_Lib_t * pLutLib = pNtk->pLutLib;
Vec_Ptr_t * vNodes; Vec_Ptr_t * vNodes;
...@@ -333,7 +334,7 @@ float Nwk_ManDelayTraceLut( Nwk_Man_t * pNtk ) ...@@ -333,7 +334,7 @@ float Nwk_ManDelayTraceLut( Nwk_Man_t * pNtk )
{ {
printf( "The max LUT size (%d) is less than the max fanin count (%d).\n", printf( "The max LUT size (%d) is less than the max fanin count (%d).\n",
pLutLib->LutMax, Nwk_ManGetFaninMax(pNtk) ); pLutLib->LutMax, Nwk_ManGetFaninMax(pNtk) );
return -TIME_ETERNITY; return -TIM_ETERNITY;
} }
// compute the reverse order of all objects // compute the reverse order of all objects
...@@ -345,18 +346,21 @@ float Nwk_ManDelayTraceLut( Nwk_Man_t * pNtk ) ...@@ -345,18 +346,21 @@ float Nwk_ManDelayTraceLut( Nwk_Man_t * pNtk )
// propagate arrival times // propagate arrival times
if ( pNtk->pManTime ) if ( pNtk->pManTime )
Tim_ManIncrementTravId( pNtk->pManTime ); Tim_ManIncrementTravId( pNtk->pManTime );
Nwk_ManForEachObj( pNtk, pObj, i ) // Nwk_ManForEachObj( pNtk, pObj, i )
vObjs = Nwk_ManDfs( pNtk );
Vec_PtrForEachEntry( vObjs, pObj, i )
{ {
tArrival = Nwk_NodeComputeArrival( pObj, fUseSorting ); tArrival = Nwk_NodeComputeArrival( pObj, fUseSorting );
if ( Nwk_ObjIsCo(pObj) && pNtk->pManTime ) if ( Nwk_ObjIsCo(pObj) && pNtk->pManTime )
Tim_ManSetPoArrival( pNtk->pManTime, pObj->PioId, tArrival ); Tim_ManSetCoArrival( pNtk->pManTime, pObj->PioId, tArrival );
if ( Nwk_ObjIsCi(pObj) && pNtk->pManTime ) if ( Nwk_ObjIsCi(pObj) && pNtk->pManTime )
tArrival = Tim_ManGetPiArrival( pNtk->pManTime, pObj->PioId ); tArrival = Tim_ManGetCiArrival( pNtk->pManTime, pObj->PioId );
Nwk_ObjSetArrival( pObj, tArrival ); Nwk_ObjSetArrival( pObj, tArrival );
} }
Vec_PtrFree( vObjs );
// get the latest arrival times // get the latest arrival times
tArrival = -TIME_ETERNITY; tArrival = -TIM_ETERNITY;
Nwk_ManForEachPo( pNtk, pObj, i ) Nwk_ManForEachPo( pNtk, pObj, i )
if ( tArrival < Nwk_ObjArrival(pObj) ) if ( tArrival < Nwk_ObjArrival(pObj) )
tArrival = Nwk_ObjArrival(pObj); tArrival = Nwk_ObjArrival(pObj);
...@@ -365,7 +369,7 @@ float Nwk_ManDelayTraceLut( Nwk_Man_t * pNtk ) ...@@ -365,7 +369,7 @@ float Nwk_ManDelayTraceLut( Nwk_Man_t * pNtk )
if ( pNtk->pManTime ) if ( pNtk->pManTime )
{ {
Tim_ManIncrementTravId( pNtk->pManTime ); Tim_ManIncrementTravId( pNtk->pManTime );
Tim_ManSetPoRequiredAll( pNtk->pManTime, tArrival ); Tim_ManSetCoRequiredAll( pNtk->pManTime, tArrival );
} }
else else
{ {
...@@ -383,13 +387,13 @@ float Nwk_ManDelayTraceLut( Nwk_Man_t * pNtk ) ...@@ -383,13 +387,13 @@ float Nwk_ManDelayTraceLut( Nwk_Man_t * pNtk )
else if ( Nwk_ObjIsCi(pObj) ) else if ( Nwk_ObjIsCi(pObj) )
{ {
if ( pNtk->pManTime ) if ( pNtk->pManTime )
Tim_ManSetPiRequired( pNtk->pManTime, pObj->PioId, Nwk_ObjRequired(pObj) ); Tim_ManSetCiRequired( pNtk->pManTime, pObj->PioId, Nwk_ObjRequired(pObj) );
} }
else if ( Nwk_ObjIsCo(pObj) ) else if ( Nwk_ObjIsCo(pObj) )
{ {
if ( pNtk->pManTime ) if ( pNtk->pManTime )
{ {
tRequired = Tim_ManGetPoRequired( pNtk->pManTime, pObj->PioId ); tRequired = Tim_ManGetCoRequired( pNtk->pManTime, pObj->PioId );
Nwk_ObjSetRequired( pObj, tRequired ); Nwk_ObjSetRequired( pObj, tRequired );
} }
if ( Nwk_ObjRequired(Nwk_ObjFanin0(pObj)) > Nwk_ObjRequired(pObj) ) if ( Nwk_ObjRequired(Nwk_ObjFanin0(pObj)) > Nwk_ObjRequired(pObj) )
...@@ -523,7 +527,6 @@ void Nwk_NodeUpdateAddToQueue( Vec_Ptr_t * vQueue, Nwk_Obj_t * pObj, int iCurren ...@@ -523,7 +527,6 @@ void Nwk_NodeUpdateAddToQueue( Vec_Ptr_t * vQueue, Nwk_Obj_t * pObj, int iCurren
if ( Nwk_ObjLevel(pTemp2) >= Nwk_ObjLevel(pTemp1) ) if ( Nwk_ObjLevel(pTemp2) >= Nwk_ObjLevel(pTemp1) )
break; break;
} }
// assert( i-1 > iCurrent );
vQueue->pArray[i-1] = pTemp1; vQueue->pArray[i-1] = pTemp1;
vQueue->pArray[i] = pTemp2; vQueue->pArray[i] = pTemp2;
} }
...@@ -557,7 +560,7 @@ void Nwk_NodeUpdateArrival( Nwk_Obj_t * pObj ) ...@@ -557,7 +560,7 @@ void Nwk_NodeUpdateArrival( Nwk_Obj_t * pObj )
Vec_Ptr_t * vQueue = pObj->pMan->vTemp; Vec_Ptr_t * vQueue = pObj->pMan->vTemp;
Nwk_Obj_t * pTemp, * pNext; Nwk_Obj_t * pTemp, * pNext;
float tArrival; float tArrival;
int i, k, iBox, iTerm1, nTerms; int iCur, k, iBox, iTerm1, nTerms;
assert( Nwk_ObjIsNode(pObj) ); assert( Nwk_ObjIsNode(pObj) );
// verify the arrival time // verify the arrival time
tArrival = Nwk_NodeComputeArrival( pObj, 1 ); tArrival = Nwk_NodeComputeArrival( pObj, 1 );
...@@ -569,12 +572,12 @@ void Nwk_NodeUpdateArrival( Nwk_Obj_t * pObj ) ...@@ -569,12 +572,12 @@ void Nwk_NodeUpdateArrival( Nwk_Obj_t * pObj )
// process objects // process objects
if ( pManTime ) if ( pManTime )
Tim_ManIncrementTravId( pManTime ); Tim_ManIncrementTravId( pManTime );
Vec_PtrForEachEntry( vQueue, pTemp, i ) Vec_PtrForEachEntry( vQueue, pTemp, iCur )
{ {
pTemp->MarkA = 0; pTemp->MarkA = 0;
tArrival = Nwk_NodeComputeArrival( pTemp, 1 ); tArrival = Nwk_NodeComputeArrival( pTemp, 1 );
if ( Nwk_ObjIsCi(pTemp) && pManTime ) if ( Nwk_ObjIsCi(pTemp) && pManTime )
tArrival = Tim_ManGetPiArrival( pManTime, pTemp->PioId ); tArrival = Tim_ManGetCiArrival( pManTime, pTemp->PioId );
if ( Nwk_ManTimeEqual( tArrival, Nwk_ObjArrival(pTemp), (float)0.01 ) ) if ( Nwk_ManTimeEqual( tArrival, Nwk_ObjArrival(pTemp), (float)0.01 ) )
continue; continue;
Nwk_ObjSetArrival( pTemp, tArrival ); Nwk_ObjSetArrival( pTemp, tArrival );
...@@ -583,19 +586,23 @@ void Nwk_NodeUpdateArrival( Nwk_Obj_t * pObj ) ...@@ -583,19 +586,23 @@ void Nwk_NodeUpdateArrival( Nwk_Obj_t * pObj )
{ {
if ( pManTime ) if ( pManTime )
{ {
Tim_ManSetPoArrival( pManTime, pTemp->PioId, tArrival ); // it may happen that a box-input (CO) was already marked as visited
iBox = Tim_ManBoxForCo( pManTime, pNext->PioId ); // when some other box-input of the same box was visited - here we undo this
if ( iBox >= 0 ) // this is not a true PO iBox = Tim_ManBoxForCo( pManTime, pTemp->PioId );
if ( Tim_ManIsCoTravIdCurrent( pManTime, pTemp->PioId ) )
Tim_ManSetPreviousTravIdBoxInputs( pManTime, iBox );
Tim_ManSetCoArrival( pManTime, pTemp->PioId, tArrival );
if ( iBox >= 0 ) // this CO is an input of the box
{ {
Tim_ManSetCurrentTravIdBoxInputs( pManTime, iBox ); Tim_ManSetCurrentTravIdBoxInputs( pManTime, iBox );
iTerm1 = Tim_ManBoxOutputFirst( pManTime, iBox ); iTerm1 = Tim_ManBoxOutputFirst( pManTime, iBox );
nTerms = Tim_ManBoxOutputNum( pManTime, iBox ); nTerms = Tim_ManBoxOutputNum( pManTime, iBox );
for ( i = 0; i < nTerms; i++ ) for ( k = 0; k < nTerms; k++ )
{ {
pNext = Nwk_ManCi(pNext->pMan, iTerm1 + i); pNext = Nwk_ManCi(pNext->pMan, iTerm1 + k);
if ( pNext->MarkA ) if ( pNext->MarkA )
continue; continue;
Nwk_NodeUpdateAddToQueue( vQueue, pNext, i, 1 ); Nwk_NodeUpdateAddToQueue( vQueue, pNext, iCur, 1 );
pNext->MarkA = 1; pNext->MarkA = 1;
} }
} }
...@@ -607,7 +614,7 @@ void Nwk_NodeUpdateArrival( Nwk_Obj_t * pObj ) ...@@ -607,7 +614,7 @@ void Nwk_NodeUpdateArrival( Nwk_Obj_t * pObj )
{ {
if ( pNext->MarkA ) if ( pNext->MarkA )
continue; continue;
Nwk_NodeUpdateAddToQueue( vQueue, pNext, i, 1 ); Nwk_NodeUpdateAddToQueue( vQueue, pNext, iCur, 1 );
pNext->MarkA = 1; pNext->MarkA = 1;
} }
} }
...@@ -632,7 +639,7 @@ void Nwk_NodeUpdateRequired( Nwk_Obj_t * pObj ) ...@@ -632,7 +639,7 @@ void Nwk_NodeUpdateRequired( Nwk_Obj_t * pObj )
Vec_Ptr_t * vQueue = pObj->pMan->vTemp; Vec_Ptr_t * vQueue = pObj->pMan->vTemp;
Nwk_Obj_t * pTemp, * pNext; Nwk_Obj_t * pTemp, * pNext;
float tRequired; float tRequired;
int i, k, iBox, iTerm1, nTerms; int iCur, k, iBox, iTerm1, nTerms;
assert( Nwk_ObjIsNode(pObj) ); assert( Nwk_ObjIsNode(pObj) );
// make sure the node's required time remained the same // make sure the node's required time remained the same
tRequired = Nwk_NodeComputeRequired( pObj, 1 ); tRequired = Nwk_NodeComputeRequired( pObj, 1 );
...@@ -649,12 +656,12 @@ void Nwk_NodeUpdateRequired( Nwk_Obj_t * pObj ) ...@@ -649,12 +656,12 @@ void Nwk_NodeUpdateRequired( Nwk_Obj_t * pObj )
// process objects // process objects
if ( pManTime ) if ( pManTime )
Tim_ManIncrementTravId( pManTime ); Tim_ManIncrementTravId( pManTime );
Vec_PtrForEachEntry( vQueue, pTemp, i ) Vec_PtrForEachEntry( vQueue, pTemp, iCur )
{ {
pTemp->MarkA = 0; pTemp->MarkA = 0;
tRequired = Nwk_NodeComputeRequired( pTemp, 1 ); tRequired = Nwk_NodeComputeRequired( pTemp, 1 );
if ( Nwk_ObjIsCo(pTemp) && pManTime ) if ( Nwk_ObjIsCo(pTemp) && pManTime )
tRequired = Tim_ManGetPoRequired( pManTime, pTemp->PioId ); tRequired = Tim_ManGetCoRequired( pManTime, pTemp->PioId );
if ( Nwk_ManTimeEqual( tRequired, Nwk_ObjRequired(pTemp), (float)0.01 ) ) if ( Nwk_ManTimeEqual( tRequired, Nwk_ObjRequired(pTemp), (float)0.01 ) )
continue; continue;
Nwk_ObjSetRequired( pTemp, tRequired ); Nwk_ObjSetRequired( pTemp, tRequired );
...@@ -663,19 +670,23 @@ void Nwk_NodeUpdateRequired( Nwk_Obj_t * pObj ) ...@@ -663,19 +670,23 @@ void Nwk_NodeUpdateRequired( Nwk_Obj_t * pObj )
{ {
if ( pManTime ) if ( pManTime )
{ {
Tim_ManSetPiRequired( pManTime, pTemp->PioId, tRequired ); // it may happen that a box-output (CI) was already marked as visited
iBox = Tim_ManBoxForCi( pManTime, pNext->PioId ); // when some other box-output of the same box was visited - here we undo this
if ( iBox >= 0 ) // this is not a true PO iBox = Tim_ManBoxForCi( pManTime, pTemp->PioId );
if ( Tim_ManIsCiTravIdCurrent( pManTime, pTemp->PioId ) )
Tim_ManSetPreviousTravIdBoxOutputs( pManTime, iBox );
Tim_ManSetCiRequired( pManTime, pTemp->PioId, tRequired );
if ( iBox >= 0 ) // this CI is an output of the box
{ {
Tim_ManSetCurrentTravIdBoxOutputs( pManTime, iBox ); Tim_ManSetCurrentTravIdBoxOutputs( pManTime, iBox );
iTerm1 = Tim_ManBoxInputFirst( pManTime, iBox ); iTerm1 = Tim_ManBoxInputFirst( pManTime, iBox );
nTerms = Tim_ManBoxInputNum( pManTime, iBox ); nTerms = Tim_ManBoxInputNum( pManTime, iBox );
for ( i = 0; i < nTerms; i++ ) for ( k = 0; k < nTerms; k++ )
{ {
pNext = Nwk_ManCo(pNext->pMan, iTerm1 + i); pNext = Nwk_ManCo(pNext->pMan, iTerm1 + k);
if ( pNext->MarkA ) if ( pNext->MarkA )
continue; continue;
Nwk_NodeUpdateAddToQueue( vQueue, pNext, i, 0 ); Nwk_NodeUpdateAddToQueue( vQueue, pNext, iCur, 0 );
pNext->MarkA = 1; pNext->MarkA = 1;
} }
} }
...@@ -687,7 +698,7 @@ void Nwk_NodeUpdateRequired( Nwk_Obj_t * pObj ) ...@@ -687,7 +698,7 @@ void Nwk_NodeUpdateRequired( Nwk_Obj_t * pObj )
{ {
if ( pNext->MarkA ) if ( pNext->MarkA )
continue; continue;
Nwk_NodeUpdateAddToQueue( vQueue, pNext, i, 0 ); Nwk_NodeUpdateAddToQueue( vQueue, pNext, iCur, 0 );
pNext->MarkA = 1; pNext->MarkA = 1;
} }
} }
...@@ -715,7 +726,7 @@ int Nwk_ObjLevelNew( Nwk_Obj_t * pObj ) ...@@ -715,7 +726,7 @@ int Nwk_ObjLevelNew( Nwk_Obj_t * pObj )
if ( pManTime ) if ( pManTime )
{ {
iBox = Tim_ManBoxForCi( pManTime, pObj->PioId ); iBox = Tim_ManBoxForCi( pManTime, pObj->PioId );
if ( iBox >= 0 ) // this is not a true PI if ( iBox >= 0 ) // this CI is an output of the box
{ {
iTerm1 = Tim_ManBoxInputFirst( pManTime, iBox ); iTerm1 = Tim_ManBoxInputFirst( pManTime, iBox );
nTerms = Tim_ManBoxInputNum( pManTime, iBox ); nTerms = Tim_ManBoxInputNum( pManTime, iBox );
...@@ -751,14 +762,14 @@ void Nwk_ManUpdateLevel( Nwk_Obj_t * pObj ) ...@@ -751,14 +762,14 @@ void Nwk_ManUpdateLevel( Nwk_Obj_t * pObj )
Tim_Man_t * pManTime = pObj->pMan->pManTime; Tim_Man_t * pManTime = pObj->pMan->pManTime;
Vec_Ptr_t * vQueue = pObj->pMan->vTemp; Vec_Ptr_t * vQueue = pObj->pMan->vTemp;
Nwk_Obj_t * pTemp, * pNext; Nwk_Obj_t * pTemp, * pNext;
int LevelNew, i, k, iBox, iTerm1, nTerms; int LevelNew, iCur, k, iBox, iTerm1, nTerms;
assert( Nwk_ObjIsNode(pObj) ); assert( Nwk_ObjIsNode(pObj) );
// initialize the queue with the node // initialize the queue with the node
Vec_PtrClear( vQueue ); Vec_PtrClear( vQueue );
Vec_PtrPush( vQueue, pObj ); Vec_PtrPush( vQueue, pObj );
pObj->MarkA = 1; pObj->MarkA = 1;
// process objects // process objects
Vec_PtrForEachEntry( vQueue, pTemp, i ) Vec_PtrForEachEntry( vQueue, pTemp, iCur )
{ {
pTemp->MarkA = 0; pTemp->MarkA = 0;
LevelNew = Nwk_ObjLevelNew( pTemp ); LevelNew = Nwk_ObjLevelNew( pTemp );
...@@ -770,18 +781,18 @@ void Nwk_ManUpdateLevel( Nwk_Obj_t * pObj ) ...@@ -770,18 +781,18 @@ void Nwk_ManUpdateLevel( Nwk_Obj_t * pObj )
{ {
if ( pManTime ) if ( pManTime )
{ {
iBox = Tim_ManBoxForCo( pManTime, pNext->PioId ); iBox = Tim_ManBoxForCo( pManTime, pTemp->PioId );
if ( iBox >= 0 ) // this is not a true PO if ( iBox >= 0 ) // this is not a true PO
{ {
Tim_ManSetCurrentTravIdBoxInputs( pManTime, iBox ); Tim_ManSetCurrentTravIdBoxInputs( pManTime, iBox );
iTerm1 = Tim_ManBoxOutputFirst( pManTime, iBox ); iTerm1 = Tim_ManBoxOutputFirst( pManTime, iBox );
nTerms = Tim_ManBoxOutputNum( pManTime, iBox ); nTerms = Tim_ManBoxOutputNum( pManTime, iBox );
for ( i = 0; i < nTerms; i++ ) for ( k = 0; k < nTerms; k++ )
{ {
pNext = Nwk_ManCi(pNext->pMan, iTerm1 + i); pNext = Nwk_ManCi(pNext->pMan, iTerm1 + k);
if ( pNext->MarkA ) if ( pNext->MarkA )
continue; continue;
Nwk_NodeUpdateAddToQueue( vQueue, pNext, i, 1 ); Nwk_NodeUpdateAddToQueue( vQueue, pNext, iCur, 1 );
pNext->MarkA = 1; pNext->MarkA = 1;
} }
} }
...@@ -793,7 +804,7 @@ void Nwk_ManUpdateLevel( Nwk_Obj_t * pObj ) ...@@ -793,7 +804,7 @@ void Nwk_ManUpdateLevel( Nwk_Obj_t * pObj )
{ {
if ( pNext->MarkA ) if ( pNext->MarkA )
continue; continue;
Nwk_NodeUpdateAddToQueue( vQueue, pNext, i, 1 ); Nwk_NodeUpdateAddToQueue( vQueue, pNext, iCur, 1 );
pNext->MarkA = 1; pNext->MarkA = 1;
} }
} }
...@@ -855,7 +866,7 @@ void Nwk_ManUpdate( Nwk_Obj_t * pObj, Nwk_Obj_t * pObjNew, Vec_Vec_t * vLevels ) ...@@ -855,7 +866,7 @@ void Nwk_ManUpdate( Nwk_Obj_t * pObj, Nwk_Obj_t * pObjNew, Vec_Vec_t * vLevels )
pObjNew->tArrival = pObj->tArrival; pObjNew->tArrival = pObj->tArrival;
pObjNew->tRequired = pObj->tRequired; pObjNew->tRequired = pObj->tRequired;
// update required times of the old fanins // update required times of the old fanins
pObj->tRequired = TIME_ETERNITY; pObj->tRequired = TIM_ETERNITY;
Nwk_NodeUpdateRequired( pObj ); Nwk_NodeUpdateRequired( pObj );
// remove the old node // remove the old node
Nwk_ManDeleteNode_rec( pObj ); Nwk_ManDeleteNode_rec( pObj );
......
...@@ -47,10 +47,10 @@ struct Tim_Man_t_ ...@@ -47,10 +47,10 @@ struct Tim_Man_t_
Mem_Flex_t * pMemObj; // memory manager for boxes Mem_Flex_t * pMemObj; // memory manager for boxes
int nTravIds; // traversal ID of the manager int nTravIds; // traversal ID of the manager
int fUseTravId; // enables the use of traversal ID int fUseTravId; // enables the use of traversal ID
int nPis; // the number of PIs int nCis; // the number of PIs
int nPos; // the number of POs int nCos; // the number of POs
Tim_Obj_t * pPis; // timing info for the PIs Tim_Obj_t * pCis; // timing info for the PIs
Tim_Obj_t * pPos; // timing info for the POs Tim_Obj_t * pCos; // timing info for the POs
}; };
// timing box // timing box
...@@ -75,26 +75,26 @@ struct Tim_Obj_t_ ...@@ -75,26 +75,26 @@ struct Tim_Obj_t_
float timeReq; // required time of the object float timeReq; // required time of the object
}; };
static inline Tim_Obj_t * Tim_ManPi( Tim_Man_t * p, int i ) { assert( i < p->nPis ); return p->pPis + i; } static inline Tim_Obj_t * Tim_ManCi( Tim_Man_t * p, int i ) { assert( i < p->nCis ); return p->pCis + i; }
static inline Tim_Obj_t * Tim_ManPo( Tim_Man_t * p, int i ) { assert( i < p->nPos ); return p->pPos + i; } static inline Tim_Obj_t * Tim_ManCo( Tim_Man_t * p, int i ) { assert( i < p->nCos ); return p->pCos + i; }
static inline Tim_Box_t * Tim_ManBox( Tim_Man_t * p, int i ) { return Vec_PtrEntry(p->vBoxes, i); } static inline Tim_Box_t * Tim_ManBox( Tim_Man_t * p, int i ) { return Vec_PtrEntry(p->vBoxes, i); }
static inline Tim_Box_t * Tim_ManPiBox( Tim_Man_t * p, int i ) { return Tim_ManPi(p,i)->iObj2Box < 0 ? NULL : Vec_PtrEntry( p->vBoxes, Tim_ManPi(p,i)->iObj2Box ); } static inline Tim_Box_t * Tim_ManCiBox( Tim_Man_t * p, int i ) { return Tim_ManCi(p,i)->iObj2Box < 0 ? NULL : Vec_PtrEntry( p->vBoxes, Tim_ManCi(p,i)->iObj2Box ); }
static inline Tim_Box_t * Tim_ManPoBox( Tim_Man_t * p, int i ) { return Tim_ManPo(p,i)->iObj2Box < 0 ? NULL : Vec_PtrEntry( p->vBoxes, Tim_ManPo(p,i)->iObj2Box ); } static inline Tim_Box_t * Tim_ManCoBox( Tim_Man_t * p, int i ) { return Tim_ManCo(p,i)->iObj2Box < 0 ? NULL : Vec_PtrEntry( p->vBoxes, Tim_ManCo(p,i)->iObj2Box ); }
static inline Tim_Obj_t * Tim_ManBoxInput( Tim_Man_t * p, Tim_Box_t * pBox, int i ) { assert( i < pBox->nInputs ); return p->pPos + pBox->Inouts[i]; } static inline Tim_Obj_t * Tim_ManBoxInput( Tim_Man_t * p, Tim_Box_t * pBox, int i ) { assert( i < pBox->nInputs ); return p->pCos + pBox->Inouts[i]; }
static inline Tim_Obj_t * Tim_ManBoxOutput( Tim_Man_t * p, Tim_Box_t * pBox, int i ) { assert( i < pBox->nOutputs ); return p->pPis + pBox->Inouts[pBox->nInputs+i]; } static inline Tim_Obj_t * Tim_ManBoxOutput( Tim_Man_t * p, Tim_Box_t * pBox, int i ) { assert( i < pBox->nOutputs ); return p->pCis + pBox->Inouts[pBox->nInputs+i]; }
#define Tim_ManBoxForEachInput( p, pBox, pObj, i ) \ #define Tim_ManBoxForEachInput( p, pBox, pObj, i ) \
for ( i = 0; (i < (pBox)->nInputs) && ((pObj) = Tim_ManBoxInput(p, pBox, i)); i++ ) for ( i = 0; (i < (pBox)->nInputs) && ((pObj) = Tim_ManBoxInput(p, pBox, i)); i++ )
#define Tim_ManBoxForEachOutput( p, pBox, pObj, i ) \ #define Tim_ManBoxForEachOutput( p, pBox, pObj, i ) \
for ( i = 0; (i < (pBox)->nOutputs) && ((pObj) = Tim_ManBoxOutput(p, pBox, i)); i++ ) for ( i = 0; (i < (pBox)->nOutputs) && ((pObj) = Tim_ManBoxOutput(p, pBox, i)); i++ )
#define Tim_ManForEachPi( p, pObj, i ) \ #define Tim_ManForEachCi( p, pObj, i ) \
for ( i = 0; (i < (p)->nPis) && ((pObj) = (p)->pPis + i); i++ ) \ for ( i = 0; (i < (p)->nCis) && ((pObj) = (p)->pCis + i); i++ ) \
if ( pObj->iObj2Box >= 0 ) {} else if ( pObj->iObj2Box >= 0 ) {} else
#define Tim_ManForEachPo( p, pObj, i ) \ #define Tim_ManForEachCo( p, pObj, i ) \
for ( i = 0; (i < (p)->nPos) && ((pObj) = (p)->pPos + i); i++ ) \ for ( i = 0; (i < (p)->nCos) && ((pObj) = (p)->pCos + i); i++ ) \
if ( pObj->iObj2Box >= 0 ) {} else if ( pObj->iObj2Box >= 0 ) {} else
#define Tim_ManForEachBox( p, pBox, i ) \ #define Tim_ManForEachBox( p, pBox, i ) \
Vec_PtrForEachEntry( p->vBoxes, pBox, i ) Vec_PtrForEachEntry( p->vBoxes, pBox, i )
...@@ -114,7 +114,7 @@ static inline Tim_Obj_t * Tim_ManBoxOutput( Tim_Man_t * p, Tim_Box_t * pBox, int ...@@ -114,7 +114,7 @@ static inline Tim_Obj_t * Tim_ManBoxOutput( Tim_Man_t * p, Tim_Box_t * pBox, int
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
Tim_Man_t * Tim_ManStart( int nPis, int nPos ) Tim_Man_t * Tim_ManStart( int nCis, int nCos )
{ {
Tim_Man_t * p; Tim_Man_t * p;
int i; int i;
...@@ -122,27 +122,27 @@ Tim_Man_t * Tim_ManStart( int nPis, int nPos ) ...@@ -122,27 +122,27 @@ Tim_Man_t * Tim_ManStart( int nPis, int nPos )
memset( p, 0, sizeof(Tim_Man_t) ); memset( p, 0, sizeof(Tim_Man_t) );
p->pMemObj = Mem_FlexStart(); p->pMemObj = Mem_FlexStart();
p->vBoxes = Vec_PtrAlloc( 100 ); p->vBoxes = Vec_PtrAlloc( 100 );
p->nPis = nPis; p->nCis = nCis;
p->nPos = nPos; p->nCos = nCos;
p->pPis = ALLOC( Tim_Obj_t, nPis ); p->pCis = ALLOC( Tim_Obj_t, nCis );
memset( p->pPis, 0, sizeof(Tim_Obj_t) * nPis ); memset( p->pCis, 0, sizeof(Tim_Obj_t) * nCis );
p->pPos = ALLOC( Tim_Obj_t, nPos ); p->pCos = ALLOC( Tim_Obj_t, nCos );
memset( p->pPos, 0, sizeof(Tim_Obj_t) * nPos ); memset( p->pCos, 0, sizeof(Tim_Obj_t) * nCos );
for ( i = 0; i < nPis; i++ ) for ( i = 0; i < nCis; i++ )
{ {
p->pPis[i].Id = i; p->pCis[i].Id = i;
p->pPis[i].iObj2Box = p->pPis[i].iObj2Num = -1; p->pCis[i].iObj2Box = p->pCis[i].iObj2Num = -1;
p->pPis[i].timeReq = TIME_ETERNITY; p->pCis[i].timeReq = TIM_ETERNITY;
p->pPis[i].timeArr = 0.0; p->pCis[i].timeArr = 0.0;
p->pPis[i].TravId = 0; p->pCis[i].TravId = 0;
} }
for ( i = 0; i < nPos; i++ ) for ( i = 0; i < nCos; i++ )
{ {
p->pPos[i].Id = i; p->pCos[i].Id = i;
p->pPos[i].iObj2Box = p->pPos[i].iObj2Num = -1; p->pCos[i].iObj2Box = p->pCos[i].iObj2Num = -1;
p->pPos[i].timeReq = TIME_ETERNITY; p->pCos[i].timeReq = TIM_ETERNITY;
p->pPos[i].timeArr = 0.0; p->pCos[i].timeArr = 0.0;
p->pPos[i].TravId = 0; p->pCos[i].TravId = 0;
} }
p->fUseTravId = 1; p->fUseTravId = 1;
return p; return p;
...@@ -166,17 +166,17 @@ Tim_Man_t * Tim_ManDup( Tim_Man_t * p, int fDiscrete ) ...@@ -166,17 +166,17 @@ Tim_Man_t * Tim_ManDup( Tim_Man_t * p, int fDiscrete )
Tim_Box_t * pBox; Tim_Box_t * pBox;
float * pDelayTableNew; float * pDelayTableNew;
int i, k; int i, k;
pNew = Tim_ManStart( p->nPis, p->nPos ); pNew = Tim_ManStart( p->nCis, p->nCos );
memcpy( pNew->pPis, p->pPis, sizeof(Tim_Obj_t) * p->nPis ); memcpy( pNew->pCis, p->pCis, sizeof(Tim_Obj_t) * p->nCis );
memcpy( pNew->pPos, p->pPos, sizeof(Tim_Obj_t) * p->nPos ); memcpy( pNew->pCos, p->pCos, sizeof(Tim_Obj_t) * p->nCos );
for ( k = 0; k < p->nPis; k++ ) for ( k = 0; k < p->nCis; k++ )
pNew->pPis[k].TravId = 0; pNew->pCis[k].TravId = 0;
for ( k = 0; k < p->nPos; k++ ) for ( k = 0; k < p->nCos; k++ )
pNew->pPos[k].TravId = 0; pNew->pCos[k].TravId = 0;
if ( fDiscrete ) if ( fDiscrete )
{ {
for ( k = 0; k < p->nPis; k++ ) for ( k = 0; k < p->nCis; k++ )
pNew->pPis[k].timeArr = 0.0; // modify here pNew->pCis[k].timeArr = 0.0; // modify here
// modify the required times // modify the required times
} }
pNew->vDelayTables = Vec_PtrAlloc( 100 ); pNew->vDelayTables = Vec_PtrAlloc( 100 );
...@@ -215,16 +215,16 @@ Tim_Man_t * Tim_ManDupUnit( Tim_Man_t * p ) ...@@ -215,16 +215,16 @@ Tim_Man_t * Tim_ManDupUnit( Tim_Man_t * p )
Tim_Box_t * pBox; Tim_Box_t * pBox;
float * pDelayTableNew; float * pDelayTableNew;
int i, k; int i, k;
pNew = Tim_ManStart( p->nPis, p->nPos ); pNew = Tim_ManStart( p->nCis, p->nCos );
memcpy( pNew->pPis, p->pPis, sizeof(Tim_Obj_t) * p->nPis ); memcpy( pNew->pCis, p->pCis, sizeof(Tim_Obj_t) * p->nCis );
memcpy( pNew->pPos, p->pPos, sizeof(Tim_Obj_t) * p->nPos ); memcpy( pNew->pCos, p->pCos, sizeof(Tim_Obj_t) * p->nCos );
for ( k = 0; k < p->nPis; k++ ) for ( k = 0; k < p->nCis; k++ )
{ {
pNew->pPis[k].TravId = 0; pNew->pCis[k].TravId = 0;
pNew->pPis[k].timeArr = 0.0; pNew->pCis[k].timeArr = 0.0;
} }
for ( k = 0; k < p->nPos; k++ ) for ( k = 0; k < p->nCos; k++ )
pNew->pPos[k].TravId = 0; pNew->pCos[k].TravId = 0;
pNew->vDelayTables = Vec_PtrAlloc( 100 ); pNew->vDelayTables = Vec_PtrAlloc( 100 );
Tim_ManForEachBox( p, pBox, i ) Tim_ManForEachBox( p, pBox, i )
{ {
...@@ -254,14 +254,14 @@ Tim_Man_t * Tim_ManDupApprox( Tim_Man_t * p ) ...@@ -254,14 +254,14 @@ Tim_Man_t * Tim_ManDupApprox( Tim_Man_t * p )
{ {
Tim_Man_t * pNew; Tim_Man_t * pNew;
int k; int k;
pNew = Tim_ManStart( p->nPis, p->nPos ); pNew = Tim_ManStart( p->nCis, p->nCos );
for ( k = 0; k < p->nPis; k++ ) for ( k = 0; k < p->nCis; k++ )
if ( p->pPis[k].iObj2Box == -1 ) if ( p->pCis[k].iObj2Box == -1 )
pNew->pPis[k].timeArr = p->pPis[k].timeArr; pNew->pCis[k].timeArr = p->pCis[k].timeArr;
else else
pNew->pPis[k].timeArr = p->pPis[k].timeReq; pNew->pCis[k].timeArr = p->pCis[k].timeReq;
for ( k = 0; k < p->nPos; k++ ) for ( k = 0; k < p->nCos; k++ )
pNew->pPos[k].timeReq = p->pPos[k].timeReq; pNew->pCos[k].timeReq = p->pCos[k].timeReq;
return pNew; return pNew;
} }
...@@ -288,8 +288,8 @@ void Tim_ManStop( Tim_Man_t * p ) ...@@ -288,8 +288,8 @@ void Tim_ManStop( Tim_Man_t * p )
} }
Vec_PtrFree( p->vBoxes ); Vec_PtrFree( p->vBoxes );
Mem_FlexStop( p->pMemObj, 0 ); Mem_FlexStop( p->pMemObj, 0 );
free( p->pPis ); free( p->pCis );
free( p->pPos ); free( p->pCos );
free( p ); free( p );
} }
...@@ -310,9 +310,9 @@ void Tim_ManPrint( Tim_Man_t * p ) ...@@ -310,9 +310,9 @@ void Tim_ManPrint( Tim_Man_t * p )
Tim_Obj_t * pObj; Tim_Obj_t * pObj;
int i; int i;
printf( "TIMING INFORMATION:\n" ); printf( "TIMING INFORMATION:\n" );
Tim_ManForEachPi( p, pObj, i ) Tim_ManForEachCi( p, pObj, i )
printf( "pi%5d : arr = %5.3f req = %5.3f\n", i, pObj->timeArr, pObj->timeReq ); printf( "pi%5d : arr = %5.3f req = %5.3f\n", i, pObj->timeArr, pObj->timeReq );
Tim_ManForEachPo( p, pObj, i ) Tim_ManForEachCo( p, pObj, i )
printf( "po%5d : arr = %5.3f req = %5.3f\n", i, pObj->timeArr, pObj->timeReq ); printf( "po%5d : arr = %5.3f req = %5.3f\n", i, pObj->timeArr, pObj->timeReq );
Tim_ManForEachBox( p, pBox, i ) Tim_ManForEachBox( p, pBox, i )
{ {
...@@ -405,6 +405,84 @@ void Tim_ManSetCurrentTravIdBoxOutputs( Tim_Man_t * p, int iBox ) ...@@ -405,6 +405,84 @@ void Tim_ManSetCurrentTravIdBoxOutputs( Tim_Man_t * p, int iBox )
/**Function************************************************************* /**Function*************************************************************
Synopsis [Label box inputs.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Tim_ManSetPreviousTravIdBoxInputs( Tim_Man_t * p, int iBox )
{
Tim_Box_t * pBox;
Tim_Obj_t * pObj;
int i;
pBox = Tim_ManBox( p, iBox );
Tim_ManBoxForEachInput( p, pBox, pObj, i )
pObj->TravId = p->nTravIds - 1;
}
/**Function*************************************************************
Synopsis [Label box outputs.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Tim_ManSetPreviousTravIdBoxOutputs( Tim_Man_t * p, int iBox )
{
Tim_Box_t * pBox;
Tim_Obj_t * pObj;
int i;
pBox = Tim_ManBox( p, iBox );
Tim_ManBoxForEachOutput( p, pBox, pObj, i )
pObj->TravId = p->nTravIds - 1;
}
/**Function*************************************************************
Synopsis [Updates required time of the PO.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Tim_ManIsCiTravIdCurrent( Tim_Man_t * p, int iCi )
{
assert( iCi < p->nCis );
assert( p->fUseTravId );
return p->pCis[iCi].TravId == p->nTravIds;
}
/**Function*************************************************************
Synopsis [Updates required time of the PO.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Tim_ManIsCoTravIdCurrent( Tim_Man_t * p, int iCo )
{
assert( iCo < p->nCos );
assert( p->fUseTravId );
return p->pCos[iCo].TravId == p->nTravIds;
}
/**Function*************************************************************
Synopsis [Sets the vector of timing tables associated with the manager.] Synopsis [Sets the vector of timing tables associated with the manager.]
Description [] Description []
...@@ -444,17 +522,17 @@ void Tim_ManCreateBox( Tim_Man_t * p, int * pIns, int nIns, int * pOuts, int nOu ...@@ -444,17 +522,17 @@ void Tim_ManCreateBox( Tim_Man_t * p, int * pIns, int nIns, int * pOuts, int nOu
pBox->nOutputs = nOuts; pBox->nOutputs = nOuts;
for ( i = 0; i < nIns; i++ ) for ( i = 0; i < nIns; i++ )
{ {
assert( pIns[i] < p->nPos ); assert( pIns[i] < p->nCos );
pBox->Inouts[i] = pIns[i]; pBox->Inouts[i] = pIns[i];
p->pPos[pIns[i]].iObj2Box = pBox->iBox; p->pCos[pIns[i]].iObj2Box = pBox->iBox;
p->pPos[pIns[i]].iObj2Num = i; p->pCos[pIns[i]].iObj2Num = i;
} }
for ( i = 0; i < nOuts; i++ ) for ( i = 0; i < nOuts; i++ )
{ {
assert( pOuts[i] < p->nPis ); assert( pOuts[i] < p->nCis );
pBox->Inouts[nIns+i] = pOuts[i]; pBox->Inouts[nIns+i] = pOuts[i];
p->pPis[pOuts[i]].iObj2Box = pBox->iBox; p->pCis[pOuts[i]].iObj2Box = pBox->iBox;
p->pPis[pOuts[i]].iObj2Num = i; p->pCis[pOuts[i]].iObj2Num = i;
} }
} }
...@@ -482,17 +560,17 @@ void Tim_ManCreateBoxFirst( Tim_Man_t * p, int firstIn, int nIns, int firstOut, ...@@ -482,17 +560,17 @@ void Tim_ManCreateBoxFirst( Tim_Man_t * p, int firstIn, int nIns, int firstOut,
pBox->nOutputs = nOuts; pBox->nOutputs = nOuts;
for ( i = 0; i < nIns; i++ ) for ( i = 0; i < nIns; i++ )
{ {
assert( firstIn+i < p->nPos ); assert( firstIn+i < p->nCos );
pBox->Inouts[i] = firstIn+i; pBox->Inouts[i] = firstIn+i;
p->pPos[firstIn+i].iObj2Box = pBox->iBox; p->pCos[firstIn+i].iObj2Box = pBox->iBox;
p->pPos[firstIn+i].iObj2Num = i; p->pCos[firstIn+i].iObj2Num = i;
} }
for ( i = 0; i < nOuts; i++ ) for ( i = 0; i < nOuts; i++ )
{ {
assert( firstOut+i < p->nPis ); assert( firstOut+i < p->nCis );
pBox->Inouts[nIns+i] = firstOut+i; pBox->Inouts[nIns+i] = firstOut+i;
p->pPis[firstOut+i].iObj2Box = pBox->iBox; p->pCis[firstOut+i].iObj2Box = pBox->iBox;
p->pPis[firstOut+i].iObj2Num = i; p->pCis[firstOut+i].iObj2Num = i;
} }
} }
...@@ -515,10 +593,10 @@ void Tim_ManIncrementTravId( Tim_Man_t * p ) ...@@ -515,10 +593,10 @@ void Tim_ManIncrementTravId( Tim_Man_t * p )
if ( p->nTravIds >= (1<<30)-1 ) if ( p->nTravIds >= (1<<30)-1 )
{ {
p->nTravIds = 0; p->nTravIds = 0;
for ( i = 0; i < p->nPis; i++ ) for ( i = 0; i < p->nCis; i++ )
p->pPis[i].TravId = 0; p->pCis[i].TravId = 0;
for ( i = 0; i < p->nPos; i++ ) for ( i = 0; i < p->nCos; i++ )
p->pPos[i].TravId = 0; p->pCos[i].TravId = 0;
} }
assert( p->nTravIds < (1<<30)-1 ); assert( p->nTravIds < (1<<30)-1 );
p->nTravIds++; p->nTravIds++;
...@@ -535,10 +613,10 @@ void Tim_ManIncrementTravId( Tim_Man_t * p ) ...@@ -535,10 +613,10 @@ void Tim_ManIncrementTravId( Tim_Man_t * p )
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
void Tim_ManInitPiArrival( Tim_Man_t * p, int iPi, float Delay ) void Tim_ManInitCiArrival( Tim_Man_t * p, int iCi, float Delay )
{ {
assert( iPi < p->nPis ); assert( iCi < p->nCis );
p->pPis[iPi].timeArr = Delay; p->pCis[iCi].timeArr = Delay;
} }
/**Function************************************************************* /**Function*************************************************************
...@@ -552,10 +630,10 @@ void Tim_ManInitPiArrival( Tim_Man_t * p, int iPi, float Delay ) ...@@ -552,10 +630,10 @@ void Tim_ManInitPiArrival( Tim_Man_t * p, int iPi, float Delay )
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
void Tim_ManInitPoRequired( Tim_Man_t * p, int iPo, float Delay ) void Tim_ManInitCoRequired( Tim_Man_t * p, int iCo, float Delay )
{ {
assert( iPo < p->nPos ); assert( iCo < p->nCos );
p->pPos[iPo].timeReq = Delay; p->pCos[iCo].timeReq = Delay;
} }
/**Function************************************************************* /**Function*************************************************************
...@@ -569,12 +647,12 @@ void Tim_ManInitPoRequired( Tim_Man_t * p, int iPo, float Delay ) ...@@ -569,12 +647,12 @@ void Tim_ManInitPoRequired( Tim_Man_t * p, int iPo, float Delay )
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
void Tim_ManSetPoArrival( Tim_Man_t * p, int iPo, float Delay ) void Tim_ManSetCoArrival( Tim_Man_t * p, int iCo, float Delay )
{ {
assert( iPo < p->nPos ); assert( iCo < p->nCos );
assert( !p->fUseTravId || p->pPos[iPo].TravId != p->nTravIds ); assert( !p->fUseTravId || p->pCos[iCo].TravId != p->nTravIds );
p->pPos[iPo].timeArr = Delay; p->pCos[iCo].timeArr = Delay;
p->pPos[iPo].TravId = p->nTravIds; p->pCos[iCo].TravId = p->nTravIds;
} }
/**Function************************************************************* /**Function*************************************************************
...@@ -588,12 +666,12 @@ void Tim_ManSetPoArrival( Tim_Man_t * p, int iPo, float Delay ) ...@@ -588,12 +666,12 @@ void Tim_ManSetPoArrival( Tim_Man_t * p, int iPo, float Delay )
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
void Tim_ManSetPiRequired( Tim_Man_t * p, int iPi, float Delay ) void Tim_ManSetCiRequired( Tim_Man_t * p, int iCi, float Delay )
{ {
assert( iPi < p->nPis ); assert( iCi < p->nCis );
assert( !p->fUseTravId || p->pPis[iPi].TravId != p->nTravIds ); assert( !p->fUseTravId || p->pCis[iCi].TravId != p->nTravIds );
p->pPis[iPi].timeReq = Delay; p->pCis[iCi].timeReq = Delay;
p->pPis[iPi].TravId = p->nTravIds; p->pCis[iCi].TravId = p->nTravIds;
} }
/**Function************************************************************* /**Function*************************************************************
...@@ -607,12 +685,12 @@ void Tim_ManSetPiRequired( Tim_Man_t * p, int iPi, float Delay ) ...@@ -607,12 +685,12 @@ void Tim_ManSetPiRequired( Tim_Man_t * p, int iPi, float Delay )
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
void Tim_ManSetPoRequired( Tim_Man_t * p, int iPo, float Delay ) void Tim_ManSetCoRequired( Tim_Man_t * p, int iCo, float Delay )
{ {
assert( iPo < p->nPos ); assert( iCo < p->nCos );
assert( !p->fUseTravId || p->pPos[iPo].TravId != p->nTravIds ); assert( !p->fUseTravId || p->pCos[iCo].TravId != p->nTravIds );
p->pPos[iPo].timeReq = Delay; p->pCos[iCo].timeReq = Delay;
p->pPos[iPo].TravId = p->nTravIds; p->pCos[iCo].TravId = p->nTravIds;
} }
/**Function************************************************************* /**Function*************************************************************
...@@ -626,12 +704,12 @@ void Tim_ManSetPoRequired( Tim_Man_t * p, int iPo, float Delay ) ...@@ -626,12 +704,12 @@ void Tim_ManSetPoRequired( Tim_Man_t * p, int iPo, float Delay )
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
void Tim_ManSetPoRequiredAll( Tim_Man_t * p, float Delay ) void Tim_ManSetCoRequiredAll( Tim_Man_t * p, float Delay )
{ {
Tim_Obj_t * pObj; Tim_Obj_t * pObj;
int i; int i;
Tim_ManForEachPo( p, pObj, i ) Tim_ManForEachCo( p, pObj, i )
Tim_ManSetPoRequired( p, i, Delay ); Tim_ManSetCoRequired( p, i, Delay );
} }
...@@ -646,19 +724,19 @@ void Tim_ManSetPoRequiredAll( Tim_Man_t * p, float Delay ) ...@@ -646,19 +724,19 @@ void Tim_ManSetPoRequiredAll( Tim_Man_t * p, float Delay )
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
float Tim_ManGetPiArrival( Tim_Man_t * p, int iPi ) float Tim_ManGetCiArrival( Tim_Man_t * p, int iCi )
{ {
Tim_Box_t * pBox; Tim_Box_t * pBox;
Tim_Obj_t * pObjThis, * pObj, * pObjRes; Tim_Obj_t * pObjThis, * pObj, * pObjRes;
float * pDelays, DelayBest; float * pDelays, DelayBest;
int i, k; int i, k;
// consider the already processed PI // consider the already processed PI
pObjThis = Tim_ManPi( p, iPi ); pObjThis = Tim_ManCi( p, iCi );
if ( p->fUseTravId && pObjThis->TravId == p->nTravIds ) if ( p->fUseTravId && pObjThis->TravId == p->nTravIds )
return pObjThis->timeArr; return pObjThis->timeArr;
pObjThis->TravId = p->nTravIds; pObjThis->TravId = p->nTravIds;
// consider the main PI // consider the main PI
pBox = Tim_ManPiBox( p, iPi ); pBox = Tim_ManCiBox( p, iCi );
if ( pBox == NULL ) if ( pBox == NULL )
return pObjThis->timeArr; return pObjThis->timeArr;
// update box timing // update box timing
...@@ -667,12 +745,12 @@ float Tim_ManGetPiArrival( Tim_Man_t * p, int iPi ) ...@@ -667,12 +745,12 @@ float Tim_ManGetPiArrival( Tim_Man_t * p, int iPi )
if ( p->fUseTravId ) if ( p->fUseTravId )
Tim_ManBoxForEachInput( p, pBox, pObj, i ) Tim_ManBoxForEachInput( p, pBox, pObj, i )
if ( pObj->TravId != p->nTravIds ) if ( pObj->TravId != p->nTravIds )
printf( "Tim_ManGetPiArrival(): Input arrival times of the box are not up to date!\n" ); printf( "Tim_ManGetCiArrival(): Input arrival times of the box are not up to date!\n" );
// compute the arrival times for each output of the box (PIs) // compute the arrival times for each output of the box (PIs)
Tim_ManBoxForEachOutput( p, pBox, pObjRes, i ) Tim_ManBoxForEachOutput( p, pBox, pObjRes, i )
{ {
pDelays = pBox->pDelayTable + i * pBox->nInputs; pDelays = pBox->pDelayTable + i * pBox->nInputs;
DelayBest = -TIME_ETERNITY; DelayBest = -TIM_ETERNITY;
Tim_ManBoxForEachInput( p, pBox, pObj, k ) Tim_ManBoxForEachInput( p, pBox, pObj, k )
DelayBest = AIG_MAX( DelayBest, pObj->timeArr + pDelays[k] ); DelayBest = AIG_MAX( DelayBest, pObj->timeArr + pDelays[k] );
pObjRes->timeArr = DelayBest; pObjRes->timeArr = DelayBest;
...@@ -692,19 +770,19 @@ float Tim_ManGetPiArrival( Tim_Man_t * p, int iPi ) ...@@ -692,19 +770,19 @@ float Tim_ManGetPiArrival( Tim_Man_t * p, int iPi )
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
float Tim_ManGetPoRequired( Tim_Man_t * p, int iPo ) float Tim_ManGetCoRequired( Tim_Man_t * p, int iCo )
{ {
Tim_Box_t * pBox; Tim_Box_t * pBox;
Tim_Obj_t * pObjThis, * pObj, * pObjRes; Tim_Obj_t * pObjThis, * pObj, * pObjRes;
float * pDelays, DelayBest; float * pDelays, DelayBest;
int i, k; int i, k;
// consider the already processed PO // consider the already processed PO
pObjThis = Tim_ManPo( p, iPo ); pObjThis = Tim_ManCo( p, iCo );
if ( p->fUseTravId && pObjThis->TravId == p->nTravIds ) if ( p->fUseTravId && pObjThis->TravId == p->nTravIds )
return pObjThis->timeReq; return pObjThis->timeReq;
pObjThis->TravId = p->nTravIds; pObjThis->TravId = p->nTravIds;
// consider the main PO // consider the main PO
pBox = Tim_ManPoBox( p, iPo ); pBox = Tim_ManCoBox( p, iCo );
if ( pBox == NULL ) if ( pBox == NULL )
return pObjThis->timeReq; return pObjThis->timeReq;
// update box timing // update box timing
...@@ -713,11 +791,11 @@ float Tim_ManGetPoRequired( Tim_Man_t * p, int iPo ) ...@@ -713,11 +791,11 @@ float Tim_ManGetPoRequired( Tim_Man_t * p, int iPo )
if ( p->fUseTravId ) if ( p->fUseTravId )
Tim_ManBoxForEachOutput( p, pBox, pObj, i ) Tim_ManBoxForEachOutput( p, pBox, pObj, i )
if ( pObj->TravId != p->nTravIds ) if ( pObj->TravId != p->nTravIds )
printf( "Tim_ManGetPoRequired(): Output required times of the box are not up to date!\n" ); printf( "Tim_ManGetCoRequired(): Output required times of the box are not up to date!\n" );
// compute the required times for each input of the box (POs) // compute the required times for each input of the box (POs)
Tim_ManBoxForEachInput( p, pBox, pObjRes, i ) Tim_ManBoxForEachInput( p, pBox, pObjRes, i )
{ {
DelayBest = TIME_ETERNITY; DelayBest = TIM_ETERNITY;
Tim_ManBoxForEachOutput( p, pBox, pObj, k ) Tim_ManBoxForEachOutput( p, pBox, pObj, k )
{ {
pDelays = pBox->pDelayTable + k * pBox->nInputs; pDelays = pBox->pDelayTable + k * pBox->nInputs;
...@@ -742,9 +820,9 @@ float Tim_ManGetPoRequired( Tim_Man_t * p, int iPo ) ...@@ -742,9 +820,9 @@ float Tim_ManGetPoRequired( Tim_Man_t * p, int iPo )
***********************************************************************/ ***********************************************************************/
int Tim_ManBoxForCi( Tim_Man_t * p, int iCi ) int Tim_ManBoxForCi( Tim_Man_t * p, int iCi )
{ {
if ( iCi >= p->nPis ) if ( iCi >= p->nCis )
return -1; return -1;
return p->pPis[iCi].iObj2Box; return p->pCis[iCi].iObj2Box;
} }
/**Function************************************************************* /**Function*************************************************************
...@@ -760,9 +838,9 @@ int Tim_ManBoxForCi( Tim_Man_t * p, int iCi ) ...@@ -760,9 +838,9 @@ int Tim_ManBoxForCi( Tim_Man_t * p, int iCi )
***********************************************************************/ ***********************************************************************/
int Tim_ManBoxForCo( Tim_Man_t * p, int iCo ) int Tim_ManBoxForCo( Tim_Man_t * p, int iCo )
{ {
if ( iCo >= p->nPos ) if ( iCo >= p->nCos )
return -1; return -1;
return p->pPos[iCo].iObj2Box; return p->pCos[iCo].iObj2Box;
} }
/**Function************************************************************* /**Function*************************************************************
......
...@@ -43,7 +43,7 @@ typedef struct Tim_Man_t_ Tim_Man_t; ...@@ -43,7 +43,7 @@ typedef struct Tim_Man_t_ Tim_Man_t;
/// MACRO DEFINITIONS /// /// MACRO DEFINITIONS ///
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
#define TIME_ETERNITY 10000 #define TIM_ETERNITY 10000
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
/// ITERATORS /// /// ITERATORS ///
...@@ -58,7 +58,7 @@ typedef struct Tim_Man_t_ Tim_Man_t; ...@@ -58,7 +58,7 @@ typedef struct Tim_Man_t_ Tim_Man_t;
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
/*=== time.c ===========================================================*/ /*=== time.c ===========================================================*/
extern Tim_Man_t * Tim_ManStart( int nPis, int nPos ); extern Tim_Man_t * Tim_ManStart( int nCis, int nCos );
extern Tim_Man_t * Tim_ManDup( Tim_Man_t * p, int fDiscrete ); extern Tim_Man_t * Tim_ManDup( Tim_Man_t * p, int fDiscrete );
extern Tim_Man_t * Tim_ManDupUnit( Tim_Man_t * p ); extern Tim_Man_t * Tim_ManDupUnit( Tim_Man_t * p );
extern Tim_Man_t * Tim_ManDupApprox( Tim_Man_t * p ); extern Tim_Man_t * Tim_ManDupApprox( Tim_Man_t * p );
...@@ -68,18 +68,22 @@ extern void Tim_ManTravIdDisable( Tim_Man_t * p ); ...@@ -68,18 +68,22 @@ extern void Tim_ManTravIdDisable( Tim_Man_t * p );
extern void Tim_ManTravIdEnable( Tim_Man_t * p ); extern void Tim_ManTravIdEnable( Tim_Man_t * p );
extern void Tim_ManSetCurrentTravIdBoxInputs( Tim_Man_t * p, int iBox ); extern void Tim_ManSetCurrentTravIdBoxInputs( Tim_Man_t * p, int iBox );
extern void Tim_ManSetCurrentTravIdBoxOutputs( Tim_Man_t * p, int iBox ); extern void Tim_ManSetCurrentTravIdBoxOutputs( Tim_Man_t * p, int iBox );
extern void Tim_ManSetPreviousTravIdBoxInputs( Tim_Man_t * p, int iBox );
extern void Tim_ManSetPreviousTravIdBoxOutputs( Tim_Man_t * p, int iBox );
extern int Tim_ManIsCiTravIdCurrent( Tim_Man_t * p, int iCi );
extern int Tim_ManIsCoTravIdCurrent( Tim_Man_t * p, int iCo );
extern void Tim_ManSetDelayTables( Tim_Man_t * p, Vec_Ptr_t * vDelayTables ); extern void Tim_ManSetDelayTables( Tim_Man_t * p, Vec_Ptr_t * vDelayTables );
extern void Tim_ManCreateBox( Tim_Man_t * p, int * pIns, int nIns, int * pOuts, int nOuts, float * pDelayTable ); extern void Tim_ManCreateBox( Tim_Man_t * p, int * pIns, int nIns, int * pOuts, int nOuts, float * pDelayTable );
extern void Tim_ManCreateBoxFirst( Tim_Man_t * p, int firstIn, int nIns, int firstOut, int nOuts, float * pDelayTable ); extern void Tim_ManCreateBoxFirst( Tim_Man_t * p, int firstIn, int nIns, int firstOut, int nOuts, float * pDelayTable );
extern void Tim_ManIncrementTravId( Tim_Man_t * p ); extern void Tim_ManIncrementTravId( Tim_Man_t * p );
extern void Tim_ManInitPiArrival( Tim_Man_t * p, int iPi, float Delay ); extern void Tim_ManInitCiArrival( Tim_Man_t * p, int iCi, float Delay );
extern void Tim_ManInitPoRequired( Tim_Man_t * p, int iPo, float Delay ); extern void Tim_ManInitCoRequired( Tim_Man_t * p, int iCo, float Delay );
extern void Tim_ManSetPoArrival( Tim_Man_t * p, int iPo, float Delay ); extern void Tim_ManSetCoArrival( Tim_Man_t * p, int iCo, float Delay );
extern void Tim_ManSetPiRequired( Tim_Man_t * p, int iPi, float Delay ); extern void Tim_ManSetCiRequired( Tim_Man_t * p, int iCi, float Delay );
extern void Tim_ManSetPoRequired( Tim_Man_t * p, int iPo, float Delay ); extern void Tim_ManSetCoRequired( Tim_Man_t * p, int iCo, float Delay );
extern void Tim_ManSetPoRequiredAll( Tim_Man_t * p, float Delay ); extern void Tim_ManSetCoRequiredAll( Tim_Man_t * p, float Delay );
extern float Tim_ManGetPiArrival( Tim_Man_t * p, int iPi ); extern float Tim_ManGetCiArrival( Tim_Man_t * p, int iCi );
extern float Tim_ManGetPoRequired( Tim_Man_t * p, int iPo ); extern float Tim_ManGetCoRequired( Tim_Man_t * p, int iCo );
extern int Tim_ManBoxForCi( Tim_Man_t * p, int iCo ); extern int Tim_ManBoxForCi( Tim_Man_t * p, int iCo );
extern int Tim_ManBoxForCo( Tim_Man_t * p, int iCi ); extern int Tim_ManBoxForCo( Tim_Man_t * p, int iCi );
extern int Tim_ManBoxInputFirst( Tim_Man_t * p, int iBox ); extern int Tim_ManBoxInputFirst( Tim_Man_t * p, int iBox );
......
...@@ -15780,7 +15780,7 @@ int Abc_CommandAbc8Cec( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -15780,7 +15780,7 @@ int Abc_CommandAbc8Cec( Abc_Frame_t * pAbc, int argc, char ** argv )
nConfLimit = 10000; nConfLimit = 10000;
nPartSize = 100; nPartSize = 100;
fSmart = 0; fSmart = 0;
fVerbose = 0; fVerbose = 0;
Extra_UtilGetoptReset(); Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "CPsvh" ) ) != EOF ) while ( ( c = Extra_UtilGetopt( argc, argv, "CPsvh" ) ) != EOF )
{ {
......
...@@ -293,13 +293,13 @@ int If_ManPerformMappingRound( If_Man_t * p, int nCutsUsed, int Mode, int fPrepr ...@@ -293,13 +293,13 @@ int If_ManPerformMappingRound( If_Man_t * p, int nCutsUsed, int Mode, int fPrepr
} }
else if ( If_ObjIsCi(pObj) ) else if ( If_ObjIsCi(pObj) )
{ {
arrTime = Tim_ManGetPiArrival( p->pManTim, pObj->IdPio ); arrTime = Tim_ManGetCiArrival( p->pManTim, pObj->IdPio );
If_ObjSetArrTime( pObj, arrTime ); If_ObjSetArrTime( pObj, arrTime );
} }
else if ( If_ObjIsCo(pObj) ) else if ( If_ObjIsCo(pObj) )
{ {
arrTime = If_ObjArrTime( If_ObjFanin0(pObj) ); arrTime = If_ObjArrTime( If_ObjFanin0(pObj) );
Tim_ManSetPoArrival( p->pManTim, pObj->IdPio, arrTime ); Tim_ManSetCoArrival( p->pManTim, pObj->IdPio, arrTime );
} }
else if ( If_ObjIsConst1(pObj) ) else if ( If_ObjIsConst1(pObj) )
{ {
......
...@@ -234,15 +234,15 @@ void If_ManComputeRequired( If_Man_t * p ) ...@@ -234,15 +234,15 @@ void If_ManComputeRequired( If_Man_t * p )
{ {
assert( 0 ); assert( 0 );
If_ManForEachPo( p, pObj, i ) If_ManForEachPo( p, pObj, i )
Tim_ManSetPoRequired( p->pManTim, pObj->IdPio, IF_FLOAT_LARGE ); Tim_ManSetCoRequired( p->pManTim, pObj->IdPio, IF_FLOAT_LARGE );
If_ManForEachLatchInput( p, pObj, i ) If_ManForEachLatchInput( p, pObj, i )
Tim_ManSetPoRequired( p->pManTim, pObj->IdPio, p->RequiredGlo ); Tim_ManSetCoRequired( p->pManTim, pObj->IdPio, p->RequiredGlo );
} }
else else
{ {
Tim_ManSetPoRequiredAll( p->pManTim, p->RequiredGlo ); Tim_ManSetCoRequiredAll( p->pManTim, p->RequiredGlo );
// If_ManForEachCo( p, pObj, i ) // If_ManForEachCo( p, pObj, i )
// Tim_ManSetPoRequired( p->pManTim, pObj->IdPio, p->RequiredGlo ); // Tim_ManSetCoRequired( p->pManTim, pObj->IdPio, p->RequiredGlo );
} }
// go through the nodes in the reverse topological order // go through the nodes in the reverse topological order
If_ManForEachObjReverse( p, pObj, i ) If_ManForEachObjReverse( p, pObj, i )
...@@ -256,11 +256,11 @@ void If_ManComputeRequired( If_Man_t * p ) ...@@ -256,11 +256,11 @@ void If_ManComputeRequired( If_Man_t * p )
else if ( If_ObjIsCi(pObj) ) else if ( If_ObjIsCi(pObj) )
{ {
reqTime = pObj->Required; reqTime = pObj->Required;
Tim_ManSetPiRequired( p->pManTim, pObj->IdPio, reqTime ); Tim_ManSetCiRequired( p->pManTim, pObj->IdPio, reqTime );
} }
else if ( If_ObjIsCo(pObj) ) else if ( If_ObjIsCo(pObj) )
{ {
reqTime = Tim_ManGetPoRequired( p->pManTim, pObj->IdPio ); reqTime = Tim_ManGetCoRequired( p->pManTim, pObj->IdPio );
If_ObjFanin0(pObj)->Required = IF_MIN( reqTime, If_ObjFanin0(pObj)->Required ); If_ObjFanin0(pObj)->Required = IF_MIN( reqTime, If_ObjFanin0(pObj)->Required );
} }
else if ( If_ObjIsConst1(pObj) ) else if ( If_ObjIsConst1(pObj) )
......
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