abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
cecClass.c File Reference
#include "cecInt.h"

Go to the source code of this file.

Functions

static
ABC_NAMESPACE_IMPL_START
unsigned * 
Cec_ObjSim (Cec_ManSim_t *p, int Id)
 DECLARATIONS ///. More...
 
static void Cec_ObjSetSim (Cec_ManSim_t *p, int Id, int n)
 
static float Cec_MemUsage (Cec_ManSim_t *p)
 
int Cec_ManSimCompareConst (unsigned *p, int nWords)
 FUNCTION DEFINITIONS ///. More...
 
int Cec_ManSimCompareEqual (unsigned *p0, unsigned *p1, int nWords)
 
int Cec_ManSimCompareConstFirstBit (unsigned *p, int nWords)
 
int Cec_ManSimCompareEqualFirstBit (unsigned *p0, unsigned *p1, int nWords)
 
void Cec_ManSimCompareConstScore (unsigned *p, int nWords, int *pScores)
 
void Cec_ManSimCompareEqualScore (unsigned *p0, unsigned *p1, int nWords, int *pScores)
 
void Cec_ManSimClassCreate (Gia_Man_t *p, Vec_Int_t *vClass)
 
int Cec_ManSimClassRefineOne (Cec_ManSim_t *p, int i)
 
int Cec_ManSimClassRemoveOne (Cec_ManSim_t *p, int i)
 
int Cec_ManSimHashKey (unsigned *pSim, int nWords, int nTableSize)
 
void Cec_ManSimMemRelink (Cec_ManSim_t *p)
 
unsigned * Cec_ManSimSimRef (Cec_ManSim_t *p, int i)
 
unsigned * Cec_ManSimSimDeref (Cec_ManSim_t *p, int i)
 
void Cec_ManSimProcessRefined (Cec_ManSim_t *p, Vec_Int_t *vRefined)
 
void Cec_ManSimSavePattern (Cec_ManSim_t *p, int iPat)
 
void Cec_ManSimFindBestPattern (Cec_ManSim_t *p)
 
int Cec_ManSimAnalyzeOutputs (Cec_ManSim_t *p)
 
int Cec_ManSimSimulateRound (Cec_ManSim_t *p, Vec_Ptr_t *vInfoCis, Vec_Ptr_t *vInfoCos)
 
void Cec_ManSimCreateInfo (Cec_ManSim_t *p, Vec_Ptr_t *vInfoCis, Vec_Ptr_t *vInfoCos)
 
int Cec_ManSimClassesPrepare (Cec_ManSim_t *p, int LevelMax)
 
int Cec_ManSimClassesRefine (Cec_ManSim_t *p)
 

Function Documentation

int Cec_ManSimAnalyzeOutputs ( Cec_ManSim_t p)

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

Synopsis [Returns 1 if computation should stop.]

Description []

SideEffects []

SeeAlso []

Definition at line 584 of file cecClass.c.

585 {
586  unsigned * pInfo, * pInfo2;
587  int i;
588  if ( !p->pPars->fCheckMiter )
589  return 0;
590  assert( p->vCoSimInfo != NULL );
591  // compare outputs with 0
592  if ( p->pPars->fDualOut )
593  {
594  assert( (Gia_ManPoNum(p->pAig) & 1) == 0 );
595  for ( i = 0; i < Gia_ManPoNum(p->pAig); i++ )
596  {
597  pInfo = (unsigned *)Vec_PtrEntry( p->vCoSimInfo, i );
598  pInfo2 = (unsigned *)Vec_PtrEntry( p->vCoSimInfo, ++i );
599  if ( !Cec_ManSimCompareEqual( pInfo, pInfo2, p->nWords ) )
600  {
601  if ( p->iOut == -1 )
602  {
603  p->iOut = i/2;
605  }
606  if ( p->pCexes == NULL )
607  p->pCexes = ABC_CALLOC( void *, Gia_ManPoNum(p->pAig)/2 );
608  if ( p->pCexes[i/2] == NULL )
609  {
610  p->nOuts++;
611  p->pCexes[i/2] = (void *)1;
612  }
613  }
614  }
615  }
616  else
617  {
618  for ( i = 0; i < Gia_ManPoNum(p->pAig); i++ )
619  {
620  pInfo = (unsigned *)Vec_PtrEntry( p->vCoSimInfo, i );
621  if ( !Cec_ManSimCompareConst( pInfo, p->nWords ) )
622  {
623  if ( p->iOut == -1 )
624  {
625  p->iOut = i;
627  }
628  if ( p->pCexes == NULL )
629  p->pCexes = ABC_CALLOC( void *, Gia_ManPoNum(p->pAig) );
630  if ( p->pCexes[i] == NULL )
631  {
632  p->nOuts++;
633  p->pCexes[i] = (void *)1;
634  }
635  }
636  }
637  }
638  return p->pCexes != NULL;
639 }
static int Gia_ManPoNum(Gia_Man_t *p)
Definition: gia.h:386
Gia_Man_t * pAig
Definition: cecInt.h:115
int fCheckMiter
Definition: cec.h:67
int Cec_ManSimCompareConstFirstBit(unsigned *p, int nWords)
Definition: cecClass.c:110
int nWords
Definition: cecInt.h:117
void ** pCexes
Definition: cecInt.h:130
void Cec_ManSimSavePattern(Cec_ManSim_t *p, int iPat)
Definition: cecClass.c:518
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
int Cec_ManSimCompareConst(unsigned *p, int nWords)
FUNCTION DEFINITIONS ///.
Definition: cecClass.c:50
int Cec_ManSimCompareEqualFirstBit(unsigned *p0, unsigned *p1, int nWords)
Definition: cecClass.c:140
Cec_ParSim_t * pPars
Definition: cecInt.h:116
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
Vec_Ptr_t * vCoSimInfo
Definition: cecInt.h:128
int fDualOut
Definition: cec.h:66
#define assert(ex)
Definition: util_old.h:213
int Cec_ManSimCompareEqual(unsigned *p0, unsigned *p1, int nWords)
Definition: cecClass.c:80
void Cec_ManSimClassCreate ( Gia_Man_t p,
Vec_Int_t vClass 
)

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

Synopsis [Creates equivalence class.]

Description []

SideEffects []

SeeAlso []

