Commit 6eb2e715 by Alan Mishchenko

Simplification in AIG manager object counting.

parent f11f645f
...@@ -109,7 +109,6 @@ struct Aig_Man_t_ ...@@ -109,7 +109,6 @@ struct Aig_Man_t_
int nConstrs; // the number of constraints (model checking only) int nConstrs; // the number of constraints (model checking only)
// AIG node counters // AIG node counters
int nObjs[AIG_OBJ_VOID];// the number of objects by type int nObjs[AIG_OBJ_VOID];// the number of objects by type
int nCreated; // the number of created objects
int nDeleted; // the number of deleted objects int nDeleted; // the number of deleted objects
// structural hash table // structural hash table
Aig_Obj_t ** pTable; // structural hash table Aig_Obj_t ** pTable; // structural hash table
...@@ -250,7 +249,7 @@ static inline int Aig_ManAndNum( Aig_Man_t * p ) { return p->nO ...@@ -250,7 +249,7 @@ static inline int Aig_ManAndNum( Aig_Man_t * p ) { return p->nO
static inline int Aig_ManExorNum( Aig_Man_t * p ) { return p->nObjs[AIG_OBJ_EXOR]; } static inline int Aig_ManExorNum( Aig_Man_t * p ) { return p->nObjs[AIG_OBJ_EXOR]; }
static inline int Aig_ManNodeNum( Aig_Man_t * p ) { return p->nObjs[AIG_OBJ_AND]+p->nObjs[AIG_OBJ_EXOR]; } static inline int Aig_ManNodeNum( Aig_Man_t * p ) { return p->nObjs[AIG_OBJ_AND]+p->nObjs[AIG_OBJ_EXOR]; }
static inline int Aig_ManGetCost( Aig_Man_t * p ) { return p->nObjs[AIG_OBJ_AND]+3*p->nObjs[AIG_OBJ_EXOR]; } static inline int Aig_ManGetCost( Aig_Man_t * p ) { return p->nObjs[AIG_OBJ_AND]+3*p->nObjs[AIG_OBJ_EXOR]; }
static inline int Aig_ManObjNum( Aig_Man_t * p ) { return p->nCreated - p->nDeleted; } static inline int Aig_ManObjNum( Aig_Man_t * p ) { return Vec_PtrSize(p->vObjs) - p->nDeleted; }
static inline int Aig_ManObjNumMax( Aig_Man_t * p ) { return Vec_PtrSize(p->vObjs); } static inline int Aig_ManObjNumMax( Aig_Man_t * p ) { return Vec_PtrSize(p->vObjs); }
static inline int Aig_ManRegNum( Aig_Man_t * p ) { return p->nRegs; } static inline int Aig_ManRegNum( Aig_Man_t * p ) { return p->nRegs; }
static inline int Aig_ManConstrNum( Aig_Man_t * p ) { return p->nConstrs; } static inline int Aig_ManConstrNum( Aig_Man_t * p ) { return p->nConstrs; }
...@@ -366,8 +365,8 @@ static inline Aig_Obj_t * Aig_ManFetchMemory( Aig_Man_t * p ) ...@@ -366,8 +365,8 @@ static inline Aig_Obj_t * Aig_ManFetchMemory( Aig_Man_t * p )
Aig_Obj_t * pTemp; Aig_Obj_t * pTemp;
pTemp = (Aig_Obj_t *)Aig_MmFixedEntryFetch( p->pMemObjs ); pTemp = (Aig_Obj_t *)Aig_MmFixedEntryFetch( p->pMemObjs );
memset( pTemp, 0, sizeof(Aig_Obj_t) ); memset( pTemp, 0, sizeof(Aig_Obj_t) );
pTemp->Id = Vec_PtrSize(p->vObjs);
Vec_PtrPush( p->vObjs, pTemp ); Vec_PtrPush( p->vObjs, pTemp );
pTemp->Id = p->nCreated++;
return pTemp; return pTemp;
} }
static inline void Aig_ManRecycleMemory( Aig_Man_t * p, Aig_Obj_t * pEntry ) static inline void Aig_ManRecycleMemory( Aig_Man_t * p, Aig_Obj_t * pEntry )
......
...@@ -100,7 +100,7 @@ int Aig_ManCheck( Aig_Man_t * p ) ...@@ -100,7 +100,7 @@ int Aig_ManCheck( Aig_Man_t * p )
1, Aig_ManCiNum(p), Aig_ManCoNum(p), Aig_ManBufNum(p), Aig_ManAndNum(p), Aig_ManExorNum(p), 1, Aig_ManCiNum(p), Aig_ManCoNum(p), Aig_ManBufNum(p), Aig_ManAndNum(p), Aig_ManExorNum(p),
1 + Aig_ManCiNum(p) + Aig_ManCoNum(p) + Aig_ManBufNum(p) + Aig_ManAndNum(p) + Aig_ManExorNum(p) ); 1 + Aig_ManCiNum(p) + Aig_ManCoNum(p) + Aig_ManBufNum(p) + Aig_ManAndNum(p) + Aig_ManExorNum(p) );
printf( "Created = %d. Deleted = %d. Existing = %d.\n", printf( "Created = %d. Deleted = %d. Existing = %d.\n",
p->nCreated, p->nDeleted, p->nCreated - p->nDeleted ); Aig_ManObjNumMax(p), p->nDeleted, Aig_ManObjNum(p) );
return 0; return 0;
} }
// count the number of nodes in the table // count the number of nodes in the table
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment