summaryrefslogtreecommitdiffstats
path: root/src/aig/gia/giaDup.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-08-28 20:21:01 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2013-08-28 20:21:01 -0700
commiteec022ea644ce0430d3f7c5259c72f850338f987 (patch)
tree786ca5bbcaa21c5dcaf5e7299c9611f6bf6d0da1 /src/aig/gia/giaDup.c
parent42f8082c59db41307120a6d5dbfdef4c2350a722 (diff)
downloadabc-eec022ea644ce0430d3f7c5259c72f850338f987.tar.gz
abc-eec022ea644ce0430d3f7c5259c72f850338f987.tar.bz2
abc-eec022ea644ce0430d3f7c5259c72f850338f987.zip
Adding procedures to specify permutations with unused flops.
Diffstat (limited to 'src/aig/gia/giaDup.c')
-rw-r--r--src/aig/gia/giaDup.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/aig/gia/giaDup.c b/src/aig/gia/giaDup.c
index 74227531..85af8748 100644
--- a/src/aig/gia/giaDup.c
+++ b/src/aig/gia/giaDup.c
@@ -615,6 +615,51 @@ Gia_Man_t * Gia_ManDupPermFlop( Gia_Man_t * p, Vec_Int_t * vFfPerm )
Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
return pNew;
}
+Gia_Man_t * Gia_ManDupSpreadFlop( Gia_Man_t * p, Vec_Int_t * vFfMask )
+{
+ Gia_Man_t * pNew;
+ Gia_Obj_t * pObj;
+ int i, k, Entry;
+ assert( Vec_IntSize(vFfMask) >= 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_ManForEachPi( p, pObj, i )
+ pObj->Value = Gia_ManAppendCi(pNew);
+ k = 0;
+ Vec_IntForEachEntry( vFfMask, Entry, i )
+ if ( Entry == -1 )
+ Gia_ManAppendCi(pNew);
+ else
+ Gia_ManRo(p, k++)->Value = Gia_ManAppendCi(pNew);
+ assert( k == Gia_ManRegNum(p) );
+ 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) );
+ k = 0;
+ Vec_IntForEachEntry( vFfMask, Entry, i )
+ if ( Entry == -1 )
+ Gia_ManAppendCo( pNew, 0 );
+ else
+ {
+ pObj = Gia_ManRi( p, k++ );
+ pObj->Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
+ }
+ assert( k == Gia_ManRegNum(p) );
+ Gia_ManSetRegNum( pNew, Vec_IntSize(vFfMask) );
+ return pNew;
+}
+Gia_Man_t * Gia_ManDupPermFlopGap( Gia_Man_t * p, Vec_Int_t * vFfMask )
+{
+ Vec_Int_t * vPerm = Vec_IntCondense( vFfMask, -1 );
+ Gia_Man_t * pPerm = Gia_ManDupPermFlop( p, vPerm );
+ Gia_Man_t * pSpread = Gia_ManDupSpreadFlop( pPerm, vFfMask );
+ Vec_IntFree( vPerm );
+ Gia_ManStop( pPerm );
+ return pSpread;
+}
/**Function*************************************************************