summaryrefslogtreecommitdiffstats
path: root/src/opt/mfs/mfsStrash.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2015-06-22 23:05:13 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2015-06-22 23:05:13 -0700
commit51a646a355c78cf0f4cf104d6316706653b24008 (patch)
tree4584ce9a96b88d32f110944f76b29ab90bb92a99 /src/opt/mfs/mfsStrash.c
parent327078393947f3c2e0b5548e5fada9ee67ef6134 (diff)
downloadabc-51a646a355c78cf0f4cf104d6316706653b24008.tar.gz
abc-51a646a355c78cf0f4cf104d6316706653b24008.tar.bz2
abc-51a646a355c78cf0f4cf104d6316706653b24008.zip
Version abc90901
committer: Baruch Sterin <baruchs@gmail.com>
Diffstat (limited to 'src/opt/mfs/mfsStrash.c')
-rw-r--r--src/opt/mfs/mfsStrash.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/opt/mfs/mfsStrash.c b/src/opt/mfs/mfsStrash.c
index 578c2fbe..7e6c25da 100644
--- a/src/opt/mfs/mfsStrash.c
+++ b/src/opt/mfs/mfsStrash.c
@@ -30,6 +30,60 @@
/**Function*************************************************************
+ Synopsis [Recursively converts AIG from Aig_Man_t into Hop_Obj_t.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_MfsConvertAigToHop_rec( Aig_Obj_t * pObj, Hop_Man_t * pHop )
+{
+ assert( !Aig_IsComplement(pObj) );
+ if ( pObj->pData )
+ return;
+ Abc_MfsConvertAigToHop_rec( Aig_ObjFanin0(pObj), pHop );
+ Abc_MfsConvertAigToHop_rec( Aig_ObjFanin1(pObj), pHop );
+ pObj->pData = Hop_And( pHop, (Hop_Obj_t *)Aig_ObjChild0Copy(pObj), (Hop_Obj_t *)Aig_ObjChild1Copy(pObj) );
+ assert( !Hop_IsComplement(pObj->pData) );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Converts AIG from Aig_Man_t into Hop_Obj_t.]
+
+ Description [Assumes that Aig_Man_t has exactly one primary outputs.
+ Returns the pointer to the root node (Hop_Obj_t) in Hop_Man_t.]
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Hop_Obj_t * Abc_MfsConvertAigToHop( Aig_Man_t * pMan, Hop_Man_t * pHop )
+{
+ Aig_Obj_t * pRoot, * pObj;
+ int i;
+ assert( Aig_ManPoNum(pMan) == 1 );
+ pRoot = Aig_ManPo( pMan, 0 );
+ // check the case of a constant
+ if ( Aig_ObjIsConst1( Aig_ObjFanin0(pRoot) ) )
+ return Hop_NotCond( Hop_ManConst1(pHop), Aig_ObjFaninC0(pRoot) );
+ // set the PI mapping
+ Aig_ManCleanData( pMan );
+ Aig_ManForEachPi( pMan, pObj, i )
+ pObj->pData = Hop_IthVar( pHop, i );
+ // construct the AIG
+ Abc_MfsConvertAigToHop_rec( Aig_ObjFanin0(pRoot), pHop );
+ return Hop_NotCond( Aig_ObjFanin0(pRoot)->pData, Aig_ObjFaninC0(pRoot) );
+}
+
+// should be called as follows: pNodeNew->pData = Abc_MfsConvertAigToHop( pAigManInterpol, pNodeNew->pNtk->pManFunc );
+
+/**Function*************************************************************
+
Synopsis [Construct BDDs and mark AIG nodes.]
Description []