summaryrefslogtreecommitdiffstats
path: root/src/aig/saig/saigDup.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2008-09-19 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2008-09-19 08:01:00 -0700
commit3429e6309d0fc9a2d35d81f6483258c6af2fab50 (patch)
tree6ea42f73528c9f456d5b0dea28173806cd45742d /src/aig/saig/saigDup.c
parent655a50101e18176f1163ccfc67cf69d86623d1f2 (diff)
downloadabc-3429e6309d0fc9a2d35d81f6483258c6af2fab50.tar.gz
abc-3429e6309d0fc9a2d35d81f6483258c6af2fab50.tar.bz2
abc-3429e6309d0fc9a2d35d81f6483258c6af2fab50.zip
Version abc80919
Diffstat (limited to 'src/aig/saig/saigDup.c')
-rw-r--r--src/aig/saig/saigDup.c74
1 files changed, 74 insertions, 0 deletions
diff --git a/src/aig/saig/saigDup.c b/src/aig/saig/saigDup.c
new file mode 100644
index 00000000..1a050741
--- /dev/null
+++ b/src/aig/saig/saigDup.c
@@ -0,0 +1,74 @@
+/**CFile****************************************************************
+
+ FileName [saigDup.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [Sequential AIG package.]
+
+ Synopsis [Various duplication procedures.]
+
+ Author [Alan Mishchenko]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - June 20, 2005.]
+
+ Revision [$Id: saigDup.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "saig.h"
+
+////////////////////////////////////////////////////////////////////////
+/// DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+/// FUNCTION DEFINITIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+ Synopsis [Duplicates while ORing the POs of sequential circuit.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Aig_Man_t * Said_ManDupOrpos( Aig_Man_t * pAig )
+{
+ Aig_Man_t * pAigNew;
+ Aig_Obj_t * pObj, * pMiter;
+ int i;
+ // start the new manager
+ pAigNew = Aig_ManStart( Aig_ManNodeNum(pAig) );
+ // 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 PO of the circuit
+ pMiter = Aig_ManConst0( pAigNew );
+ Saig_ManForEachPo( pAig, pObj, i )
+ pMiter = Aig_Or( pAigNew, pMiter, Aig_ObjChild0Copy(pObj) );
+ 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;
+}
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
+