Definition at line 234 of file cecClass.c.

235 {
236  int Repr = GIA_VOID, EntPrev = -1, Ent, i;
237  assert( Vec_IntSize(vClass) > 0 );
238  Vec_IntForEachEntry( vClass, Ent, i )
239  {
240  if ( i == 0 )
241  {
242  Repr = Ent;
243  Gia_ObjSetRepr( p, Ent, GIA_VOID );
244  EntPrev = Ent;
245  }
246  else
247  {
248  assert( Repr < Ent );
249  Gia_ObjSetRepr( p, Ent, Repr );
250  Gia_ObjSetNext( p, EntPrev, Ent );
251  EntPrev = Ent;
252  }
253  }
254  Gia_ObjSetNext( p, EntPrev, 0 );
255 }
static void Gia_ObjSetRepr(Gia_Man_t *p, int Id, int Num)
Definition: gia.h:888
static void Gia_ObjSetNext(Gia_Man_t *p, int Id, int Num)
Definition: gia.h:913
#define GIA_VOID
Definition: gia.h:45
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
#define assert(ex)
Definition: util_old.h:213
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecInt.h:54
int Cec_ManSimClassesPrepare ( Cec_ManSim_t p,
int  LevelMax 
)

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

Synopsis [Returns 1 if the bug is found.]

Description []

SideEffects []

SeeAlso []

Definition at line 851 of file cecClass.c.

