summaryrefslogtreecommitdiffstats
path: root/src/aig/saig/saigDup.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2011-01-13 12:38:59 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2011-01-13 12:38:59 -0800
commitae4b51351c93983a1285ce1028e3bbd90a6d5721 (patch)
treeb06797a1771bb1c79124f2ac7d57f1a54c9afc34 /src/aig/saig/saigDup.c
parentf4066b5be3b5473f5c64ab71d1983df6ca7aec76 (diff)
downloadabc-ae4b51351c93983a1285ce1028e3bbd90a6d5721.tar.gz
abc-ae4b51351c93983a1285ce1028e3bbd90a6d5721.tar.bz2
abc-ae4b51351c93983a1285ce1028e3bbd90a6d5721.zip
Cumulative changes in the last few weeks.
Diffstat (limited to 'src/aig/saig/saigDup.c')
-rw-r--r--src/aig/saig/saigDup.c52
1 files changed, 51 insertions, 1 deletions
diff --git a/src/aig/saig/saigDup.c b/src/aig/saig/saigDup.c
index 268540da..4d34224e 100644
--- a/src/aig/saig/saigDup.c
+++ b/src/aig/saig/saigDup.c
@@ -42,7 +42,7 @@ ABC_NAMESPACE_IMPL_START
SeeAlso []
***********************************************************************/
-Aig_Man_t * Said_ManDupOrpos( Aig_Man_t * pAig )
+Aig_Man_t * Saig_ManDupOrpos( Aig_Man_t * pAig )
{
Aig_Man_t * pAigNew;
Aig_Obj_t * pObj, * pMiter;
@@ -79,6 +79,56 @@ Aig_Man_t * Said_ManDupOrpos( Aig_Man_t * pAig )
/**Function*************************************************************
+ Synopsis [Duplicates while ORing the POs of sequential circuit.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Aig_Man_t * Saig_ManCreateEquivMiter( Aig_Man_t * pAig, Vec_Int_t * vPairs )
+{
+ Aig_Man_t * pAigNew;
+ Aig_Obj_t * pObj, * pObj2, * pMiter;
+ int i;
+ if ( pAig->nConstrs > 0 )
+ {
+ printf( "The AIG manager should have no constraints.\n" );
+ return NULL;
+ }
+ // start the new manager
+ pAigNew = Aig_ManStart( Aig_ManNodeNum(pAig) );
+ pAigNew->pName = Aig_UtilStrsav( pAig->pName );
+ pAigNew->nConstrs = pAig->nConstrs;
+ // map the constant node
+ Aig_ManConst1(pAig)->pData = Aig_ManConst1( pAigNew );
+ // create variables for PIs
+ Aig_ManForEachPi( pAig, pObj, i )
+ pObj->pData = Aig_ObjCreatePi( pAigNew );
+ // add internal nodes of this frame
+ Aig_ManForEachNode( pAig, pObj, i )
+ pObj->pData = Aig_And( pAigNew, Aig_ObjChild0Copy(pObj), Aig_ObjChild1Copy(pObj) );
+ // create POs
+ assert( Vec_IntSize(vPairs) % 2 == 0 );
+ Aig_ManForEachNodeVec( pAig, vPairs, pObj, i )
+ {
+ pObj2 = Aig_ManObj( pAig, Vec_IntEntry(vPairs, ++i) );
+ pMiter = Aig_Exor( pAigNew, pObj->pData, pObj2->pData );
+ pMiter = Aig_NotCond( pMiter, pObj->fPhase ^ pObj2->fPhase );
+ Aig_ObjCreatePo( pAigNew, pMiter );
+ }
+ // transfer to register outputs
+ Saig_ManForEachLi( pAig, pObj, i )
+ Aig_ObjCreatePo( pAigNew, Aig_ObjChild0Copy(pObj) );
+ Aig_ManCleanup( pAigNew );
+ Aig_ManSetRegNum( pAigNew, Aig_ManRegNum(pAig) );
+ return pAigNew;
+}
+
+/**Function*************************************************************
+
Synopsis [Duplicates the AIG manager recursively.]
Description []