diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2013-09-25 13:18:21 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2013-09-25 13:18:21 -0700 |
commit | ee11ee1833c01a4705b52210e122db298825d388 (patch) | |
tree | b31d7b8ede7fbeeb6a41d217882fc9324bda7b48 /src/aig | |
parent | cab8301065096cd3d58b07bca91c5e9494dd7fc8 (diff) | |
download | abc-ee11ee1833c01a4705b52210e122db298825d388.tar.gz abc-ee11ee1833c01a4705b52210e122db298825d388.tar.bz2 abc-ee11ee1833c01a4705b52210e122db298825d388.zip |
Changes to enable decomposition of non-DSD functions.
Diffstat (limited to 'src/aig')
-rw-r--r-- | src/aig/gia/gia.h | 1 | ||||
-rw-r--r-- | src/aig/gia/giaUtil.c | 23 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h index 70fda8d4..5a6148d0 100644 --- a/src/aig/gia/gia.h +++ b/src/aig/gia/gia.h @@ -1227,6 +1227,7 @@ extern void Gia_ObjPrint( Gia_Man_t * p, Gia_Obj_t * pObj ); extern void Gia_ManPrint( Gia_Man_t * p ); extern void Gia_ManPrintCo( Gia_Man_t * p, Gia_Obj_t * pObj ); extern void Gia_ManPrintCone( Gia_Man_t * p, Gia_Obj_t * pObj, int * pLeaves, int nLeaves, Vec_Int_t * vNodes ); +extern void Gia_ManPrintCone2( Gia_Man_t * p, Gia_Obj_t * pObj ); extern void Gia_ManInvertConstraints( Gia_Man_t * pAig ); extern void Gia_ManInvertPos( Gia_Man_t * pAig ); extern int Gia_ManCompare( Gia_Man_t * p1, Gia_Man_t * p2 ); diff --git a/src/aig/gia/giaUtil.c b/src/aig/gia/giaUtil.c index cad6f5ad..cf1aa762 100644 --- a/src/aig/gia/giaUtil.c +++ b/src/aig/gia/giaUtil.c @@ -1194,6 +1194,7 @@ void Gia_ManPrintCo( Gia_Man_t * p, Gia_Obj_t * pObj ) Gia_ManPrintCo_rec( p, Gia_ObjFanin0(pObj) ); Gia_ObjPrint( p, pObj ); } + void Gia_ManPrintCollect_rec( Gia_Man_t * p, Gia_Obj_t * pObj, Vec_Int_t * vNodes ) { if ( Vec_IntFind(vNodes, Gia_ObjId(p, pObj)) >= 0 ) @@ -1215,6 +1216,28 @@ void Gia_ManPrintCone( Gia_Man_t * p, Gia_Obj_t * pObj, int * pLeaves, int nLeav Gia_ObjPrint( p, pObj ); } +void Gia_ManPrintCollect2_rec( Gia_Man_t * p, Gia_Obj_t * pObj, Vec_Int_t * vNodes ) +{ + if ( Vec_IntFind(vNodes, Gia_ObjId(p, pObj)) >= 0 ) + return; + if ( Gia_ObjIsCo(pObj) || Gia_ObjIsAnd(pObj) ) + Gia_ManPrintCollect2_rec( p, Gia_ObjFanin0(pObj), vNodes ); + if ( Gia_ObjIsAnd(pObj) ) + Gia_ManPrintCollect2_rec( p, Gia_ObjFanin1(pObj), vNodes ); + Vec_IntPush( vNodes, Gia_ObjId(p, pObj) ); +} +void Gia_ManPrintCone2( Gia_Man_t * p, Gia_Obj_t * pObj ) +{ + Vec_Int_t * vNodes; + int i; + vNodes = Vec_IntAlloc( 100 ); + Gia_ManPrintCollect2_rec( p, pObj, vNodes ); + printf( "GIA logic cone for node %d:\n", Gia_ObjId(p, pObj) ); + Gia_ManForEachObjVec( vNodes, p, pObj, i ) + Gia_ObjPrint( p, pObj ); + Vec_IntFree( vNodes ); +} + /**Function************************************************************* Synopsis [Complements the constraint outputs.] |