abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
csw.h File Reference

Go to the source code of this file.

Functions

ABC_NAMESPACE_HEADER_START
Aig_Man_t
Csw_Sweep (Aig_Man_t *pAig, int nCutsMax, int nLeafMax, int fVerbose)
 INCLUDES ///. More...
 

Function Documentation

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

INCLUDES ///.

CFile****************************************************************

FileName [csw.h]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Cut sweeping.]

Synopsis [External declarations.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - July 11, 2007.]

Revision [

Id:
csw.h,v 1.00 2007/07/11 00:00:00 alanmi Exp

]PARAMETERS ///BASIC TYPES ///MACRO DEFINITIONS ///ITERATORS ///FUNCTION DECLARATIONS ///

INCLUDES ///.

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

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file cswCore.c.

46 {
47  Csw_Man_t * p;
48  Aig_Man_t * pRes;
49  Aig_Obj_t * pObj, * pObjNew, * pObjRes;
50  int i;
51  abctime clk;
52 clk = Abc_Clock();
53  // start the manager
54  p = Csw_ManStart( pAig, nCutsMax, nLeafMax, fVerbose );
55  // set elementary cuts at the PIs
56  Aig_ManForEachCi( p->pManRes, pObj, i )
57  {
58  Csw_ObjPrepareCuts( p, pObj, 1 );
59  Csw_ObjAddRefs( p, pObj, Aig_ManCi(p->pManAig,i)->nRefs );
60  }
61  // process the nodes
62  Aig_ManForEachNode( pAig, pObj, i )
63  {
64  // create the new node
65  pObjNew = Aig_And( p->pManRes, Csw_ObjChild0Equiv(p, pObj), Csw_ObjChild1Equiv(p, pObj) );
66  // check if this node can be represented using another node
67 // pObjRes = Csw_ObjSweep( p, Aig_Regular(pObjNew), pObj->nRefs > 1 );
68 // pObjRes = Aig_NotCond( pObjRes, Aig_IsComplement(pObjNew) );
69  // try recursively if resubsitution is used
70  do {
71  pObjRes = Csw_ObjSweep( p, Aig_Regular(pObjNew), pObj->nRefs > 1 );
72  pObjRes = Aig_NotCond( pObjRes, Aig_IsComplement(pObjNew) );
73  pObjNew = pObjRes;
74  } while ( Csw_ObjCuts(p, Aig_Regular(pObjNew)) == NULL && !Aig_ObjIsConst1(Aig_Regular(pObjNew)) );
75  // save the resulting node
76  Csw_ObjSetEquiv( p, pObj, pObjRes );
77  // add to the reference counter
78  Csw_ObjAddRefs( p, Aig_Regular(pObjRes), pObj->nRefs );
79  }
80  // add the POs
81  Aig_ManForEachCo( pAig, pObj, i )
82  Aig_ObjCreateCo( p->pManRes, Csw_ObjChild0Equiv(p, pObj) );
83  // remove dangling nodes
84  Aig_ManCleanup( p->pManRes );
85  // return the resulting manager
86 p->timeTotal = Abc_Clock() - clk;
87 p->timeOther = p->timeTotal - p->timeCuts - p->timeHash;
88  pRes = p->pManRes;
89  Csw_ManStop( p );
90  return pRes;
91 }
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
Definition: aigObj.c:66
typedefABC_NAMESPACE_HEADER_START struct Csw_Man_t_ Csw_Man_t
INCLUDES ///.
Definition: cswInt.h:52
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Aig_IsComplement(Aig_Obj_t *p)
Definition: aig.h:249
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Definition: aig.h:393
static Aig_Obj_t * Aig_Regular(Aig_Obj_t *p)
Definition: aig.h:246
abctime timeOther
Definition: llb3Image.c:82
#define Aig_ManForEachCo(p, pObj, i)
Definition: aig.h:398
static abctime Abc_Clock()
Definition: abc_global.h:279
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Definition: aigOper.c:104
static Aig_Obj_t * Csw_ObjChild1Equiv(Csw_Man_t *p, Aig_Obj_t *pObj)
Definition: cswInt.h:117
static void Csw_ObjAddRefs(Csw_Man_t *p, Aig_Obj_t *pObj, int nRefs)
Definition: cswInt.h:108
Csw_Cut_t * Csw_ObjPrepareCuts(Csw_Man_t *p, Aig_Obj_t *pObj, int fTriv)
FUNCTION DECLARATIONS ///.
Definition: cswCut.c:453
#define Aig_ManForEachNode(p, pObj, i)
Definition: aig.h:413
static Aig_Obj_t * Aig_ManCi(Aig_Man_t *p, int i)
Definition: aig.h:266
Csw_Man_t * Csw_ManStart(Aig_Man_t *pMan, int nCutsMax, int nLeafMax, int fVerbose)
DECLARATIONS ///.
Definition: cswMan.c:45
static int Aig_ObjIsConst1(Aig_Obj_t *pObj)
Definition: aig.h:274
Definition: aig.h:69
static Csw_Cut_t * Csw_ObjCuts(Csw_Man_t *p, Aig_Obj_t *pObj)
Definition: cswInt.h:110
Aig_Obj_t * Csw_ObjSweep(Csw_Man_t *p, Aig_Obj_t *pObj, int fTriv)
Definition: cswCut.c:492
static Aig_Obj_t * Csw_ObjChild0Equiv(Csw_Man_t *p, Aig_Obj_t *pObj)
Definition: cswInt.h:116
static void Csw_ObjSetEquiv(Csw_Man_t *p, Aig_Obj_t *pObj, Aig_Obj_t *pEquiv)
Definition: cswInt.h:114
static Aig_Obj_t * Aig_NotCond(Aig_Obj_t *p, int c)
Definition: aig.h:248
ABC_INT64_T abctime
Definition: abc_global.h:278
int Aig_ManCleanup(Aig_Man_t *p)
Definition: aigMan.c:265
unsigned int nRefs
Definition: aig.h:81
void Csw_ManStop(Csw_Man_t *p)
Definition: cswMan.c:99