abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
aigMan.c File Reference
#include "aig.h"
#include "misc/tim/tim.h"

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START
Aig_Man_t
Aig_ManStart (int nNodesMax)
 DECLARATIONS ///. More...
 
Aig_Man_tAig_ManStartFrom (Aig_Man_t *p)
 
Aig_Obj_tAig_ManDup_rec (Aig_Man_t *pNew, Aig_Man_t *p, Aig_Obj_t *pObj)
 
Aig_Man_tAig_ManExtractMiter (Aig_Man_t *p, Aig_Obj_t *pNode1, Aig_Obj_t *pNode2)
 
void Aig_ManStop (Aig_Man_t *p)
 
void Aig_ManStopP (Aig_Man_t **p)
 
int Aig_ManCleanup (Aig_Man_t *p)
 
int Aig_ManAntiCleanup (Aig_Man_t *p)
 
int Aig_ManCiCleanup (Aig_Man_t *p)
 
int Aig_ManCoCleanup (Aig_Man_t *p)
 
void Aig_ManPrintStats (Aig_Man_t *p)
 
void Aig_ManReportImprovement (Aig_Man_t *p, Aig_Man_t *pNew)
 
void Aig_ManSetRegNum (Aig_Man_t *p, int nRegs)
 
void Aig_ManFlipFirstPo (Aig_Man_t *p)
 
void * Aig_ManReleaseData (Aig_Man_t *p)
 

Function Documentation

int Aig_ManAntiCleanup ( Aig_Man_t p)

Function*************************************************************

Synopsis [Adds POs for the nodes that otherwise would be dangling.]

Description [Returns the number of POs added.]

SideEffects []

SeeAlso []

Definition at line 293 of file aigMan.c.

294 {
295  Aig_Obj_t * pNode;
296  int i, nNodesOld = Aig_ManCoNum(p);
297  Aig_ManForEachObj( p, pNode, i )
298  if ( Aig_ObjIsNode(pNode) && Aig_ObjRefs(pNode) == 0 )
299  Aig_ObjCreateCo( p, pNode );
300  return nNodesOld - Aig_ManCoNum(p);
301 }
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
Definition: aigObj.c:66
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
Definition: aig.h:280
static int Aig_ManCoNum(Aig_Man_t *p)
Definition: aig.h:252
if(last==0)
Definition: sparse_int.h:34
Definition: aig.h:69
#define Aig_ManForEachObj(p, pObj, i)
Definition: aig.h:403
static int Aig_ObjRefs(Aig_Obj_t *pObj)
Definition: aig.h:300
int Aig_ManCiCleanup ( Aig_Man_t p)

Function*************************************************************

Synopsis [Removes PIs without fanouts.]

Description [Returns the number of PIs removed.]

SideEffects []

SeeAlso []

Definition at line 314 of file aigMan.c.

