summaryrefslogtreecommitdiffstats
path: root/src/aig/csw/cswCore.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2007-07-11 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2007-07-11 08:01:00 -0700
commit066726076deedaf6d5b38ee4ed27eeb4a2b0061a (patch)
tree4d8b8eb2f44d4e6ef2f5176aab58e42ed677236e /src/aig/csw/cswCore.c
parenta8d75dcc60da15644efbd20529609a1495df229a (diff)
downloadabc-066726076deedaf6d5b38ee4ed27eeb4a2b0061a.tar.gz
abc-066726076deedaf6d5b38ee4ed27eeb4a2b0061a.tar.bz2
abc-066726076deedaf6d5b38ee4ed27eeb4a2b0061a.zip
Version abc70711
Diffstat (limited to 'src/aig/csw/cswCore.c')
-rw-r--r--src/aig/csw/cswCore.c80
1 files changed, 80 insertions, 0 deletions
diff --git a/src/aig/csw/cswCore.c b/src/aig/csw/cswCore.c
new file mode 100644
index 00000000..ddf37035
--- /dev/null
+++ b/src/aig/csw/cswCore.c
@@ -0,0 +1,80 @@
+/**CFile****************************************************************
+
+ FileName [cswCore.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [Cut sweeping.]
+
+ Synopsis []
+
+ Author [Alan Mishchenko]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - July 11, 2007.]
+
+ Revision [$Id: cswCore.c,v 1.00 2007/07/11 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "cswInt.h"
+
+////////////////////////////////////////////////////////////////////////
+/// DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+/// FUNCTION DEFINITIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Dar_Man_t * Csw_Sweep( Dar_Man_t * pAig, int nCutsMax, int nLeafMax, int fVerbose )
+{
+ Csw_Man_t * p;
+ Dar_Man_t * pRes;
+ Dar_Obj_t * pObj, * pObjNew, * pObjRes;
+ int i;
+ // start the manager
+ p = Csw_ManStart( pAig, nCutsMax, nLeafMax, fVerbose );
+ // set elementary cuts at the PIs
+ Dar_ManForEachPi( p->pManRes, pObj, i )
+ Csw_ObjPrepareCuts( p, pObj, 1 );
+ // process the nodes
+ Dar_ManForEachNode( pAig, pObj, i )
+ {
+ // create the new node
+ pObjNew = Dar_And( p->pManRes, Csw_ObjChild0Equiv(p, pObj), Csw_ObjChild1Equiv(p, pObj) );
+ // check if this node can be represented using another node
+ pObjRes = Csw_ObjSweep( p, Dar_Regular(pObjNew), pObj->nRefs > 1 );
+ pObjRes = Dar_NotCond( pObjRes, Dar_IsComplement(pObjNew) );
+ // set the resulting node
+ Csw_ObjSetEquiv( p, pObj, pObjRes );
+ }
+ // add the POs
+ Dar_ManForEachPo( pAig, pObj, i )
+ Dar_ObjCreatePo( p->pManRes, Csw_ObjChild0Equiv(p, pObj) );
+ // remove dangling nodes
+ Dar_ManCleanup( p->pManRes );
+ // return the resulting manager
+ pRes = p->pManRes;
+ Csw_ManStop( p );
+ return pRes;
+}
+
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
+