diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2013-09-11 14:38:08 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2013-09-11 14:38:08 -0700 |
commit | b1b0202c05d5d6bb306a8a3b081b21ca2328dab6 (patch) | |
tree | 3770a2d69c5882bd7abf03d37b1c3e9349af8d10 /src/aig | |
parent | deb7b6ac4f4e88430c299216bed7ef59c7969a7d (diff) | |
download | abc-b1b0202c05d5d6bb306a8a3b081b21ca2328dab6.tar.gz abc-b1b0202c05d5d6bb306a8a3b081b21ca2328dab6.tar.bz2 abc-b1b0202c05d5d6bb306a8a3b081b21ca2328dab6.zip |
Command '&slice' to cut out the bottom part of the AIG.
Diffstat (limited to 'src/aig')
-rw-r--r-- | src/aig/gia/gia.h | 1 | ||||
-rw-r--r-- | src/aig/gia/giaDup.c | 48 |
2 files changed, 49 insertions, 0 deletions
diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h index c660c1df..e1fd6a63 100644 --- a/src/aig/gia/gia.h +++ b/src/aig/gia/gia.h @@ -975,6 +975,7 @@ extern Gia_Man_t * Gia_ManDupCones( Gia_Man_t * p, int * pPos, int nPos, extern Gia_Man_t * Gia_ManDupOneHot( Gia_Man_t * p ); extern Gia_Man_t * Gia_ManDupLevelized( Gia_Man_t * p ); extern Gia_Man_t * Gia_ManDupFromVecs( Gia_Man_t * p, Vec_Int_t * vCis, Vec_Int_t * vAnds, Vec_Int_t * vCos, int nRegs ); +extern Gia_Man_t * Gia_ManDupSliced( Gia_Man_t * p, int nSuppMax ); /*=== 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 e8e186cf..fd430ff2 100644 --- a/src/aig/gia/giaDup.c +++ b/src/aig/gia/giaDup.c @@ -2521,6 +2521,54 @@ Gia_Man_t * Gia_ManDupFromVecs( Gia_Man_t * p, Vec_Int_t * vCis, Vec_Int_t * vAn return pNew; } +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +Gia_Man_t * Gia_ManDupSliced( Gia_Man_t * p, int nSuppMax ) +{ + Gia_Man_t * pNew; + Gia_Obj_t * pObj; + int i; + // start the new manager + pNew = Gia_ManStart( 5000 ); + pNew->pName = Abc_UtilStrsav( p->pName ); + // create constant and PIs + Gia_ManConst0(p)->Value = 0; + Gia_ManForEachCi( p, pObj, i ) + pObj->Value = Gia_ManAppendCi( pNew ); + // create internal nodes + Gia_ManCleanMark01(p); + Gia_ManForEachAnd( p, pObj, i ) + if ( Gia_ManSuppSize(p, &i, 1) <= nSuppMax ) + { + pObj->Value = Gia_ManAppendAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) ); + pObj->fMark0 = 1; + } + else + { + Gia_ObjFanin0(pObj)->fMark1 = 1; + Gia_ObjFanin1(pObj)->fMark1 = 1; + } + Gia_ManForEachCo( p, pObj, i ) + Gia_ObjFanin0(pObj)->fMark1 = 1; + // add POs for the nodes pointed to + Gia_ManForEachAnd( p, pObj, i ) + if ( pObj->fMark0 && pObj->fMark1 ) + Gia_ManAppendCo( pNew, pObj->Value ); + // cleanup and leave + Gia_ManCleanMark01(p); + return pNew; +} + + //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// |