src/aig/csw/cswCore.c File Reference

#include "cswInt.h"
Include dependency graph for cswCore.c:

Go to the source code of this file.

Functions

Aig_Man_tCsw_Sweep (Aig_Man_t *pAig, int nCutsMax, int nLeafMax, int fVerbose)

Function Documentation

Aig_Man_t* Csw_Sweep ( Aig_Man_t pAig,
int  nCutsMax,
int  nLeafMax,
int  fVerbose 
)

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

] DECLARATIONS /// FUNCTION DEFINITIONS ///Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 42 of file cswCore.c.

00043 {
00044     Csw_Man_t * p;
00045     Aig_Man_t * pRes;
00046     Aig_Obj_t * pObj, * pObjNew, * pObjRes;
00047     int i, clk;
00048 clk = clock();
00049     // start the manager
00050     p = Csw_ManStart( pAig, nCutsMax, nLeafMax, fVerbose );
00051     // set elementary cuts at the PIs
00052     Aig_ManForEachPi( p->pManRes, pObj, i )
00053     {
00054         Csw_ObjPrepareCuts( p, pObj, 1 );
00055         Csw_ObjAddRefs( p, pObj, Aig_ManPi(p->pManAig,i)->nRefs );
00056     }
00057     // process the nodes
00058     Aig_ManForEachNode( pAig, pObj, i )
00059     {
00060         // create the new node
00061         pObjNew = Aig_And( p->pManRes, Csw_ObjChild0Equiv(p, pObj), Csw_ObjChild1Equiv(p, pObj) );
00062         // check if this node can be represented using another node
00063 //        pObjRes = Csw_ObjSweep( p, Aig_Regular(pObjNew), pObj->nRefs > 1 );
00064 //        pObjRes = Aig_NotCond( pObjRes, Aig_IsComplement(pObjNew) );
00065         // try recursively if resubsitution is used
00066         do {
00067             pObjRes = Csw_ObjSweep( p, Aig_Regular(pObjNew), pObj->nRefs > 1 );
00068             pObjRes = Aig_NotCond( pObjRes, Aig_IsComplement(pObjNew) );        
00069             pObjNew = pObjRes;
00070         } while ( Csw_ObjCuts(p, Aig_Regular(pObjNew)) == NULL && !Aig_ObjIsConst1(Aig_Regular(pObjNew)) );
00071         // save the resulting node
00072         Csw_ObjSetEquiv( p, pObj, pObjRes );
00073         // add to the reference counter
00074         Csw_ObjAddRefs( p, Aig_Regular(pObjRes), pObj->nRefs );
00075     }
00076     // add the POs
00077     Aig_ManForEachPo( pAig, pObj, i )
00078         Aig_ObjCreatePo( p->pManRes, Csw_ObjChild0Equiv(p, pObj) );
00079     // remove dangling nodes 
00080     Aig_ManCleanup( p->pManRes );
00081     // return the resulting manager
00082 p->timeTotal = clock() - clk;
00083 p->timeOther = p->timeTotal - p->timeCuts - p->timeHash;
00084     pRes = p->pManRes;
00085     Csw_ManStop( p );
00086     return pRes;
00087 }


Generated on Tue Jan 5 12:18:15 2010 for abc70930 by  doxygen 1.6.1