diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2012-05-03 04:54:06 +0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2012-05-03 04:54:06 +0800 |
commit | 32b07625464c92dcb32e2d5c40134ada0497d717 (patch) | |
tree | 1480934e1a657e21cc87c339acc28fd157e9591b /src/aig | |
parent | e6b16e27d1cf5e5d5ec21ce01ed4e424624734d3 (diff) | |
download | abc-32b07625464c92dcb32e2d5c40134ada0497d717.tar.gz abc-32b07625464c92dcb32e2d5c40134ada0497d717.tar.bz2 abc-32b07625464c92dcb32e2d5c40134ada0497d717.zip |
Preventing &iso from removing fanoutless PIs.
Diffstat (limited to 'src/aig')
-rw-r--r-- | src/aig/gia/gia.h | 2 | ||||
-rw-r--r-- | src/aig/gia/giaDup.c | 14 | ||||
-rw-r--r-- | src/aig/gia/giaIso.c | 4 |
3 files changed, 14 insertions, 6 deletions
diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h index 1785eee7..bb3c6524 100644 --- a/src/aig/gia/gia.h +++ b/src/aig/gia/gia.h @@ -690,7 +690,7 @@ extern Gia_Man_t * Gia_ManDupWithConstraints( Gia_Man_t * p, Vec_Int_t * extern Gia_Man_t * Gia_ManDupAbsFlops( Gia_Man_t * p, Vec_Int_t * vFlopClasses ); extern Gia_Man_t * Gia_ManDupAbsGates( Gia_Man_t * p, Vec_Int_t * vGateClasses ); extern Vec_Int_t * Gia_GlaCollectAssigned( Gia_Man_t * p, Vec_Int_t * vGateClasses ); -extern Gia_Man_t * Gia_ManDupCones( Gia_Man_t * p, int * pPos, int nPos ); +extern Gia_Man_t * Gia_ManDupCones( Gia_Man_t * p, int * pPos, int nPos, int fTrimPis ); /*=== giaEnable.c ==========================================================*/ extern void Gia_ManDetectSeqSignals( Gia_Man_t * p, int fSetReset, int fVerbose ); extern Gia_Man_t * Gia_ManUnrollAndCofactor( Gia_Man_t * p, int nFrames, int nFanMax, int fVerbose ); diff --git a/src/aig/gia/giaDup.c b/src/aig/gia/giaDup.c index 2171cb5e..7d11eff9 100644 --- a/src/aig/gia/giaDup.c +++ b/src/aig/gia/giaDup.c @@ -1850,7 +1850,7 @@ void Gia_ManDupCones_rec( Gia_Man_t * p, Gia_Obj_t * pObj, Vec_Ptr_t * vLeaves, Vec_PtrPush( vLeaves, pObj ); else assert( 0 ); } -Gia_Man_t * Gia_ManDupCones( Gia_Man_t * p, int * pPos, int nPos ) +Gia_Man_t * Gia_ManDupCones( Gia_Man_t * p, int * pPos, int nPos, int fTrimPis ) { Gia_Man_t * pNew; Vec_Ptr_t * vLeaves, * vNodes, * vRoots; @@ -1877,8 +1877,16 @@ Gia_Man_t * Gia_ManDupCones( Gia_Man_t * p, int * pPos, int nPos ) // map the constant node Gia_ManConst0(p)->Value = 0; // create PIs - Vec_PtrForEachEntry( Gia_Obj_t *, vLeaves, pObj, i ) - pObj->Value = Gia_ManAppendCi( pNew ); + if ( fTrimPis ) + { + Vec_PtrForEachEntry( Gia_Obj_t *, vLeaves, pObj, i ) + pObj->Value = Gia_ManAppendCi( pNew ); + } + else + { + Gia_ManForEachPi( p, pObj, i ) + pObj->Value = Gia_ManAppendCi( pNew ); + } // create LOs Vec_PtrForEachEntryStart( Gia_Obj_t *, vRoots, pObj, i, nPos ) Gia_ObjRiToRo(p, pObj)->Value = Gia_ManAppendCi( pNew ); diff --git a/src/aig/gia/giaIso.c b/src/aig/gia/giaIso.c index 3c3e26ff..dcfee68f 100644 --- a/src/aig/gia/giaIso.c +++ b/src/aig/gia/giaIso.c @@ -1024,7 +1024,7 @@ Vec_Str_t * Gia_ManIsoFindString( Gia_Man_t * p, int iPo, int fVerbose ) Vec_Int_t * vCis, * vAnds, * vCos; Vec_Str_t * vStr; // duplicate - pPart = Gia_ManDupCones( p, &iPo, 1 ); + pPart = Gia_ManDupCones( p, &iPo, 1, 1 ); assert( Gia_ManPoNum(pPart) == 1 ); if ( Gia_ManCiNum(pPart) == 0 ) // const AIG { @@ -1167,7 +1167,7 @@ Gia_Man_t * Gia_ManIsoReduce( Gia_Man_t * pInit, Vec_Ptr_t ** pvPosEquivs, int f // derive the resulting AIG - pPart = Gia_ManDupCones( p, Vec_IntArray(vRemain), Vec_IntSize(vRemain) ); + pPart = Gia_ManDupCones( p, Vec_IntArray(vRemain), Vec_IntSize(vRemain), 0 ); Vec_IntFree( vRemain ); // report the results if ( !fDualOut ) |