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
Vec_PtrWriteEntry( vSuper, RightBound, pObj3 );
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 );
if ( Aig_TableLookup( p, pGhost ) )
{
......@@ -394,7 +402,7 @@ Aig_Man_t * Dar_ManBalance( Aig_Man_t * p, int fUpdateLevel )
pObjNew = Aig_ObjCreatePi(pNew);
pObj->pData = pObjNew;
// 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;
}
else if ( Aig_ObjIsPo(pObj) )
......@@ -406,7 +414,7 @@ Aig_Man_t * Dar_ManBalance( Aig_Man_t * p, int fUpdateLevel )
Aig_ObjCreatePo( pNew, pObjNew );
// save arrival time of the output
arrTime = (float)Aig_Regular(pObjNew)->Level;
Tim_ManSetPoArrival( p->pManTime, Aig_ObjPioNum(pObj), arrTime );
Tim_ManSetCoArrival( p->pManTime, Aig_ObjPioNum(pObj), arrTime );
}
else
assert( 0 );
......
......@@ -600,10 +600,21 @@ p->timeOther = p->timeTotal - p->timeCuts - p->timeEval;
Aig_ManFanoutStop( pAig );
if ( p->pPars->fUpdateLevel )
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
Dar_ManRefStop( p );
Aig_ManCheckPhase( pAig );
// Aig_ManCheckPhase( pAig );
if ( !Aig_ManCheck( pAig ) )
{
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 )
// add box inputs/outputs to COs/CIs
if ( Ntl_ObjIsBox(pObj) )
{
int LevelCur, LevelMax = -TIME_ETERNITY;
int LevelCur, LevelMax = -TIM_ETERNITY;
Vec_IntPush( p->vBox1Cos, Aig_ManPoNum(p->pAig) );
Ntl_ObjForEachFanin( pObj, pNetFanin, i )
{
......
......@@ -974,9 +974,9 @@ static int Ioa_ReadParseLineTimes( Ioa_ReadMod_t * p, char * pLine, int fOutput
// find the delay number
pTokenNum = Vec_PtrEntryLast(vTokens);
if ( !strcmp( pTokenNum, "-inf" ) )
Delay = -TIME_ETERNITY;
Delay = -TIM_ETERNITY;
else if ( !strcmp( pTokenNum, "inf" ) )
Delay = TIME_ETERNITY;
Delay = TIM_ETERNITY;
else
Delay = atof( pTokenNum );
if ( Delay == 0.0 && pTokenNum[0] != '0' )
......
......@@ -90,11 +90,11 @@ Tim_Man_t * Ntl_ManCreateTiming( Ntl_Man_t * p )
// unpack the data in the arrival times
if ( pRoot->vArrivals )
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
if ( pRoot->vRequireds )
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
vDelayTables = Vec_PtrAlloc( Vec_PtrSize(p->vModels) );
Ntl_ManForEachModel( p, pModel, i )
......
......@@ -114,14 +114,14 @@ int Nwk_ManLevelBackup( Nwk_Man_t * pNtk )
{
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 );
}
else if ( Nwk_ObjIsCo(pObj) )
{
Level = Nwk_ObjLevel( Nwk_ObjFanin0(pObj) );
if ( pManTimeUnit )
Tim_ManSetPoArrival( pManTimeUnit, pObj->PioId, (float)Level );
Tim_ManSetCoArrival( pManTimeUnit, pObj->PioId, (float)Level );
Nwk_ObjSetLevel( pObj, Level );
if ( LevelMax < Nwk_ObjLevel(pObj) )
LevelMax = Nwk_ObjLevel(pObj);
......
......@@ -52,7 +52,7 @@ void Nwk_ManSetIfParsDefault( If_Par_t * pPars )
pPars->nFlowIters = 1;
pPars->nAreaIters = 2;
pPars->DelayTarget = -1;
pPars->Epsilon = (float)0.001;
pPars->Epsilon = (float)0.005;
pPars->fPreprocess = 1;
pPars->fArea = 0;
pPars->fFancy = 0;
......
......@@ -114,14 +114,14 @@ Aig_Man_t * Nwk_ManStrash( Nwk_Man_t * pNtk )
if ( Nwk_ObjIsCi(pObj) )
{
pObjNew = Aig_ObjCreatePi(pMan);
Level = Tim_ManGetPiArrival( pMan->pManTime, pObj->PioId );
Level = Tim_ManGetCiArrival( pMan->pManTime, pObj->PioId );
Aig_ObjSetLevel( pObjNew, Level );
}
else if ( Nwk_ObjIsCo(pObj) )
{
pObjNew = Aig_ObjCreatePo( pMan, Aig_NotCond(Nwk_ObjFanin0(pObj)->pCopy, pObj->fCompl) );
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) )
{
......
......@@ -43,7 +43,7 @@ typedef struct Tim_Man_t_ Tim_Man_t;
/// MACRO DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
#define TIME_ETERNITY 10000
#define TIM_ETERNITY 10000
////////////////////////////////////////////////////////////////////////
/// ITERATORS ///
......@@ -58,7 +58,7 @@ typedef struct Tim_Man_t_ Tim_Man_t;
////////////////////////////////////////////////////////////////////////
/*=== 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_ManDupUnit( 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 );
extern void Tim_ManTravIdEnable( Tim_Man_t * p );
extern void Tim_ManSetCurrentTravIdBoxInputs( 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_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_ManIncrementTravId( Tim_Man_t * p );
extern void Tim_ManInitPiArrival( Tim_Man_t * p, int iPi, float Delay );
extern void Tim_ManInitPoRequired( Tim_Man_t * p, int iPo, float Delay );
extern void Tim_ManSetPoArrival( Tim_Man_t * p, int iPo, float Delay );
extern void Tim_ManSetPiRequired( Tim_Man_t * p, int iPi, float Delay );
extern void Tim_ManSetPoRequired( Tim_Man_t * p, int iPo, float Delay );
extern void Tim_ManSetPoRequiredAll( Tim_Man_t * p, float Delay );
extern float Tim_ManGetPiArrival( Tim_Man_t * p, int iPi );
extern float Tim_ManGetPoRequired( Tim_Man_t * p, int iPo );
extern void Tim_ManInitCiArrival( Tim_Man_t * p, int iCi, float Delay );
extern void Tim_ManInitCoRequired( Tim_Man_t * p, int iCo, float Delay );
extern void Tim_ManSetCoArrival( Tim_Man_t * p, int iCo, float Delay );
extern void Tim_ManSetCiRequired( Tim_Man_t * p, int iCi, float Delay );
extern void Tim_ManSetCoRequired( Tim_Man_t * p, int iCo, float Delay );
extern void Tim_ManSetCoRequiredAll( Tim_Man_t * p, float Delay );
extern float Tim_ManGetCiArrival( Tim_Man_t * p, int iCi );
extern float Tim_ManGetCoRequired( 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_ManBoxInputFirst( Tim_Man_t * p, int iBox );
......
......@@ -15780,7 +15780,7 @@ int Abc_CommandAbc8Cec( Abc_Frame_t * pAbc, int argc, char ** argv )
nConfLimit = 10000;
nPartSize = 100;
fSmart = 0;
fVerbose = 0;
fVerbose = 0;
Extra_UtilGetoptReset();
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
}
else if ( If_ObjIsCi(pObj) )
{
arrTime = Tim_ManGetPiArrival( p->pManTim, pObj->IdPio );
arrTime = Tim_ManGetCiArrival( p->pManTim, pObj->IdPio );
If_ObjSetArrTime( pObj, arrTime );
}
else if ( If_ObjIsCo(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) )
{
......
......@@ -234,15 +234,15 @@ void If_ManComputeRequired( If_Man_t * p )
{
assert( 0 );
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 )
Tim_ManSetPoRequired( p->pManTim, pObj->IdPio, p->RequiredGlo );
Tim_ManSetCoRequired( p->pManTim, pObj->IdPio, p->RequiredGlo );
}
else
{
Tim_ManSetPoRequiredAll( p->pManTim, p->RequiredGlo );
Tim_ManSetCoRequiredAll( p->pManTim, p->RequiredGlo );
// 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
If_ManForEachObjReverse( p, pObj, i )
......@@ -256,11 +256,11 @@ void If_ManComputeRequired( If_Man_t * p )
else if ( If_ObjIsCi(pObj) )
{
reqTime = pObj->Required;
Tim_ManSetPiRequired( p->pManTim, pObj->IdPio, reqTime );
Tim_ManSetCiRequired( p->pManTim, pObj->IdPio, reqTime );
}
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 );
}
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