diff options
Diffstat (limited to 'src/base/acb')
-rw-r--r-- | src/base/acb/acb.h | 3 | ||||
-rw-r--r-- | src/base/acb/acbMfs.c | 25 | ||||
-rw-r--r-- | src/base/acb/acbUtil.c | 42 |
3 files changed, 48 insertions, 22 deletions
diff --git a/src/base/acb/acb.h b/src/base/acb/acb.h index 17962dc8..7c228acb 100644 --- a/src/base/acb/acb.h +++ b/src/base/acb/acb.h @@ -92,6 +92,7 @@ struct Acb_Ntk_t_ Vec_Wec_t vFanouts; // fanouts Vec_Wec_t vCnfs; // CNF Vec_Str_t vCnf; // CNF + Vec_Int_t vSuppOld; // previous support // other Vec_Que_t * vQue; // temporary Vec_Int_t vCover; // temporary @@ -574,6 +575,7 @@ static inline void Acb_NtkFree( Acb_Ntk_t * p ) Vec_WecErase( &p->vFanouts ); Vec_WecErase( &p->vCnfs ); Vec_StrErase( &p->vCnf ); + Vec_IntErase( &p->vSuppOld ); // other Vec_QueFreeP( &p->vQue ); Vec_IntErase( &p->vCover ); @@ -972,6 +974,7 @@ extern int Acb_NtkComputeLevelD( Acb_Ntk_t * p, Vec_Int_t * vTfo ); extern void Acb_NtkUpdateLevelD( Acb_Ntk_t * p, int iObj ); extern void Acb_NtkUpdateTiming( Acb_Ntk_t * p, int iObj ); +extern void Acb_NtkPrintNode( Acb_Ntk_t * p, int iObj ); extern int Acb_NtkCreateNode( Acb_Ntk_t * p, word uTruth, Vec_Int_t * vSupp ); extern void Acb_NtkUpdateNode( Acb_Ntk_t * p, int Pivot, word uTruth, Vec_Int_t * vSupp ); diff --git a/src/base/acb/acbMfs.c b/src/base/acb/acbMfs.c index a17a179a..d8c6fb16 100644 --- a/src/base/acb/acbMfs.c +++ b/src/base/acb/acbMfs.c @@ -433,14 +433,6 @@ void Acb_NtkPrintVec( Acb_Ntk_t * p, Vec_Int_t * vVec, char * pName ) printf( "%d ", vVec->pArray[i] ); printf( "\n" ); } -void Acb_NtkPrintNode( Acb_Ntk_t * p, int Node ) -{ - int k, iFanin, * pFanins; - printf( "Node %d : ", Node ); - Acb_ObjForEachFaninFast( p, Node, pFanins, iFanin, k ) - printf( "%d ", iFanin ); - printf( "\n" ); -} void Acb_NtkPrintVec2( Acb_Ntk_t * p, Vec_Int_t * vVec, char * pName ) { int i; @@ -486,7 +478,8 @@ Vec_Int_t * Acb_NtkDivisors( Acb_Ntk_t * p, int Pivot, int nTfiLevMin, int fDela int k, iFanin, * pFanins; Vec_Int_t * vDivs = Vec_IntAlloc( 100 ); Acb_NtkIncTravId( p ); - if ( fDelay ) // delay-oriented +// if ( fDelay ) // delay-oriented + if ( 0 ) // delay-oriented { // start from critical fanins assert( Acb_ObjLevelD( p, Pivot ) > 1 ); @@ -805,7 +798,7 @@ Vec_Int_t * Acb_NtkWindow( Acb_Ntk_t * p, int Pivot, int nTfiLevs, int nTfoLevs, // mark limited TFO of the divisors vMarked = Acb_ObjMarkTfo( p, vDivs, Pivot, nTfoLevMax, nFanMax ); // collect TFO and roots - Acb_ObjDeriveTfo( p, Pivot, nTfoLevMax, nFanMax, &vTfo, &vRoots, fDelay ); + Acb_ObjDeriveTfo( p, Pivot, nTfoLevMax, nFanMax, &vTfo, &vRoots, 0 );//fDelay ); if ( fVerbose ) Acb_NtkPrintVec( p, vTfo, "vTfo" ); if ( fVerbose ) Acb_NtkPrintVec( p, vRoots, "vRoots" ); // collect side inputs of the TFO @@ -1599,8 +1592,8 @@ void Acb_NtkOpt( Acb_Ntk_t * pNtk, Acb_Par_t * pPars ) if ( iObj < nNodes && !Vec_BitEntry(vVisited, iObj) && Acb_NtkObjMffcEstimate(pNtk, iObj) >= n ) { pMan->nNodes++; - //if ( iObj != 7 ) - // continue; + if ( iObj != 103 ) + continue; //Acb_NtkOptNode( pMan, iObj ); while ( (RetValue = Acb_NtkOptNode(pMan, iObj)) && Acb_ObjFaninNum(pNtk, iObj) ); Vec_BitWriteEntry( vVisited, iObj, 1 ); @@ -1609,14 +1602,16 @@ void Acb_NtkOpt( Acb_Ntk_t * pNtk, Acb_Par_t * pPars ) } else { + int Value; Acb_NtkUpdateTiming( pNtk, -1 ); // compute delay information - while ( Vec_QueTopPriority(pNtk->vQue) > 0 ) + while ( (Value = (int)Vec_QueTopPriority(pNtk->vQue)) > 0 ) { int iObj = Vec_QuePop(pNtk->vQue); if ( !Acb_ObjType(pNtk, iObj) ) continue; - //if ( iObj != 28 ) - // continue; + if ( iObj != 103 ) + continue; + //printf( "Trying node %4d (%4d) ", iObj, Value ); Acb_NtkOptNode( pMan, iObj ); } } diff --git a/src/base/acb/acbUtil.c b/src/base/acb/acbUtil.c index 4b839ec2..1c47bf65 100644 --- a/src/base/acb/acbUtil.c +++ b/src/base/acb/acbUtil.c @@ -55,11 +55,15 @@ void Acb_ObjCollectTfi_rec( Acb_Ntk_t * p, int iObj, int fTerm ) } Vec_Int_t * Acb_ObjCollectTfi( Acb_Ntk_t * p, int iObj, int fTerm ) { - int i; + int i, Node; Vec_IntClear( &p->vArray0 ); Acb_NtkIncTravId( p ); if ( iObj > 0 ) + { + Vec_IntForEachEntry( &p->vSuppOld, Node, i ) + Acb_ObjCollectTfi_rec( p, Node, fTerm ); Acb_ObjCollectTfi_rec( p, iObj, fTerm ); + } else Acb_NtkForEachCo( p, iObj, i ) Acb_ObjCollectTfi_rec( p, iObj, fTerm ); @@ -267,10 +271,12 @@ void Acb_NtkPrintPaths( Acb_Ntk_t * p ) int iObj; Acb_NtkForEachObj( p, iObj ) { - printf( "Obj = %5d : ", iObj ); - printf( "PathD = %5d ", Acb_ObjPathD(p, iObj) ); - printf( "PathR = %5d ", Acb_ObjPathR(p, iObj) ); - printf( "Paths = %5d ", Acb_ObjPathD(p, iObj) + Acb_ObjPathR(p, iObj) ); + printf( "Obj = %5d : ", iObj ); + printf( "LevelD = %5d ", Acb_ObjLevelD(p, iObj) ); + printf( "LevelR = %5d ", Acb_ObjLevelR(p, iObj) ); + printf( "PathD = %5d ", Acb_ObjPathD(p, iObj) ); + printf( "PathR = %5d ", Acb_ObjPathR(p, iObj) ); + printf( "Paths = %5d ", Acb_ObjPathD(p, iObj) * Acb_ObjPathR(p, iObj) ); printf( "\n" ); } } @@ -323,7 +329,7 @@ void Acb_ObjUpdatePriority( Acb_Ntk_t * p, int iObj ) p->vQue = Vec_QueAlloc( 1000 ); Vec_QueSetPriority( p->vQue, Vec_FltArrayP(&p->vCounts) ); } - nPaths = Acb_ObjPathD(p, iObj) + Acb_ObjPathR(p, iObj); + nPaths = Acb_ObjPathD(p, iObj) * Acb_ObjPathR(p, iObj); Acb_ObjSetCounts( p, iObj, (float)nPaths ); if ( Vec_QueIsMember( p->vQue, iObj ) ) { @@ -394,6 +400,14 @@ void Acb_NtkUpdateTiming( Acb_Ntk_t * p, int iObj ) SeeAlso [] ***********************************************************************/ +void Acb_NtkPrintNode( Acb_Ntk_t * p, int iObj ) +{ + int k, iFanin, * pFanins; + printf( "Node %5d : ", iObj ); + Acb_ObjForEachFaninFast( p, iObj, pFanins, iFanin, k ) + printf( "%d ", iFanin ); + printf( "LevelD = %d. LevelR = %d.\n", Acb_ObjLevelD(p, iObj), Acb_ObjLevelR(p, iObj) ); +} int Acb_NtkCreateNode( Acb_Ntk_t * p, word uTruth, Vec_Int_t * vSupp ) { int Pivot = Acb_ObjAlloc( p, ABC_OPER_LUT, Vec_IntSize(vSupp), 0 ); @@ -432,14 +446,28 @@ void Acb_NtkResetNode( Acb_Ntk_t * p, int Pivot, word uTruth, Vec_Int_t * vSupp Acb_NtkResetNode( p, iFanin, 0, NULL ); Vec_IntFree( vFanins ); } +void Acb_NtkSaveSupport( Acb_Ntk_t * p, int iObj ) +{ + int k, iFanin, * pFanins; + Vec_IntClear( &p->vSuppOld ); + Acb_ObjForEachFaninFast( p, iObj, pFanins, iFanin, k ) + Vec_IntPush( &p->vSuppOld, iFanin ); +} void Acb_NtkUpdateNode( Acb_Ntk_t * p, int Pivot, word uTruth, Vec_Int_t * vSupp ) { + int Level = Acb_ObjLevelD(p, Pivot); + Acb_NtkSaveSupport( p, Pivot ); + //Acb_NtkPrintNode( p, Pivot ); Acb_NtkResetNode( p, Pivot, uTruth, vSupp ); Acb_ObjComputeLevelD( p, Pivot ); + //assert( Level > Acb_ObjLevelD(p, Pivot) ); + //Acb_NtkPrintNode( p, Pivot ); if ( p->vQue == NULL ) Acb_NtkUpdateLevelD( p, Pivot ); else - Acb_NtkUpdateTiming( p, Pivot ); +// Acb_NtkUpdateTiming( p, Pivot ); + Acb_NtkUpdateTiming( p, -1 ); + Vec_IntClear( &p->vSuppOld ); } //////////////////////////////////////////////////////////////////////// |