summaryrefslogtreecommitdiffstats
path: root/src/aig
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2016-05-20 14:03:07 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2016-05-20 14:03:07 -0700
commit27c44fd644f7fa46a72e5b8b19465dc61752657d (patch)
treed865d1c215160eb825a54702993420e6b297b859 /src/aig
parent555ed0b1589570219e5bf71789a234105b353815 (diff)
downloadabc-27c44fd644f7fa46a72e5b8b19465dc61752657d.tar.gz
abc-27c44fd644f7fa46a72e5b8b19465dc61752657d.tar.bz2
abc-27c44fd644f7fa46a72e5b8b19465dc61752657d.zip
Switch &miter -y to convert a two-word miter into a dual-output miter.
Diffstat (limited to 'src/aig')
-rw-r--r--src/aig/gia/gia.h1
-rw-r--r--src/aig/gia/giaDup.c31
2 files changed, 32 insertions, 0 deletions
diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h
index 65f6a76d..81a6d11a 100644
--- a/src/aig/gia/gia.h
+++ b/src/aig/gia/gia.h
@@ -1209,6 +1209,7 @@ extern Gia_Man_t * Gia_ManMiter2( Gia_Man_t * p, char * pInit, int fVerb
extern Gia_Man_t * Gia_ManTransformMiter( Gia_Man_t * p );
extern Gia_Man_t * Gia_ManTransformMiter2( Gia_Man_t * p );
extern Gia_Man_t * Gia_ManTransformToDual( Gia_Man_t * p );
+extern Gia_Man_t * Gia_ManTransformTwoWord2DualOutput( Gia_Man_t * p );
extern Gia_Man_t * Gia_ManChoiceMiter( Vec_Ptr_t * vGias );
extern Gia_Man_t * Gia_ManDupWithConstraints( Gia_Man_t * p, Vec_Int_t * vPoTypes );
extern Gia_Man_t * Gia_ManDupCones( Gia_Man_t * p, int * pPos, int nPos, int fTrimPis );
diff --git a/src/aig/gia/giaDup.c b/src/aig/gia/giaDup.c
index 946f6d4d..66b80ace 100644
--- a/src/aig/gia/giaDup.c
+++ b/src/aig/gia/giaDup.c
@@ -2575,6 +2575,37 @@ Gia_Man_t * Gia_ManTransformToDual( Gia_Man_t * p )
Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
return pNew;
}
+Gia_Man_t * Gia_ManTransformTwoWord2DualOutput( Gia_Man_t * p )
+{
+ Gia_Man_t * pNew, * pTemp;
+ Gia_Obj_t * pObj, * pObj2;
+ int i, nPart = Gia_ManPoNum(p)/2;
+ assert( (Gia_ManPoNum(p) & 1) == 0 );
+ pNew = Gia_ManStart( Gia_ManObjNum(p) );
+ pNew->pName = Abc_UtilStrsav( p->pName );
+ pNew->pSpec = Abc_UtilStrsav( p->pSpec );
+ Gia_ManConst0(p)->Value = 0;
+ Gia_ManHashAlloc( pNew );
+ Gia_ManForEachCi( p, pObj, i )
+ pObj->Value = Gia_ManAppendCi( pNew );
+ Gia_ManForEachAnd( p, pObj, i )
+ pObj->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
+ Gia_ManForEachPo( p, pObj, i )
+ {
+ if ( i == nPart )
+ break;
+ pObj2 = Gia_ManPo( p, nPart + i );
+ Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
+ Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj2) );
+ }
+ Gia_ManForEachRi( p, pObj, i )
+ pObj->Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
+ Gia_ManHashStop( pNew );
+ Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
+ pNew = Gia_ManCleanup( pTemp = pNew );
+ Gia_ManStop( pTemp );
+ return pNew;
+}
/**Function*************************************************************