diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2018-12-09 15:18:12 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2018-12-09 15:18:12 -0800 |
commit | 36585eff57d16171bb4a53fdc6348613d44eabe6 (patch) | |
tree | 4c0368dc4b7022f5aa80282d3301b784465adbdb /src/base/wlc/wlcNtk.c | |
parent | fe03f0423de9718b122d6200042ecb553520fb0f (diff) | |
download | abc-36585eff57d16171bb4a53fdc6348613d44eabe6.tar.gz abc-36585eff57d16171bb4a53fdc6348613d44eabe6.tar.bz2 abc-36585eff57d16171bb4a53fdc6348613d44eabe6.zip |
Experiments with retiming (adding new APIs).
Diffstat (limited to 'src/base/wlc/wlcNtk.c')
-rw-r--r-- | src/base/wlc/wlcNtk.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/base/wlc/wlcNtk.c b/src/base/wlc/wlcNtk.c index f64fccaf..8038d9e6 100644 --- a/src/base/wlc/wlcNtk.c +++ b/src/base/wlc/wlcNtk.c @@ -357,8 +357,8 @@ int Wlc_NtkCreateLevelsRev( Wlc_Ntk_t * p ) ***********************************************************************/ void Wlc_NtkCreateLevels_rec( Wlc_Ntk_t * p, Wlc_Obj_t * pObj ) { - int k, iFanin, Level = 0; - if ( Vec_IntEntry(&p->vLevels, Wlc_ObjId(p, pObj)) > 0 ) + int k, iFanin, Level = 0, iObj = Wlc_ObjId(p, pObj); + if ( Wlc_ObjIsCi(pObj) || Wlc_ObjIsFf(p, iObj) || Wlc_ObjFaninNum(pObj) == 0 || Wlc_ObjLevel(p, pObj) > 0 ) return; Wlc_ObjForEachFanin( pObj, iFanin, k ) if ( iFanin ) Wlc_NtkCreateLevels_rec( p, Wlc_NtkObj(p, iFanin) ); @@ -368,11 +368,18 @@ void Wlc_NtkCreateLevels_rec( Wlc_Ntk_t * p, Wlc_Obj_t * pObj ) } int Wlc_NtkCreateLevels( Wlc_Ntk_t * p ) { - Wlc_Obj_t * pObj; int i; + Wlc_Obj_t * pObj; int i, LeveMax = 0; Vec_IntFill( &p->vLevels, Wlc_NtkObjNumMax(p), 0 ); - Wlc_NtkForEachCo( p, pObj, i ) + Wlc_NtkForEachObj( p, pObj, i ) Wlc_NtkCreateLevels_rec( p, pObj ); - return Vec_IntFindMax( &p->vLevels ); + Wlc_NtkForEachObj( p, pObj, i ) + if ( !Wlc_ObjIsCi(pObj) && Wlc_ObjFaninNum(pObj) ) + Vec_IntAddToEntry( &p->vLevels, i, 1 ); + LeveMax = Vec_IntFindMax( &p->vLevels ); + Wlc_NtkForEachFf2( p, pObj, i ) + Vec_IntWriteEntry( &p->vLevels, Wlc_ObjId(p, pObj), LeveMax+1 ); + Wlc_NtkPrintObjects( p ); + return LeveMax+1; } /**Function************************************************************* @@ -662,6 +669,8 @@ void Wlc_NtkPrintDistrib( Wlc_Ntk_t * p, int fTwoSides, int fVerbose ) void Wlc_NtkPrintNode( Wlc_Ntk_t * p, Wlc_Obj_t * pObj ) { printf( "%8d : ", Wlc_ObjId(p, pObj) ); + if ( Vec_IntSize(&p->vLevels) ) + printf( "Lev = %2d ", Vec_IntEntry(&p->vLevels, Wlc_ObjId(p,pObj)) ); printf( "%6d%s = ", Wlc_ObjRange(pObj), Wlc_ObjIsSigned(pObj) ? "s" : " " ); if ( pObj->Type == WLC_OBJ_PI ) { |