diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2014-11-11 15:11:44 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2014-11-11 15:11:44 -0800 |
commit | 96fa84ad776294294da325875a0984882e3bd373 (patch) | |
tree | e9394bc722f475bf294896863deda67fbad8f83f /src/aig/gia/giaEquiv.c | |
parent | 2a028aa147837e83e226a025e0c8d244c59716df (diff) | |
download | abc-96fa84ad776294294da325875a0984882e3bd373.tar.gz abc-96fa84ad776294294da325875a0984882e3bd373.tar.bz2 abc-96fa84ad776294294da325875a0984882e3bd373.zip |
Added switch -i to &filter to use FIs instead of FOs.
Diffstat (limited to 'src/aig/gia/giaEquiv.c')
-rw-r--r-- | src/aig/gia/giaEquiv.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/src/aig/gia/giaEquiv.c b/src/aig/gia/giaEquiv.c index 72626857..71b32d7d 100644 --- a/src/aig/gia/giaEquiv.c +++ b/src/aig/gia/giaEquiv.c @@ -2144,21 +2144,32 @@ int Gia_ManFilterEquivsUsingParts( Gia_Man_t * pGia, char * pName1, char * pName SeeAlso [] ***********************************************************************/ -void Gia_ManFilterEquivsUsingLatches( Gia_Man_t * pGia, int fFlopsOnly, int fFlopsWith ) +void Gia_ManFilterEquivsUsingLatches( Gia_Man_t * pGia, int fFlopsOnly, int fFlopsWith, int fUseRiDrivers ) { - Vec_Int_t * vNodes; - Gia_Obj_t * pObj; + Gia_Obj_t * pObjR; + Vec_Int_t * vNodes, * vFfIds; int i, k, iObj, iNext, iPrev, iRepr; int iLitsOld = 0, iLitsNew = 0; assert( fFlopsOnly ^ fFlopsWith ); vNodes = Vec_IntAlloc( 100 ); - // remove all noo-flop constants + // select nodes "flop" node IDs + vFfIds = Vec_IntStart( Gia_ManObjNum(pGia) ); + if ( fUseRiDrivers ) + { + Gia_ManForEachRi( pGia, pObjR, i ) + Vec_IntWriteEntry( vFfIds, Gia_ObjFaninId0p(pGia, pObjR), 1 ); + } + else + { + Gia_ManForEachRo( pGia, pObjR, i ) + Vec_IntWriteEntry( vFfIds, Gia_ObjId(pGia, pObjR), 1 ); + } + // remove all non-flop constants Gia_ManForEachConst( pGia, i ) { iLitsOld++; - pObj = Gia_ManObj( pGia, i ); assert( pGia->pNexts[i] == 0 ); - if ( !Gia_ObjIsRo(pGia, pObj) ) + if ( !Vec_IntEntry(vFfIds, i) ) Gia_ObjUnsetRepr( pGia, i ); else iLitsNew++; @@ -2171,8 +2182,7 @@ void Gia_ManFilterEquivsUsingLatches( Gia_Man_t * pGia, int fFlopsOnly, int fFlo Vec_IntClear( vNodes ); Gia_ClassForEachObj( pGia, i, iObj ) { - pObj = Gia_ManObj( pGia, iObj ); - if ( Gia_ObjIsRo(pGia, pObj) ) + if ( Vec_IntEntry(vFfIds, iObj) ) Vec_IntPush( vNodes, iObj ); iLitsOld++; } @@ -2207,8 +2217,7 @@ void Gia_ManFilterEquivsUsingLatches( Gia_Man_t * pGia, int fFlopsOnly, int fFlo int fSeenFlop = 0; Gia_ClassForEachObj( pGia, i, iObj ) { - pObj = Gia_ManObj( pGia, iObj ); - if ( Gia_ObjIsRo(pGia, pObj) ) + if ( Vec_IntEntry(vFfIds, iObj) ) fSeenFlop = 1; iLitsOld++; iLitsNew++; @@ -2230,6 +2239,7 @@ void Gia_ManFilterEquivsUsingLatches( Gia_Man_t * pGia, int fFlopsOnly, int fFlo } } Vec_IntFree( vNodes ); + Vec_IntFree( vFfIds ); Abc_Print( 1, "The number of literals: Before = %d. After = %d.\n", iLitsOld, iLitsNew ); } |