diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2013-08-20 08:46:31 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2013-08-20 08:46:31 -0700 |
commit | 1ad363c1566bd878bd71f9032f446506efcbcc9a (patch) | |
tree | a719c0799293f87c6e28b503cdf42816310f369c /src/aig | |
parent | b7c8f9188d99b4ab509c57f75b95f26de4fb656c (diff) | |
download | abc-1ad363c1566bd878bd71f9032f446506efcbcc9a.tar.gz abc-1ad363c1566bd878bd71f9032f446506efcbcc9a.tar.bz2 abc-1ad363c1566bd878bd71f9032f446506efcbcc9a.zip |
Added switch &sim -g to enable flop grouping.
Diffstat (limited to 'src/aig')
-rw-r--r-- | src/aig/gia/gia.h | 1 | ||||
-rw-r--r-- | src/aig/gia/giaDup.c | 36 |
2 files changed, 37 insertions, 0 deletions
diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h index f31ba36f..f356b1da 100644 --- a/src/aig/gia/gia.h +++ b/src/aig/gia/gia.h @@ -901,6 +901,7 @@ extern Gia_Man_t * Gia_ManDupFlip( Gia_Man_t * p, int * pInitState ); extern Gia_Man_t * Gia_ManDupCycled( Gia_Man_t * pAig, Abc_Cex_t * pCex, int nFrames ); extern Gia_Man_t * Gia_ManDup( Gia_Man_t * p ); extern Gia_Man_t * Gia_ManDupPerm( Gia_Man_t * p, Vec_Int_t * vPiPerm ); +extern Gia_Man_t * Gia_ManDupPermFlop( Gia_Man_t * p, Vec_Int_t * vFfPerm ); extern void Gia_ManDupAppend( Gia_Man_t * p, Gia_Man_t * pTwo ); extern void Gia_ManDupAppendShare( Gia_Man_t * p, Gia_Man_t * pTwo ); extern Gia_Man_t * Gia_ManDupAppendNew( Gia_Man_t * pOne, Gia_Man_t * pTwo ); diff --git a/src/aig/gia/giaDup.c b/src/aig/gia/giaDup.c index 17440e65..6f7b7242 100644 --- a/src/aig/gia/giaDup.c +++ b/src/aig/gia/giaDup.c @@ -589,6 +589,42 @@ Gia_Man_t * Gia_ManDupPerm( Gia_Man_t * p, Vec_Int_t * vPiPerm ) Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) ); return pNew; } +Gia_Man_t * Gia_ManDupPermFlop( Gia_Man_t * p, Vec_Int_t * vFfPerm ) +{ + Vec_Int_t * vLits; + Gia_Man_t * pNew; + Gia_Obj_t * pObj; + int i; + assert( Vec_IntSize(vFfPerm) == Gia_ManRegNum(p) ); + + pNew = Gia_ManStart( Gia_ManObjNum(p) ); + pNew->pName = Abc_UtilStrsav( p->pName ); + pNew->pSpec = Abc_UtilStrsav( p->pSpec ); + Gia_ManConst0(p)->Value = 0; + Gia_ManForEachCi( p, pObj, i ) + pObj->Value = Gia_ManAppendCi(pNew); + + vLits = Vec_IntAlloc( Gia_ManRegNum(p) ); + for ( i = 0; i < Gia_ManRegNum(p); i++ ) + Vec_IntPush( vLits, Gia_ManRo(p, Vec_IntEntry(vFfPerm, i))->Value ); + Gia_ManForEachRo( p, pObj, i ) + pObj->Value = Vec_IntEntry(vLits, i); + + Gia_ManForEachAnd( p, pObj, i ) + pObj->Value = Gia_ManAppendAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) ); + Gia_ManForEachPo( p, pObj, i ) + pObj->Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) ); + + Vec_IntClear( vLits ); + for ( i = 0; i < Gia_ManRegNum(p); i++ ) + Vec_IntPush( vLits, Gia_ObjFanin0Copy( Gia_ManRi(p, Vec_IntEntry(vFfPerm, i)) ) ); + Gia_ManForEachRi( p, pObj, i ) + pObj->Value = Gia_ManAppendCo( pNew, Vec_IntEntry(vLits, i) ); + Vec_IntFree( vLits ); + + Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) ); + return pNew; +} /**Function************************************************************* |