315 {
316  Aig_Obj_t * pObj;
317  int i, k = 0, nPisOld = Aig_ManCiNum(p);
318  Vec_PtrForEachEntry( Aig_Obj_t *, p->vCis, pObj, i )
319  {
320  if ( i >= Aig_ManCiNum(p) - Aig_ManRegNum(p) )
321  Vec_PtrWriteEntry( p->vCis, k++, pObj );
322  else if ( Aig_ObjRefs(pObj) > 0 )
323  Vec_PtrWriteEntry( p->vCis, k++, pObj );
324  else
325  Vec_PtrWriteEntry( p->vObjs, pObj->Id, NULL );
326  }
327  Vec_PtrShrink( p->vCis, k );
328  p->nObjs[AIG_OBJ_CI] = Vec_PtrSize( p->vCis );
329  if ( Aig_ManRegNum(p) )
330  p->nTruePis = Aig_ManCiNum(p) - Aig_ManRegNum(p);
331  return nPisOld - Aig_ManCiNum(p);
332 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
static int Aig_ManCiNum(Aig_Man_t *p)
Definition: aig.h:251
Definition: aig.h:69
static void Vec_PtrWriteEntry(Vec_Ptr_t *p, int i, void *Entry)
Definition: vecPtr.h:396
static int Aig_ManRegNum(Aig_Man_t *p)
Definition: aig.h:260
Definition: aig.h:60
static int Aig_ObjRefs(Aig_Obj_t *pObj)
Definition: aig.h:300
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
static void Vec_PtrShrink(Vec_Ptr_t *p, int nSizeNew)
Definition: vecPtr.h:528
int Id
Definition: aig.h:85
int Aig_ManCleanup ( Aig_Man_t p)

Function*************************************************************

Synopsis [Removes combinational logic that does not feed into POs.]

Description [Returns the number of dangling nodes removed.]

SideEffects []

SeeAlso []

Definition at line 265 of file aigMan.c.

266 {
267  Vec_Ptr_t * vObjs;
268  Aig_Obj_t * pNode;
269  int i, nNodesOld = Aig_ManNodeNum(p);
270  // collect roots of dangling nodes
271  vObjs = Vec_PtrAlloc( 100 );
272  Aig_ManForEachObj( p, pNode, i )
273  if ( Aig_ObjIsNode(pNode) && Aig_ObjRefs(pNode) == 0 )
274  Vec_PtrPush( vObjs, pNode );
275  // recursively remove dangling nodes
276  Vec_PtrForEachEntry( Aig_Obj_t *, vObjs, pNode, i )
277  Aig_ObjDelete_rec( p, pNode, 1 );
278  Vec_PtrFree( vObjs );
279  return nNodesOld - Aig_ManNodeNum(p);
280 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static int Aig_ManNodeNum(Aig_Man_t *p)
Definition: aig.h:256
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
Definition: aig.h:280
if(last==0)
Definition: sparse_int.h:34
Definition: aig.h:69
void Aig_ObjDelete_rec(Aig_Man_t *p, Aig_Obj_t *pObj, int fFreeTop)
Definition: aigObj.c:232
#define Aig_ManForEachObj(p, pObj, i)
Definition: aig.h:403
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
static int Aig_ObjRefs(Aig_Obj_t *pObj)
Definition: aig.h:300
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
int Aig_ManCoCleanup ( Aig_Man_t p)

Function*************************************************************

Synopsis [Removes POs with constant input.]

Description [Returns the number of POs removed.]

SideEffects []

SeeAlso []

Definition at line 345 of file aigMan.c.

346 {
347  Aig_Obj_t * pObj;
348  int i, k = 0, nPosOld = Aig_ManCoNum(p);
349  Vec_PtrForEachEntry( Aig_Obj_t *, p->vCos, pObj, i )
350  {
351  if ( i >= Aig_ManCoNum(p) - Aig_ManRegNum(p) )
352  Vec_PtrWriteEntry( p->vCos, k++, pObj );
353  else if ( !Aig_ObjIsConst1(Aig_ObjFanin0(pObj)) || !Aig_ObjFaninC0(pObj) ) // non-const or const1
354  Vec_PtrWriteEntry( p->vCos, k++, pObj );
355  else
356  {
357  Aig_ObjDisconnect( p, pObj );
358  Vec_PtrWriteEntry( p->vObjs, pObj->Id, NULL );
359  }
360  }
361  Vec_PtrShrink( p->vCos, k );
362  p->nObjs[AIG_OBJ_CO] = Vec_PtrSize( p->vCos );
363  if ( Aig_ManRegNum(p) )
364  p->nTruePos = Aig_ManCoNum(p) - Aig_ManRegNum(p);
365  return nPosOld - Aig_ManCoNum(p);
366 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Definition: aig.h:61
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Definition: aig.h:308
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
static int Aig_ManCoNum(Aig_Man_t *p)
Definition: aig.h:252
static int Aig_ObjIsConst1(Aig_Obj_t *pObj)
Definition: aig.h:274
Definition: aig.h:69
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
Definition: aig.h:306
static void Vec_PtrWriteEntry(Vec_Ptr_t *p, int i, void *Entry)
Definition: vecPtr.h:396
static int Aig_ManRegNum(Aig_Man_t *p)
Definition: aig.h:260
void Aig_ObjDisconnect(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: aigObj.c:171
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
static void Vec_PtrShrink(Vec_Ptr_t *p, int nSizeNew)
Definition: vecPtr.h:528
int Id
Definition: aig.h:85
Aig_Obj_t* Aig_ManDup_rec ( Aig_Man_t pNew,
Aig_Man_t p,
Aig_Obj_t pObj 
)

Function*************************************************************

Synopsis [Duplicates the AIG manager recursively.]

Description []

SideEffects []

SeeAlso []

Definition at line 123 of file aigMan.c.

124 {
125  Aig_Obj_t * pObjNew;
126  if ( pObj->pData )
127  return (Aig_Obj_t *)pObj->pData;
128  Aig_ManDup_rec( pNew, p, Aig_ObjFanin0(pObj) );
129  if ( Aig_ObjIsBuf(pObj) )
130  return (Aig_Obj_t *)(pObj->pData = Aig_ObjChild0Copy(pObj));
131  Aig_ManDup_rec( pNew, p, Aig_ObjFanin1(pObj) );
132  pObjNew = Aig_Oper( pNew, Aig_ObjChild0Copy(pObj), Aig_ObjChild1Copy(pObj), Aig_ObjType(pObj) );
133  return (Aig_Obj_t *)(pObj->pData = pObjNew);
134 }
static Aig_Type_t Aig_ObjType(Aig_Obj_t *pObj)
Definition: aig.h:272
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void * pData
Definition: aig.h:87
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Definition: aig.h:308
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
Definition: aig.h:309
Aig_Obj_t * Aig_Oper(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1, Aig_Type_t Type)
Definition: aigOper.c:83
static int Aig_ObjIsBuf(Aig_Obj_t *pObj)
Definition: aig.h:277
Aig_Obj_t * Aig_ManDup_rec(Aig_Man_t *pNew, Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: aigMan.c:123
static Aig_Obj_t * Aig_ObjChild1Copy(Aig_Obj_t *pObj)
Definition: aig.h:313
Definition: aig.h:69
static Aig_Obj_t * Aig_ObjChild0Copy(Aig_Obj_t *pObj)
Definition: aig.h:312
Aig_Man_t* Aig_ManExtractMiter ( Aig_Man_t p,
Aig_Obj_t pNode1,
Aig_Obj_t pNode2 
)

Function*************************************************************

Synopsis [Extracts the miter composed of XOR of the two nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 147 of file aigMan.c.

148 {
149  Aig_Man_t * pNew;
150  Aig_Obj_t * pObj;
151  int i;
152  // create the new manager
153  pNew = Aig_ManStart( Aig_ManObjNumMax(p) );
154  pNew->pName = Abc_UtilStrsav( p->pName );
155  pNew->pSpec = Abc_UtilStrsav( p->pSpec );
156  // create the PIs
157  Aig_ManCleanData( p );
159  Aig_ManForEachCi( p, pObj, i )
160  pObj->pData = Aig_ObjCreateCi(pNew);
161  // dump the nodes
162  Aig_ManDup_rec( pNew, p, pNode1 );
163  Aig_ManDup_rec( pNew, p, pNode2 );
164  // construct the EXOR
165  pObj = Aig_Exor( pNew, (Aig_Obj_t *)pNode1->pData, (Aig_Obj_t *)pNode2->pData );
166  pObj = Aig_NotCond( pObj, Aig_Regular(pObj)->fPhase ^ Aig_IsComplement(pObj) );
167  // add the PO
168  Aig_ObjCreateCo( pNew, pObj );
169  // check the resulting network
170  if ( !Aig_ManCheck(pNew) )
171  printf( "Aig_ManExtractMiter(): The check has failed.\n" );
172  return pNew;
173 }
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
Definition: aigObj.c:66
ABC_DLL int Aig_ManCheck(Aig_Man_t *p)
FUNCTION DECLARATIONS ///.
Definition: aigCheck.c:45
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
void * pData
Definition: aig.h:87
Aig_Obj_t * Aig_Exor(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Definition: aigOper.c:220
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
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
Definition: aigObj.c:45
Aig_Man_t * Aig_ManExtractMiter(Aig_Man_t *p, Aig_Obj_t *pNode1, Aig_Obj_t *pNode2)
Definition: aigMan.c:147
static void check(int expr)
Definition: satSolver.c:46
Aig_Obj_t * Aig_ManDup_rec(Aig_Man_t *pNew, Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: aigMan.c:123
if(last==0)
Definition: sparse_int.h:34
Definition: aig.h:69
static int Aig_ManObjNumMax(Aig_Man_t *p)
Definition: aig.h:259
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
ABC_NAMESPACE_IMPL_START Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
Definition: aigMan.c:47
static Aig_Obj_t * Aig_NotCond(Aig_Obj_t *p, int c)
Definition: aig.h:248
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
void Aig_ManCleanData(Aig_Man_t *p)
Definition: aigUtil.c:205
void Aig_ManFlipFirstPo ( Aig_Man_t p)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 457 of file aigMan.c.

458 {
459  Aig_ObjChild0Flip( Aig_ManCo(p, 0) );
460 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Aig_ObjChild0Flip(Aig_Obj_t *pObj)
Definition: aig.h:316
static Aig_Obj_t * Aig_ManCo(Aig_Man_t *p, int i)
Definition: aig.h:267
void Aig_ManPrintStats ( Aig_Man_t p)

Function*************************************************************

Synopsis [Stops the AIG manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 379 of file aigMan.c.

380 {
381  int nChoices = Aig_ManChoiceNum(p);
382  printf( "%-15s : ", p->pName );
383  printf( "pi = %5d ", Aig_ManCiNum(p)-Aig_ManRegNum(p) );
384  printf( "po = %5d ", Aig_ManCoNum(p)-Aig_ManRegNum(p) );
385  if ( Aig_ManRegNum(p) )
386  printf( "lat = %5d ", Aig_ManRegNum(p) );
387  printf( "and = %7d ", Aig_ManAndNum(p) );
388 // printf( "Eq = %7d ", Aig_ManHaigCounter(p) );
389  if ( Aig_ManExorNum(p) )
390  printf( "xor = %5d ", Aig_ManExorNum(p) );
391  if ( nChoices )
392  printf( "ch = %5d ", nChoices );
393  if ( Aig_ManBufNum(p) )
394  printf( "buf = %5d ", Aig_ManBufNum(p) );
395 // printf( "Cre = %6d ", p->nCreated );
396 // printf( "Del = %6d ", p->nDeleted );
397 // printf( "Lev = %3d ", Aig_ManLevelNum(p) );
398 // printf( "Max = %7d ", Aig_ManObjNumMax(p) );
399  printf( "lev = %3d", Aig_ManLevels(p) );
400  printf( "\n" );
401  fflush( stdout );
402 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Aig_ManBufNum(Aig_Man_t *p)
Definition: aig.h:253
static int Aig_ManCoNum(Aig_Man_t *p)
Definition: aig.h:252
static int Aig_ManCiNum(Aig_Man_t *p)
Definition: aig.h:251
int Aig_ManChoiceNum(Aig_Man_t *p)
Definition: aigUtil.c:1007
static int Aig_ManRegNum(Aig_Man_t *p)
Definition: aig.h:260
static int Aig_ManAndNum(Aig_Man_t *p)
Definition: aig.h:254
static int Aig_ManExorNum(Aig_Man_t *p)
Definition: aig.h:255
int Aig_ManLevels(Aig_Man_t *p)
Definition: aigUtil.c:102
void* Aig_ManReleaseData ( Aig_Man_t p)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 473 of file aigMan.c.

474 {
475  void * pD = p->pData;
476  p->pData = NULL;
477  return pD;
478 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Aig_ManReportImprovement ( Aig_Man_t p,
Aig_Man_t pNew 
)

Function*************************************************************

Synopsis [Reports the reduction of the AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 415 of file aigMan.c.

416 {
417  printf( "REG: Beg = %5d. End = %5d. (R =%5.1f %%) ",
418  Aig_ManRegNum(p), Aig_ManRegNum(pNew),
419  Aig_ManRegNum(p)? 100.0*(Aig_ManRegNum(p)-Aig_ManRegNum(pNew))/Aig_ManRegNum(p) : 0.0 );
420  printf( "AND: Beg = %6d. End = %6d. (R =%5.1f %%)",
422  Aig_ManNodeNum(p)? 100.0*(Aig_ManNodeNum(p)-Aig_ManNodeNum(pNew))/Aig_ManNodeNum(p) : 0.0 );
423  printf( "\n" );
424 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Aig_ManNodeNum(Aig_Man_t *p)
Definition: aig.h:256
static int Aig_ManRegNum(Aig_Man_t *p)
Definition: aig.h:260
void Aig_ManSetRegNum ( Aig_Man_t p,
int  nRegs 
)

Function*************************************************************

Synopsis [Sets the number of registers in the AIG manager.]

Description [This procedure should be called after the manager is fully constructed.]

SideEffects []

SeeAlso []

Definition at line 438 of file aigMan.c.

439 {
440  p->nRegs = nRegs;
441  p->nTruePis = Aig_ManCiNum(p) - nRegs;
442  p->nTruePos = Aig_ManCoNum(p) - nRegs;
443  Aig_ManSetCioIds( p );
444 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Aig_ManCoNum(Aig_Man_t *p)
Definition: aig.h:252
static int Aig_ManCiNum(Aig_Man_t *p)
Definition: aig.h:251
void Aig_ManSetCioIds(Aig_Man_t *p)
Definition: aigUtil.c:965
ABC_NAMESPACE_IMPL_START Aig_Man_t* Aig_ManStart ( int  nNodesMax)

DECLARATIONS ///.

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

FileName [aigMan.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [AIG package.]

Synopsis [AIG manager.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - April 28, 2007.]

Revision [

Id:
aigMan.c,v 1.00 2007/04/28 00:00:00 alanmi Exp

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

Synopsis [Starts the AIG manager.]

Description [The argument of this procedure is a soft limit on the the number of nodes, or 0 if the limit is unknown.]

SideEffects []

SeeAlso []

Definition at line 47 of file aigMan.c.

48 {
49  Aig_Man_t * p;
50  if ( nNodesMax <= 0 )
51  nNodesMax = 10007;
52  // start the manager
53  p = ABC_ALLOC( Aig_Man_t, 1 );
54  memset( p, 0, sizeof(Aig_Man_t) );
55  // perform initializations
56  p->nTravIds = 1;
57  p->fCatchExor = 0;
58  // allocate arrays for nodes
59  p->vCis = Vec_PtrAlloc( 100 );
60  p->vCos = Vec_PtrAlloc( 100 );
61  p->vObjs = Vec_PtrAlloc( 1000 );
62  p->vBufs = Vec_PtrAlloc( 100 );
63  //--jlong -- begin
64  p->unfold2_type_I = Vec_PtrAlloc( 4);
65  p->unfold2_type_II = Vec_PtrAlloc( 4);
66  //--jlong -- end
67  // prepare the internal memory manager
68  p->pMemObjs = Aig_MmFixedStart( sizeof(Aig_Obj_t), nNodesMax );
69  // create the constant node
70  p->pConst1 = Aig_ManFetchMemory( p );
71  p->pConst1->Type = AIG_OBJ_CONST1;
72  p->pConst1->fPhase = 1;
73  p->nObjs[AIG_OBJ_CONST1]++;
74  // start the table
75  p->nTableSize = Abc_PrimeCudd( nNodesMax );
76  p->pTable = ABC_ALLOC( Aig_Obj_t *, p->nTableSize );
77  memset( p->pTable, 0, sizeof(Aig_Obj_t *) * p->nTableSize );
78  return p;
79 }
char * memset()
static int Abc_PrimeCudd(unsigned int p)
Definition: abc_global.h:383
static Aig_Obj_t * Aig_ManFetchMemory(Aig_Man_t *p)
Definition: aig.h:368
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
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
Aig_MmFixed_t * Aig_MmFixedStart(int nEntrySize, int nEntriesMax)
FUNCTION DEFINITIONS ///.
Definition: aigMem.c:96
Definition: aig.h:69
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
Aig_Man_t* Aig_ManStartFrom ( Aig_Man_t p)

Function*************************************************************

Synopsis [Duplicates the AIG manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 92 of file aigMan.c.

93 {
94  Aig_Man_t * pNew;
95  Aig_Obj_t * pObj, * pObjNew;
96  int i;
97  // create the new manager
98  pNew = Aig_ManStart( Aig_ManObjNumMax(p) );
99  pNew->pName = Abc_UtilStrsav( p->pName );
100  pNew->pSpec = Abc_UtilStrsav( p->pSpec );
101  // create the PIs
103  Aig_ManForEachCi( p, pObj, i )
104  {
105  pObjNew = Aig_ObjCreateCi( pNew );
106  pObjNew->Level = pObj->Level;
107  pObj->pData = pObjNew;
108  }
109  return pNew;
110 }
unsigned Level
Definition: aig.h:82
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
void * pData
Definition: aig.h:87
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Definition: aig.h:393
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
Definition: aigObj.c:45
Definition: aig.h:69
static int Aig_ManObjNumMax(Aig_Man_t *p)
Definition: aig.h:259
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
ABC_NAMESPACE_IMPL_START Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
Definition: aigMan.c:47
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
void Aig_ManStop ( Aig_Man_t p)

Function*************************************************************

Synopsis [Stops the AIG manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 187 of file aigMan.c.

188 {
189  Aig_Obj_t * pObj;
190  int i;
191  if ( p->time1 ) { ABC_PRT( "time1", p->time1 ); }
192  if ( p->time2 ) { ABC_PRT( "time2", p->time2 ); }
193  // make sure the nodes have clean marks
194  Aig_ManForEachObj( p, pObj, i )
195  assert( !pObj->fMarkA && !pObj->fMarkB );
196  Tim_ManStopP( (Tim_Man_t **)&p->pManTime );
197  if ( p->pFanData )
198  Aig_ManFanoutStop( p );
199  if ( p->pManExdc )
200  Aig_ManStop( p->pManExdc );
201 // Aig_TableProfile( p );
202  Aig_MmFixedStop( p->pMemObjs, 0 );
203  Vec_PtrFreeP( &p->vCis );
204  Vec_PtrFreeP( &p->vCos );
205  Vec_PtrFreeP( &p->vObjs );
206  Vec_PtrFreeP( &p->vBufs );
207  //--jlong -- begin
208  Vec_PtrFreeP( &p->unfold2_type_I );
209  Vec_PtrFreeP( &p->unfold2_type_II );
210  //--jlong -- end
211  Vec_IntFreeP( &p->vLevelR );
212  Vec_VecFreeP( &p->vLevels );
213  Vec_IntFreeP( &p->vFlopNums );
214  Vec_IntFreeP( &p->vFlopReprs );
215  Vec_VecFreeP( (Vec_Vec_t **)&p->vOnehots );
216  Vec_VecFreeP( &p->vClockDoms );
217  Vec_IntFreeP( &p->vProbs );
218  Vec_IntFreeP( &p->vCiNumsOrig );
219  Vec_PtrFreeP( &p->vMapped );
220  if ( p->vSeqModelVec )
221  Vec_PtrFreeFree( p->vSeqModelVec );
222  ABC_FREE( p->pTerSimData );
223  ABC_FREE( p->pFastSim );
224  ABC_FREE( p->pData );
225  ABC_FREE( p->pSeqModel );
226  ABC_FREE( p->pName );
227  ABC_FREE( p->pSpec );
228  ABC_FREE( p->pObjCopies );
229  ABC_FREE( p->pReprs );
230  ABC_FREE( p->pEquivs );
231  ABC_FREE( p->pTable );
232  ABC_FREE( p );
233 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition: vecVec.h:42
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Aig_MmFixedStop(Aig_MmFixed_t *p, int fVerbose)
Definition: aigMem.c:132
static void Vec_PtrFreeFree(Vec_Ptr_t *p)
Definition: vecPtr.h:569
void Aig_ManFanoutStop(Aig_Man_t *p)
Definition: aigFanout.c:89
if(last==0)
Definition: sparse_int.h:34
Definition: aig.h:69
static void Vec_IntFreeP(Vec_Int_t **p)
Definition: vecInt.h:289
void Tim_ManStopP(Tim_Man_t **p)
Definition: timMan.c:384
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
#define Aig_ManForEachObj(p, pObj, i)
Definition: aig.h:403
#define ABC_FREE(obj)
Definition: abc_global.h:232
#define ABC_PRT(a, t)
Definition: abc_global.h:220
static void Vec_PtrFreeP(Vec_Ptr_t **p)
Definition: vecPtr.h:240
static void Vec_VecFreeP(Vec_Vec_t **p)
Definition: vecVec.h:367
#define assert(ex)
Definition: util_old.h:213
typedefABC_NAMESPACE_HEADER_START struct Tim_Man_t_ Tim_Man_t
INCLUDES ///.
Definition: tim.h:92
void Aig_ManStopP ( Aig_Man_t **  p)

Function*************************************************************

Synopsis [Stops the AIG manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 246 of file aigMan.c.

247 {
248  if ( *p == NULL )
249  return;
250  Aig_ManStop( *p );
251  *p = NULL;
252 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187