852 {
853  Gia_Obj_t * pObj;
854  int i;
855  assert( p->pAig->pReprs == NULL );
856  // allocate representation
858  p->pAig->pNexts = ABC_CALLOC( int, Gia_ManObjNum(p->pAig) );
859  // create references
861  // set starting representative of internal nodes to be constant 0
862  if ( p->pPars->fLatchCorr )
863  Gia_ManForEachObj( p->pAig, pObj, i )
864  Gia_ObjSetRepr( p->pAig, i, GIA_VOID );
865  else if ( LevelMax == -1 )
866  Gia_ManForEachObj( p->pAig, pObj, i )
867  Gia_ObjSetRepr( p->pAig, i, Gia_ObjIsAnd(pObj) ? 0 : GIA_VOID );
868  else
869  {
870  Gia_ManLevelNum( p->pAig );
871  Gia_ManForEachObj( p->pAig, pObj, i )
872  Gia_ObjSetRepr( p->pAig, i, (Gia_ObjIsAnd(pObj) && Gia_ObjLevel(p->pAig,pObj) <= LevelMax) ? 0 : GIA_VOID );
873  Vec_IntFreeP( &p->pAig->vLevels );
874  }
875  // if sequential simulation, set starting representative of ROs to be constant 0
876  if ( p->pPars->fSeqSimulate )
877  Gia_ManForEachRo( p->pAig, pObj, i )
878  if ( pObj->Value )
879  Gia_ObjSetRepr( p->pAig, Gia_ObjId(p->pAig, pObj), 0 );
880  // perform simulation
881  p->nWords = 1;
882  do {
883  if ( p->pPars->fVerbose )
885  for ( i = 0; i < 4; i++ )
886  {
888  if ( Cec_ManSimSimulateRound( p, p->vCiSimInfo, p->vCoSimInfo ) )
889  return 1;
890  }
891  p->nWords = 2 * p->nWords + 1;
892  }
893  while ( p->nWords <= p->pPars->nWords );
894  return 0;
895 }
int fVerbose
Definition: cec.h:73
int fLatchCorr
Definition: cec.h:70
int * pNexts
Definition: gia.h:122
void Cec_ManSimCreateInfo(Cec_ManSim_t *p, Vec_Ptr_t *vInfoCis, Vec_Ptr_t *vInfoCos)
Definition: cecClass.c:808
int Cec_ManSimSimulateRound(Cec_ManSim_t *p, Vec_Ptr_t *vInfoCis, Vec_Ptr_t *vInfoCos)
Definition: cecClass.c:652
Gia_Man_t * pAig
Definition: cecInt.h:115
int nWords
Definition: abcNpn.c:127
Definition: gia.h:75
void Gia_ManEquivPrintClasses(Gia_Man_t *p, int fVerbose, float Mem)
Definition: giaEquiv.c:304
static void Gia_ObjSetRepr(Gia_Man_t *p, int Id, int Num)
Definition: gia.h:888
void Gia_ManCreateValueRefs(Gia_Man_t *p)
Definition: giaUtil.c:687
static int Gia_ObjLevel(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:501
int nWords
Definition: cecInt.h:117
Vec_Ptr_t * vCiSimInfo
Definition: cecInt.h:127
if(last==0)
Definition: sparse_int.h:34
else
Definition: sparse_int.h:55
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:410
static void Vec_IntFreeP(Vec_Int_t **p)
Definition: vecInt.h:289
#define GIA_VOID
Definition: gia.h:45
static float Cec_MemUsage(Cec_ManSim_t *p)
Definition: cecClass.c:33
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
Definition: gia.h:422
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
Definition: gia.h:984
Cec_ParSim_t * pPars
Definition: cecInt.h:116
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
Vec_Ptr_t * vCoSimInfo
Definition: cecInt.h:128
#define Gia_ManForEachRo(p, pObj, i)
Definition: gia.h:1038
Gia_Rpr_t * pReprs
Definition: gia.h:121
#define assert(ex)
Definition: util_old.h:213
int Gia_ManLevelNum(Gia_Man_t *p)
Definition: giaUtil.c:505
int nWords
Definition: cec.h:61
Definition: gia.h:56
static int Gia_ManObjNum(Gia_Man_t *p)
Definition: gia.h:388
int Cec_ManSimClassesRefine ( Cec_ManSim_t p)

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

Synopsis [Returns 1 if the bug is found.]

Description []

SideEffects []

SeeAlso []

Definition at line 908 of file cecClass.c.

909 {
910  int i;
912  p->nWords = p->pPars->nWords;
913  for ( i = 0; i < p->pPars->nRounds; i++ )
914  {
915  if ( (i % (p->pPars->nRounds / 5)) == 0 && p->pPars->fVerbose )
918  if ( Cec_ManSimSimulateRound( p, p->vCiSimInfo, p->vCoSimInfo ) )
919  return 1;
920  }
921  if ( p->pPars->fVerbose )
923  return 0;
924 }
int fVerbose
Definition: cec.h:73
void Cec_ManSimCreateInfo(Cec_ManSim_t *p, Vec_Ptr_t *vInfoCis, Vec_Ptr_t *vInfoCos)
Definition: cecClass.c:808
int Cec_ManSimSimulateRound(Cec_ManSim_t *p, Vec_Ptr_t *vInfoCis, Vec_Ptr_t *vInfoCos)
Definition: cecClass.c:652
Gia_Man_t * pAig
Definition: cecInt.h:115
void Gia_ManEquivPrintClasses(Gia_Man_t *p, int fVerbose, float Mem)
Definition: giaEquiv.c:304
void Gia_ManCreateValueRefs(Gia_Man_t *p)
Definition: giaUtil.c:687
int nWords
Definition: cecInt.h:117
Vec_Ptr_t * vCiSimInfo
Definition: cecInt.h:127
static float Cec_MemUsage(Cec_ManSim_t *p)
Definition: cecClass.c:33
Cec_ParSim_t * pPars
Definition: cecInt.h:116
Vec_Ptr_t * vCoSimInfo
Definition: cecInt.h:128
int nRounds
Definition: cec.h:63
int nWords
Definition: cec.h:61
int Cec_ManSimClassRefineOne ( Cec_ManSim_t p,
int  i 
)

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

Synopsis [Refines one equivalence class.]

Description []

SideEffects []

SeeAlso []

Definition at line 268 of file cecClass.c.

269 {
270  unsigned * pSim0, * pSim1;
271  int Ent;
272  Vec_IntClear( p->vClassOld );
273  Vec_IntClear( p->vClassNew );
274  Vec_IntPush( p->vClassOld, i );
275  pSim0 = Cec_ObjSim(p, i);
276  Gia_ClassForEachObj1( p->pAig, i, Ent )
277  {
278  pSim1 = Cec_ObjSim(p, Ent);
279  if ( Cec_ManSimCompareEqual( pSim0, pSim1, p->nWords ) )
280  Vec_IntPush( p->vClassOld, Ent );
281  else
282  {
283  Vec_IntPush( p->vClassNew, Ent );
284  if ( p->pBestState )
285  Cec_ManSimCompareEqualScore( pSim0, pSim1, p->nWords, p->pScores );
286  }
287  }
288  if ( Vec_IntSize( p->vClassNew ) == 0 )
289  return 0;
292  if ( Vec_IntSize(p->vClassNew) > 1 )
293  return 1 + Cec_ManSimClassRefineOne( p, Vec_IntEntry(p->vClassNew,0) );
294  return 1;
295 }
void Cec_ManSimCompareEqualScore(unsigned *p0, unsigned *p1, int nWords, int *pScores)
Definition: cecClass.c:202
int * pScores
Definition: cecInt.h:136
Gia_Man_t * pAig
Definition: cecInt.h:115
int Cec_ManSimClassRefineOne(Cec_ManSim_t *p, int i)
Definition: cecClass.c:268
int nWords
Definition: cecInt.h:117
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
#define Gia_ClassForEachObj1(p, i, iObj)
Definition: gia.h:933
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
Vec_Int_t * vClassNew
Definition: cecInt.h:139
void Cec_ManSimClassCreate(Gia_Man_t *p, Vec_Int_t *vClass)
Definition: cecClass.c:234
static ABC_NAMESPACE_IMPL_START unsigned * Cec_ObjSim(Cec_ManSim_t *p, int Id)
DECLARATIONS ///.
Definition: cecClass.c:30
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
int Cec_ManSimCompareEqual(unsigned *p0, unsigned *p1, int nWords)
Definition: cecClass.c:80
Abc_Cex_t * pBestState
Definition: cecInt.h:134
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
Vec_Int_t * vClassOld
Definition: cecInt.h:138
int Cec_ManSimClassRemoveOne ( Cec_ManSim_t p,
int  i 
)

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

Synopsis [Refines one equivalence class.]

Description []

SideEffects []

SeeAlso []

Definition at line 308 of file cecClass.c.

309 {
310  int iRepr, Ent;
311  if ( Gia_ObjIsConst(p->pAig, i) )
312  {
313  Gia_ObjSetRepr( p->pAig, i, GIA_VOID );
314  return 1;
315  }
316  if ( !Gia_ObjIsClass(p->pAig, i) )
317  return 0;
318  assert( Gia_ObjIsClass(p->pAig, i) );
319  iRepr = Gia_ObjRepr( p->pAig, i );
320  if ( iRepr == GIA_VOID )
321  iRepr = i;
322  // collect nodes
323  Vec_IntClear( p->vClassOld );
324  Vec_IntClear( p->vClassNew );
325  Gia_ClassForEachObj( p->pAig, iRepr, Ent )
326  {
327  if ( Ent == i )
328  Vec_IntPush( p->vClassNew, Ent );
329  else
330  Vec_IntPush( p->vClassOld, Ent );
331  }
332  assert( Vec_IntSize( p->vClassNew ) == 1 );
335  assert( !Gia_ObjIsClass(p->pAig, i) );
336  return 1;
337 }
static int Gia_ObjIsClass(Gia_Man_t *p, int Id)
Definition: gia.h:919
Gia_Man_t * pAig
Definition: cecInt.h:115
static void Gia_ObjSetRepr(Gia_Man_t *p, int Id, int Num)
Definition: gia.h:888
static int Gia_ObjIsConst(Gia_Man_t *p, int Id)
Definition: gia.h:915
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
Vec_Int_t * vClassNew
Definition: cecInt.h:139
void Cec_ManSimClassCreate(Gia_Man_t *p, Vec_Int_t *vClass)
Definition: cecClass.c:234
#define Gia_ClassForEachObj(p, i, iObj)
Definition: gia.h:931
#define GIA_VOID
Definition: gia.h:45
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
#define assert(ex)
Definition: util_old.h:213
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
static int Gia_ObjRepr(Gia_Man_t *p, int Id)
Definition: gia.h:887
Vec_Int_t * vClassOld
Definition: cecInt.h:138
int Cec_ManSimCompareConst ( unsigned *  p,
int  nWords 
)

FUNCTION DEFINITIONS ///.

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

Synopsis [Compares simulation info of one node with constant 0.]

Description []

SideEffects []

SeeAlso []

Definition at line 50 of file cecClass.c.

51 {
52  int w;
53  if ( p[0] & 1 )
54  {
55  for ( w = 0; w < nWords; w++ )
56  if ( p[w] != ~0 )
57  return 0;
58  return 1;
59  }
60  else
61  {
62  for ( w = 0; w < nWords; w++ )
63  if ( p[w] != 0 )
64  return 0;
65  return 1;
66  }
67 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int nWords
Definition: abcNpn.c:127
int Cec_ManSimCompareConstFirstBit ( unsigned *  p,
int  nWords 
)

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

Synopsis [Returns the number of the first non-equal bit.]

Description []

SideEffects []

SeeAlso []

Definition at line 110 of file cecClass.c.

111 {
112  int w;
113  if ( p[0] & 1 )
114  {
115  for ( w = 0; w < nWords; w++ )
116  if ( p[w] != ~0 )
117  return 32*w + Gia_WordFindFirstBit( ~p[w] );
118  return -1;
119  }
120  else
121  {
122  for ( w = 0; w < nWords; w++ )
123  if ( p[w] != 0 )
124  return 32*w + Gia_WordFindFirstBit( p[w] );
125  return -1;
126  }
127 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Gia_WordFindFirstBit(unsigned uWord)
Definition: gia.h:321
int nWords
Definition: abcNpn.c:127
void Cec_ManSimCompareConstScore ( unsigned *  p,
int  nWords,
int *  pScores 
)

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

Synopsis [Returns the number of the first non-equal bit.]

Description []

SideEffects []

SeeAlso []

Definition at line 170 of file cecClass.c.

171 {
172  int w, b;
173  if ( p[0] & 1 )
174  {
175  for ( w = 0; w < nWords; w++ )
176  if ( p[w] != ~0 )
177  for ( b = 0; b < 32; b++ )
178  if ( ((~p[w]) >> b ) & 1 )
179  pScores[32*w + b]++;
180  }
181  else
182  {
183  for ( w = 0; w < nWords; w++ )
184  if ( p[w] != 0 )
185  for ( b = 0; b < 32; b++ )
186  if ( ((p[w]) >> b ) & 1 )
187  pScores[32*w + b]++;
188  }
189 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int nWords
Definition: abcNpn.c:127
int Cec_ManSimCompareEqual ( unsigned *  p0,
unsigned *  p1,
int  nWords 
)

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

Synopsis [Compares simulation info of two nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 80 of file cecClass.c.

81 {
82  int w;
83  if ( (p0[0] & 1) == (p1[0] & 1) )
84  {
85  for ( w = 0; w < nWords; w++ )
86  if ( p0[w] != p1[w] )
87  return 0;
88  return 1;
89  }
90  else
91  {
92  for ( w = 0; w < nWords; w++ )
93  if ( p0[w] != ~p1[w] )
94  return 0;
95  return 1;
96  }
97 }
int nWords
Definition: abcNpn.c:127
int Cec_ManSimCompareEqualFirstBit ( unsigned *  p0,
unsigned *  p1,
int  nWords 
)

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

Synopsis [Compares simulation info of two nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 140 of file cecClass.c.

141 {
142  int w;
143  if ( (p0[0] & 1) == (p1[0] & 1) )
144  {
145  for ( w = 0; w < nWords; w++ )
146  if ( p0[w] != p1[w] )
147  return 32*w + Gia_WordFindFirstBit( p0[w] ^ p1[w] );
148  return -1;
149  }
150  else
151  {
152  for ( w = 0; w < nWords; w++ )
153  if ( p0[w] != ~p1[w] )
154  return 32*w + Gia_WordFindFirstBit( p0[w] ^ ~p1[w] );
155  return -1;
156  }
157 }
static int Gia_WordFindFirstBit(unsigned uWord)
Definition: gia.h:321
int nWords
Definition: abcNpn.c:127
void Cec_ManSimCompareEqualScore ( unsigned *  p0,
unsigned *  p1,
int  nWords,
int *  pScores 
)

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

Synopsis [Compares simulation info of two nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 202 of file cecClass.c.

203 {
204  int w, b;
205  if ( (p0[0] & 1) == (p1[0] & 1) )
206  {
207  for ( w = 0; w < nWords; w++ )
208  if ( p0[w] != p1[w] )
209  for ( b = 0; b < 32; b++ )
210  if ( ((p0[w] ^ p1[w]) >> b ) & 1 )
211  pScores[32*w + b]++;
212  }
213  else
214  {
215  for ( w = 0; w < nWords; w++ )
216  if ( p0[w] != ~p1[w] )
217  for ( b = 0; b < 32; b++ )
218  if ( ((p0[w] ^ ~p1[w]) >> b ) & 1 )
219  pScores[32*w + b]++;
220  }
221 }
int nWords
Definition: abcNpn.c:127
void Cec_ManSimCreateInfo ( Cec_ManSim_t p,
Vec_Ptr_t vInfoCis,
Vec_Ptr_t vInfoCos 
)

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

Synopsis [Creates simulation info for this round.]

Description []

SideEffects []

SeeAlso []

Definition at line 808 of file cecClass.c.

809 {
810  unsigned * pRes0, * pRes1;
811  int i, w;
812  if ( p->pPars->fSeqSimulate && Gia_ManRegNum(p->pAig) > 0 )
813  {
814  assert( vInfoCis && vInfoCos );
815  for ( i = 0; i < Gia_ManPiNum(p->pAig); i++ )
816  {
817  pRes0 = (unsigned *)Vec_PtrEntry( vInfoCis, i );
818  for ( w = 0; w < p->nWords; w++ )
819  pRes0[w] = Gia_ManRandom( 0 );
820  }
821  for ( i = 0; i < Gia_ManRegNum(p->pAig); i++ )
822  {
823  pRes0 = (unsigned *)Vec_PtrEntry( vInfoCis, Gia_ManPiNum(p->pAig) + i );
824  pRes1 = (unsigned *)Vec_PtrEntry( vInfoCos, Gia_ManPoNum(p->pAig) + i );
825  for ( w = 0; w < p->nWords; w++ )
826  pRes0[w] = pRes1[w];
827  }
828  }
829  else
830  {
831  for ( i = 0; i < Gia_ManCiNum(p->pAig); i++ )
832  {
833  pRes0 = (unsigned *)Vec_PtrEntry( vInfoCis, i );
834  for ( w = 0; w < p->nWords; w++ )
835  pRes0[w] = Gia_ManRandom( 0 );
836  }
837  }
838 }
static int Gia_ManPoNum(Gia_Man_t *p)
Definition: gia.h:386
int fSeqSimulate
Definition: cec.h:69
Gia_Man_t * pAig
Definition: cecInt.h:115
unsigned Gia_ManRandom(int fReset)
FUNCTION DEFINITIONS ///.
Definition: giaUtil.c:49
int nWords
Definition: cecInt.h:117
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
static int Gia_ManCiNum(Gia_Man_t *p)
Definition: gia.h:383
Cec_ParSim_t * pPars
Definition: cecInt.h:116
#define assert(ex)
Definition: util_old.h:213
static int Gia_ManPiNum(Gia_Man_t *p)
Definition: gia.h:385
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
void Cec_ManSimFindBestPattern ( Cec_ManSim_t p)

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

Synopsis [Find the best pattern using the scores.]

Description []

SideEffects []

SeeAlso []

Definition at line 548 of file cecClass.c.

549 {
550  unsigned * pInfo;
551  int i, ScoreBest = 0, iPatBest = 1; // set the first pattern
552  // find the best pattern
553  for ( i = 0; i < 32 * p->nWords; i++ )
554  if ( ScoreBest < p->pScores[i] )
555  {
556  ScoreBest = p->pScores[i];
557  iPatBest = i;
558  }
559  // compare this with the available patterns - and save
560  if ( p->pBestState->iPo <= ScoreBest )
561  {
562  assert( p->pBestState->nRegs == Gia_ManRegNum(p->pAig) );
563  for ( i = 0; i < Gia_ManRegNum(p->pAig); i++ )
564  {
565  pInfo = (unsigned *)Vec_PtrEntry( p->vCiSimInfo, Gia_ManPiNum(p->pAig) + i );
566  if ( Abc_InfoHasBit(p->pBestState->pData, i) != Abc_InfoHasBit(pInfo, iPatBest) )
567  Abc_InfoXorBit( p->pBestState->pData, i );
568  }
569  p->pBestState->iPo = ScoreBest;
570  }
571 }
int * pScores
Definition: cecInt.h:136
static int Abc_InfoHasBit(unsigned *p, int i)
Definition: abc_global.h:258
static void Abc_InfoXorBit(unsigned *p, int i)
Definition: abc_global.h:260
Gia_Man_t * pAig
Definition: cecInt.h:115
int nWords
Definition: cecInt.h:117
Vec_Ptr_t * vCiSimInfo
Definition: cecInt.h:127
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
#define assert(ex)
Definition: util_old.h:213
Abc_Cex_t * pBestState
Definition: cecInt.h:134
static int Gia_ManPiNum(Gia_Man_t *p)
Definition: gia.h:385
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Cec_ManSimHashKey ( unsigned *  pSim,
int  nWords,
int  nTableSize 
)

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

Synopsis [Computes hash key of the simuation info.]

Description []

SideEffects []

SeeAlso []

Definition at line 350 of file cecClass.c.

351 {
352  static int s_Primes[16] = {
353  1291, 1699, 1999, 2357, 2953, 3313, 3907, 4177,
354  4831, 5147, 5647, 6343, 6899, 7103, 7873, 8147 };
355  unsigned uHash = 0;
356  int i;
357  if ( pSim[0] & 1 )
358  for ( i = 0; i < nWords; i++ )
359  uHash ^= ~pSim[i] * s_Primes[i & 0xf];
360  else
361  for ( i = 0; i < nWords; i++ )
362  uHash ^= pSim[i] * s_Primes[i & 0xf];
363  return (int)(uHash % nTableSize);
364 
365 }
int nWords
Definition: abcNpn.c:127
static int s_Primes[MAX_PRIMES]
Definition: fxuPair.c:30
void Cec_ManSimMemRelink ( Cec_ManSim_t p)

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

Synopsis [Resets pointers to the simulation memory.]

Description []

SideEffects []

SeeAlso []

Definition at line 378 of file cecClass.c.

379 {
380  unsigned * pPlace, Ent;
381  pPlace = (unsigned *)&p->MemFree;
382  for ( Ent = p->nMems * (p->nWords + 1);
383  Ent + p->nWords + 1 < (unsigned)p->nWordsAlloc;
384  Ent += p->nWords + 1 )
385  {
386  *pPlace = Ent;
387  pPlace = p->pMems + Ent;
388  }
389  *pPlace = 0;
390  p->nWordsOld = p->nWords;
391 }
for(p=first;p->value< newval;p=p->next)
int nWords
Definition: cecInt.h:117
int MemFree
Definition: cecInt.h:124
int nWordsOld
Definition: cecInt.h:125
int nWordsAlloc
Definition: cecInt.h:121
unsigned * pMems
Definition: cecInt.h:120
void Cec_ManSimProcessRefined ( Cec_ManSim_t p,
Vec_Int_t vRefined 
)

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

Synopsis [Refines nodes belonging to candidate constant class.]

Description []

SideEffects []

SeeAlso []

Definition at line 467 of file cecClass.c.

468 {
469  unsigned * pSim;
470  int * pTable, nTableSize, i, k, Key;
471  if ( Vec_IntSize(vRefined) == 0 )
472  return;
473  nTableSize = Abc_PrimeCudd( 100 + Vec_IntSize(vRefined) / 3 );
474  pTable = ABC_CALLOC( int, nTableSize );
475  Vec_IntForEachEntry( vRefined, i, k )
476  {
477  pSim = Cec_ObjSim( p, i );
478  assert( !Cec_ManSimCompareConst( pSim, p->nWords ) );
479  Key = Cec_ManSimHashKey( pSim, p->nWords, nTableSize );
480  if ( pTable[Key] == 0 )
481  {
482  assert( Gia_ObjRepr(p->pAig, i) == 0 );
483  assert( Gia_ObjNext(p->pAig, i) == 0 );
484  Gia_ObjSetRepr( p->pAig, i, GIA_VOID );
485  }
486  else
487  {
488  Gia_ObjSetNext( p->pAig, pTable[Key], i );
489  Gia_ObjSetRepr( p->pAig, i, Gia_ObjRepr(p->pAig, pTable[Key]) );
490  if ( Gia_ObjRepr(p->pAig, i) == GIA_VOID )
491  Gia_ObjSetRepr( p->pAig, i, pTable[Key] );
492  assert( Gia_ObjRepr(p->pAig, i) > 0 );
493  }
494  pTable[Key] = i;
495  }
496  Vec_IntForEachEntry( vRefined, i, k )
497  {
498  if ( Gia_ObjIsHead( p->pAig, i ) )
499  Cec_ManSimClassRefineOne( p, i );
500  }
501  Vec_IntForEachEntry( vRefined, i, k )
502  Cec_ManSimSimDeref( p, i );
503  ABC_FREE( pTable );
504 }
static int Abc_PrimeCudd(unsigned int p)
Definition: abc_global.h:383
unsigned * Cec_ManSimSimDeref(Cec_ManSim_t *p, int i)
Definition: cecClass.c:441
static int Gia_ObjIsHead(Gia_Man_t *p, int Id)
Definition: gia.h:916
Gia_Man_t * pAig
Definition: cecInt.h:115
static void Gia_ObjSetRepr(Gia_Man_t *p, int Id, int Num)
Definition: gia.h:888
int Cec_ManSimClassRefineOne(Cec_ManSim_t *p, int i)
Definition: cecClass.c:268
int nWords
Definition: cecInt.h:117
static int Gia_ObjNext(Gia_Man_t *p, int Id)
Definition: gia.h:912
static void Gia_ObjSetNext(Gia_Man_t *p, int Id, int Num)
Definition: gia.h:913
int Cec_ManSimHashKey(unsigned *pSim, int nWords, int nTableSize)
Definition: cecClass.c:350
int Cec_ManSimCompareConst(unsigned *p, int nWords)
FUNCTION DEFINITIONS ///.
Definition: cecClass.c:50
static ABC_NAMESPACE_IMPL_START unsigned * Cec_ObjSim(Cec_ManSim_t *p, int Id)
DECLARATIONS ///.
Definition: cecClass.c:30
#define GIA_VOID
Definition: gia.h:45
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
#define ABC_FREE(obj)
Definition: abc_global.h:232
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
#define assert(ex)
Definition: util_old.h:213
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecInt.h:54
static int Gia_ObjRepr(Gia_Man_t *p, int Id)
Definition: gia.h:887
void Cec_ManSimSavePattern ( Cec_ManSim_t p,
int  iPat 
)

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

Synopsis [Saves the input pattern with the given number.]

Description []

SideEffects []

SeeAlso []

Definition at line 518 of file cecClass.c.

519 {
520  unsigned * pInfo;
521  int i;
522  assert( p->pCexComb == NULL );
523  assert( iPat >= 0 && iPat < 32 * p->nWords );
524  p->pCexComb = (Abc_Cex_t *)ABC_CALLOC( char,
525  sizeof(Abc_Cex_t) + sizeof(unsigned) * Abc_BitWordNum(Gia_ManCiNum(p->pAig)) );
526  p->pCexComb->iPo = p->iOut;
527  p->pCexComb->nPis = Gia_ManCiNum(p->pAig);
528  p->pCexComb->nBits = Gia_ManCiNum(p->pAig);
529  for ( i = 0; i < Gia_ManCiNum(p->pAig); i++ )
530  {
531  pInfo = (unsigned *)Vec_PtrEntry( p->vCiSimInfo, i );
532  if ( Abc_InfoHasBit( pInfo, iPat ) )
533  Abc_InfoSetBit( p->pCexComb->pData, i );
534  }
535 }
Abc_Cex_t * pCexComb
Definition: cecInt.h:133
static int Abc_InfoHasBit(unsigned *p, int i)
Definition: abc_global.h:258
Gia_Man_t * pAig
Definition: cecInt.h:115
int nWords
Definition: abcNpn.c:127
Vec_Ptr_t * vCiSimInfo
Definition: cecInt.h:127
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
static void Abc_InfoSetBit(unsigned *p, int i)
Definition: abc_global.h:259
static int Gia_ManCiNum(Gia_Man_t *p)
Definition: gia.h:383
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
static int Abc_BitWordNum(int nBits)
Definition: abc_global.h:255
#define assert(ex)
Definition: util_old.h:213
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition: utilCex.h:39
unsigned* Cec_ManSimSimDeref ( Cec_ManSim_t p,
int  i 
)

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

Synopsis [Dereferences simulaton info.]

Description []

SideEffects []

SeeAlso []

Definition at line 441 of file cecClass.c.

442 {
443  unsigned * pSim;
444  assert( p->pSimInfo[i] > 0 );
445  pSim = p->pMems + p->pSimInfo[i];
446  if ( --pSim[0] == 0 )
447  {
448  pSim[0] = p->MemFree;
449  p->MemFree = p->pSimInfo[i];
450  p->pSimInfo[i] = 0;
451  p->nMems--;
452  }
453  return pSim;
454 }
int MemFree
Definition: cecInt.h:124
int * pSimInfo
Definition: cecInt.h:119
#define assert(ex)
Definition: util_old.h:213
unsigned * pMems
Definition: cecInt.h:120
unsigned* Cec_ManSimSimRef ( Cec_ManSim_t p,
int  i 
)

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

Synopsis [References simulation info.]

Description []

SideEffects []

SeeAlso []

Definition at line 404 of file cecClass.c.

405 {
406  unsigned * pSim;
407  assert( p->pSimInfo[i] == 0 );
408  if ( p->MemFree == 0 )
409  {
410  if ( p->nWordsAlloc == 0 )
411  {
412  assert( p->pMems == NULL );
413  p->nWordsAlloc = (1<<17); // -> 1Mb
414  p->nMems = 1;
415  }
416  p->nWordsAlloc *= 2;
417  p->pMems = ABC_REALLOC( unsigned, p->pMems, p->nWordsAlloc );
418  Cec_ManSimMemRelink( p );
419  }
420  p->pSimInfo[i] = p->MemFree;
421  pSim = p->pMems + p->MemFree;
422  p->MemFree = pSim[0];
423  pSim[0] = Gia_ObjValue( Gia_ManObj(p->pAig, i) );
424  p->nMems++;
425  if ( p->nMemsMax < p->nMems )
426  p->nMemsMax = p->nMems;
427  return pSim;
428 }
void Cec_ManSimMemRelink(Cec_ManSim_t *p)
Definition: cecClass.c:378
#define ABC_REALLOC(type, obj, num)
Definition: abc_global.h:233
static int Gia_ObjValue(Gia_Obj_t *pObj)
Definition: gia.h:413
Gia_Man_t * pAig
Definition: cecInt.h:115
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
Definition: gia.h:402
int MemFree
Definition: cecInt.h:124
int nMemsMax
Definition: cecInt.h:123
int nWordsAlloc
Definition: cecInt.h:121
int * pSimInfo
Definition: cecInt.h:119
#define assert(ex)
Definition: util_old.h:213
unsigned * pMems
Definition: cecInt.h:120
int Cec_ManSimSimulateRound ( Cec_ManSim_t p,
Vec_Ptr_t vInfoCis,
Vec_Ptr_t vInfoCos 
)

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

Synopsis [Simulates one round.]

Description [Returns the number of PO entry if failed; 0 otherwise.]

SideEffects []

SeeAlso []

Definition at line 652 of file cecClass.c.

653 {
654  Gia_Obj_t * pObj;
655  unsigned * pRes0, * pRes1, * pRes;
656  int i, k, w, Ent, iCiId = 0, iCoId = 0;
657  // prepare internal storage
658  if ( p->nWordsOld != p->nWords )
659  Cec_ManSimMemRelink( p );
660  p->nMemsMax = 0;
661  // allocate score counters
662  ABC_FREE( p->pScores );
663  if ( p->pBestState )
664  p->pScores = ABC_CALLOC( int, 32 * p->nWords );
665  // simulate nodes
666  Vec_IntClear( p->vRefinedC );
667  if ( Gia_ObjValue(Gia_ManConst0(p->pAig)) )
668  {
669  pRes = Cec_ManSimSimRef( p, 0 );
670  for ( w = 1; w <= p->nWords; w++ )
671  pRes[w] = 0;
672  }
673  Gia_ManForEachObj1( p->pAig, pObj, i )
674  {
675  if ( Gia_ObjIsCi(pObj) )
676  {
677  if ( Gia_ObjValue(pObj) == 0 )
678  {
679  iCiId++;
680  continue;
681  }
682  pRes = Cec_ManSimSimRef( p, i );
683  if ( vInfoCis )
684  {
685  pRes0 = (unsigned *)Vec_PtrEntry( vInfoCis, iCiId++ );
686  for ( w = 1; w <= p->nWords; w++ )
687  pRes[w] = pRes0[w-1];
688  }
689  else
690  {
691  for ( w = 1; w <= p->nWords; w++ )
692  pRes[w] = Gia_ManRandom( 0 );
693  }
694  // make sure the first pattern is always zero
695  pRes[1] ^= (pRes[1] & 1);
696  goto references;
697  }
698  if ( Gia_ObjIsCo(pObj) ) // co always has non-zero 1st fanin and zero 2nd fanin
699  {
700  pRes0 = Cec_ManSimSimDeref( p, Gia_ObjFaninId0(pObj,i) );
701  if ( vInfoCos )
702  {
703  pRes = (unsigned *)Vec_PtrEntry( vInfoCos, iCoId++ );
704  if ( Gia_ObjFaninC0(pObj) )
705  for ( w = 1; w <= p->nWords; w++ )
706  pRes[w-1] = ~pRes0[w];
707  else
708  for ( w = 1; w <= p->nWords; w++ )
709  pRes[w-1] = pRes0[w];
710  }
711  continue;
712  }
713  assert( Gia_ObjValue(pObj) );
714  pRes = Cec_ManSimSimRef( p, i );
715  pRes0 = Cec_ManSimSimDeref( p, Gia_ObjFaninId0(pObj,i) );
716  pRes1 = Cec_ManSimSimDeref( p, Gia_ObjFaninId1(pObj,i) );
717 
718 // Abc_Print( 1, "%d,%d ", Gia_ObjValue( Gia_ObjFanin0(pObj) ), Gia_ObjValue( Gia_ObjFanin1(pObj) ) );
719 
720  if ( Gia_ObjFaninC0(pObj) )
721  {
722  if ( Gia_ObjFaninC1(pObj) )
723  for ( w = 1; w <= p->nWords; w++ )
724  pRes[w] = ~(pRes0[w] | pRes1[w]);
725  else
726  for ( w = 1; w <= p->nWords; w++ )
727  pRes[w] = ~pRes0[w] & pRes1[w];
728  }
729  else
730  {
731  if ( Gia_ObjFaninC1(pObj) )
732  for ( w = 1; w <= p->nWords; w++ )
733  pRes[w] = pRes0[w] & ~pRes1[w];
734  else
735  for ( w = 1; w <= p->nWords; w++ )
736  pRes[w] = pRes0[w] & pRes1[w];
737  }
738 
739 references:
740  // if this node is candidate constant, collect it
741  if ( Gia_ObjIsConst(p->pAig, i) && !Cec_ManSimCompareConst(pRes + 1, p->nWords) )
742  {
743  pRes[0]++;
744  Vec_IntPush( p->vRefinedC, i );
745  if ( p->pBestState )
746  Cec_ManSimCompareConstScore( pRes + 1, p->nWords, p->pScores );
747  }
748  // if the node belongs to a class, save it
749  if ( Gia_ObjIsClass(p->pAig, i) )
750  pRes[0]++;
751  // if this is the last node of the class, process it
752  if ( Gia_ObjIsTail(p->pAig, i) )
753  {
754  Vec_IntClear( p->vClassTemp );
755  Gia_ClassForEachObj( p->pAig, Gia_ObjRepr(p->pAig, i), Ent )
756  Vec_IntPush( p->vClassTemp, Ent );
757  Cec_ManSimClassRefineOne( p, Gia_ObjRepr(p->pAig, i) );
758  Vec_IntForEachEntry( p->vClassTemp, Ent, k )
759  Cec_ManSimSimDeref( p, Ent );
760  }
761  }
762 
763  if ( p->pPars->fConstCorr )
764  {
765  Vec_IntForEachEntry( p->vRefinedC, i, k )
766  {
767  Gia_ObjSetRepr( p->pAig, i, GIA_VOID );
768  Cec_ManSimSimDeref( p, i );
769  }
770  Vec_IntClear( p->vRefinedC );
771  }
772 
773  if ( Vec_IntSize(p->vRefinedC) > 0 )
775  assert( vInfoCis == NULL || iCiId == Gia_ManCiNum(p->pAig) );
776  assert( vInfoCos == NULL || iCoId == Gia_ManCoNum(p->pAig) );
777  assert( p->nMems == 1 );
778  if ( p->nMems != 1 )
779  Abc_Print( 1, "Cec_ManSimSimulateRound(): Memory management error!\n" );
780  if ( p->pPars->fVeryVerbose )
782  if ( p->pBestState )
784 /*
785  if ( p->nMems > 1 ) {
786  for ( i = 1; i < p->nObjs; i++ )
787  if ( p->pSims[i] ) {
788  int x = 0;
789  }
790  }
791 */
792  return Cec_ManSimAnalyzeOutputs( p );
793 }
int fVeryVerbose
Definition: cec.h:72
static int Gia_ObjIsClass(Gia_Man_t *p, int Id)
Definition: gia.h:919
unsigned * Cec_ManSimSimRef(Cec_ManSim_t *p, int i)
Definition: cecClass.c:404
int * pScores
Definition: cecInt.h:136
static int Gia_ObjFaninC1(Gia_Obj_t *pObj)
Definition: gia.h:452
unsigned * Cec_ManSimSimDeref(Cec_ManSim_t *p, int i)
Definition: cecClass.c:441
void Cec_ManSimMemRelink(Cec_ManSim_t *p)
Definition: cecClass.c:378
static int Gia_ObjValue(Gia_Obj_t *pObj)
Definition: gia.h:413
Gia_Man_t * pAig
Definition: cecInt.h:115
Definition: gia.h:75
void Gia_ManEquivPrintClasses(Gia_Man_t *p, int fVerbose, float Mem)
Definition: giaEquiv.c:304
unsigned Gia_ManRandom(int fReset)
FUNCTION DEFINITIONS ///.
Definition: giaUtil.c:49
static void Gia_ObjSetRepr(Gia_Man_t *p, int Id, int Num)
Definition: gia.h:888
int Cec_ManSimClassRefineOne(Cec_ManSim_t *p, int i)
Definition: cecClass.c:268
int nWords
Definition: cecInt.h:117
static int Gia_ObjIsConst(Gia_Man_t *p, int Id)
Definition: gia.h:915
if(last==0)
Definition: sparse_int.h:34
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
void Cec_ManSimFindBestPattern(Cec_ManSim_t *p)
Definition: cecClass.c:548
int nMemsMax
Definition: cecInt.h:123
int nWordsOld
Definition: cecInt.h:125
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
#define Gia_ClassForEachObj(p, i, iObj)
Definition: gia.h:931
int Cec_ManSimAnalyzeOutputs(Cec_ManSim_t *p)
Definition: cecClass.c:584
static int Gia_ObjIsCo(Gia_Obj_t *pObj)
Definition: gia.h:421
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
int Cec_ManSimCompareConst(unsigned *p, int nWords)
FUNCTION DEFINITIONS ///.
Definition: cecClass.c:50
static int Gia_ManCiNum(Gia_Man_t *p)
Definition: gia.h:383
static int Gia_ObjIsTail(Gia_Man_t *p, int Id)
Definition: gia.h:918
#define GIA_VOID
Definition: gia.h:45
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static float Cec_MemUsage(Cec_ManSim_t *p)
Definition: cecClass.c:33
void Cec_ManSimCompareConstScore(unsigned *p, int nWords, int *pScores)
Definition: cecClass.c:170
#define ABC_FREE(obj)
Definition: abc_global.h:232
Cec_ParSim_t * pPars
Definition: cecInt.h:116
static Gia_Obj_t * Gia_ManConst0(Gia_Man_t *p)
Definition: gia.h:400
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
Vec_Int_t * vRefinedC
Definition: cecInt.h:141
#define assert(ex)
Definition: util_old.h:213
#define Gia_ManForEachObj1(p, pObj, i)
Definition: gia.h:986
Abc_Cex_t * pBestState
Definition: cecInt.h:134
static int Gia_ObjFaninC0(Gia_Obj_t *pObj)
Definition: gia.h:451
Vec_Int_t * vClassTemp
Definition: cecInt.h:140
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
static int Gia_ObjIsCi(Gia_Obj_t *pObj)
Definition: gia.h:420
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecInt.h:54
static int Gia_ObjFaninId1(Gia_Obj_t *pObj, int ObjId)
Definition: gia.h:461
static int Gia_ObjRepr(Gia_Man_t *p, int Id)
Definition: gia.h:887
void Cec_ManSimProcessRefined(Cec_ManSim_t *p, Vec_Int_t *vRefined)
Definition: cecClass.c:467
static int Gia_ObjFaninId0(Gia_Obj_t *pObj, int ObjId)
Definition: gia.h:460
static int Gia_ManCoNum(Gia_Man_t *p)
Definition: gia.h:384
static float Cec_MemUsage ( Cec_ManSim_t p)
inlinestatic

Definition at line 33 of file cecClass.c.

33 { return 1.0*p->nMemsMax*(p->pPars->nWords+1)/(1<<20); }
int nMemsMax
Definition: cecInt.h:123
Cec_ParSim_t * pPars
Definition: cecInt.h:116
int nWords
Definition: cec.h:61
static void Cec_ObjSetSim ( Cec_ManSim_t p,
int  Id,
int  n 
)
inlinestatic

Definition at line 31 of file cecClass.c.

31 { p->pSimInfo[Id] = n; }
int * pSimInfo
Definition: cecInt.h:119
static ABC_NAMESPACE_IMPL_START unsigned* Cec_ObjSim ( Cec_ManSim_t p,
int  Id 
)
inlinestatic

DECLARATIONS ///.

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

FileName [cecClass.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Combinational equivalence checking.]

Synopsis [Equivalence class refinement.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id:
cecClass.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

]

Definition at line 30 of file cecClass.c.

30 { return p->pMems + p->pSimInfo[Id] + 1; }
int * pSimInfo
Definition: cecInt.h:119
unsigned * pMems
Definition: cecInt.h:120