abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
sswRarity2.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [sswRarity.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Inductive prover with constraints.]
8 
9  Synopsis [Rarity-driven refinement of equivalence classes.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - September 1, 2008.]
16 
17  Revision [$Id: sswRarity.c,v 1.00 2008/09/01 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include "sswInt.h"
22 #include "aig/gia/giaAig.h"
23 
25 
26 
27 ////////////////////////////////////////////////////////////////////////
28 /// DECLARATIONS ///
29 ////////////////////////////////////////////////////////////////////////
30 
31 typedef struct Ssw_RarMan_t_ Ssw_RarMan_t;
32 struct Ssw_RarMan_t_
33 {
34  // parameters
35  int nWords; // the number of words to simulate
36  int nFrames; // the number of frames to simulate
37  int nBinSize; // the number of flops in one group
38  int fVerbose; // the verbosiness flag
39  int nGroups; // the number of flop groups
40  // internal data
41  Aig_Man_t * pAig; // AIG with equivalence classes
42  Ssw_Cla_t * ppClasses; // equivalence classes
43  Ssw_Sml_t * pSml; // simulation manager
44  Vec_Ptr_t * vSimInfo; // simulation info from pSml manager
45  Vec_Int_t * vInits; // initial state
46  // rarity data
47  int * pRarity; // occur counts for patterns in groups
48  int * pGroupValues; // occur counts in each group
49  double * pPatCosts; // pattern costs
50 
51 };
52 
53 static inline int Ssw_RarGetBinPat( Ssw_RarMan_t * p, int iBin, int iPat )
54 {
55  assert( iBin >= 0 && iBin < Aig_ManRegNum(p->pAig) / p->nBinSize );
56  assert( iPat >= 0 && iPat < (1 << p->nBinSize) );
57  return p->pRarity[iBin * (1 << p->nBinSize) + iPat];
58 }
59 static inline void Ssw_RarSetBinPat( Ssw_RarMan_t * p, int iBin, int iPat, int Value )
60 {
61  assert( iBin >= 0 && iBin < Aig_ManRegNum(p->pAig) / p->nBinSize );
62  assert( iPat >= 0 && iPat < (1 << p->nBinSize) );
63  p->pRarity[iBin * (1 << p->nBinSize) + iPat] = Value;
64 }
65 static inline void Ssw_RarAddToBinPat( Ssw_RarMan_t * p, int iBin, int iPat )
66 {
67  assert( iBin >= 0 && iBin < Aig_ManRegNum(p->pAig) / p->nBinSize );
68  assert( iPat >= 0 && iPat < (1 << p->nBinSize) );
69  p->pRarity[iBin * (1 << p->nBinSize) + iPat]++;
70 }
71 
72 ////////////////////////////////////////////////////////////////////////
73 /// FUNCTION DEFINITIONS ///
74 ////////////////////////////////////////////////////////////////////////
75 
76 /**Function*************************************************************
77 
78  Synopsis []
79 
80  Description []
81 
82  SideEffects []
83 
84  SeeAlso []
85 
86 ***********************************************************************/
87 static Ssw_RarMan_t * Ssw_RarManStart( Aig_Man_t * pAig, int nWords, int nFrames, int nBinSize, int fVerbose )
88 {
89  Ssw_RarMan_t * p;
90  if ( Aig_ManRegNum(pAig) < nBinSize || nBinSize <= 0 )
91  return NULL;
92  p = ABC_CALLOC( Ssw_RarMan_t, 1 );
93  p->pAig = pAig;
94  p->nWords = nWords;
95  p->nFrames = nFrames;
96  p->nBinSize = nBinSize;
97  p->fVerbose = fVerbose;
98  p->nGroups = Aig_ManRegNum(pAig) / nBinSize;
99  p->pRarity = ABC_CALLOC( int, (1 << nBinSize) * p->nGroups );
100  p->pGroupValues = ABC_CALLOC( int, p->nGroups );
101  p->pPatCosts = ABC_CALLOC( double, p->nWords * 32 );
102  p->pSml = Ssw_SmlStart( pAig, 0, nFrames, nWords );
103  p->vSimInfo = Ssw_SmlSimDataPointers( p->pSml );
104  return p;
105 }
106 
107 /**Function*************************************************************
108 
109  Synopsis []
110 
111  Description []
112 
113  SideEffects []
114 
115  SeeAlso []
116 
117 ***********************************************************************/
118 static void Ssw_RarManStop( Ssw_RarMan_t * p )
119 {
120  if ( p->pSml ) Ssw_SmlStop( p->pSml );
121  if ( p->ppClasses ) Ssw_ClassesStop( p->ppClasses );
122  Vec_PtrFreeP( &p->vSimInfo );
123  Vec_IntFreeP( &p->vInits );
124  ABC_FREE( p->pGroupValues );
125  ABC_FREE( p->pPatCosts );
126  ABC_FREE( p->pRarity );
127  ABC_FREE( p );
128 }
129 
130 
131 /**Function*************************************************************
132 
133  Synopsis [Updates rarity counters.]
134 
135  Description []
136 
137  SideEffects []
138 
139  SeeAlso []
140 
141 ***********************************************************************/
143 {
144  Aig_Obj_t * pObj;
145  unsigned * pData;
146  int i, k;
147 /*
148  Saig_ManForEachLi( p->pAig, pObj, i )
149  {
150  pData = (unsigned *)Vec_PtrEntry( p->vSimInfo, Aig_ObjId(pObj) ) + p->nWords * (p->nFrames - 1);
151  Extra_PrintBinary( stdout, pData, 32 ); Abc_Print( 1, "\n" );
152  }
153 */
154  for ( k = 0; k < p->nWords * 32; k++ )
155  {
156  for ( i = 0; i < p->nGroups; i++ )
157  p->pGroupValues[i] = 0;
158  Saig_ManForEachLi( p->pAig, pObj, i )
159  {
160  pData = (unsigned *)Vec_PtrEntry( p->vSimInfo, Aig_ObjId(pObj) ) + p->nWords * (p->nFrames - 1);
161  if ( Abc_InfoHasBit(pData, k) && i / p->nBinSize < p->nGroups )
162  p->pGroupValues[i / p->nBinSize] |= (1 << (i % p->nBinSize));
163  }
164  for ( i = 0; i < p->nGroups; i++ )
165  Ssw_RarAddToBinPat( p, i, p->pGroupValues[i] );
166  }
167 /*
168  for ( i = 0; i < p->nGroups; i++ )
169  {
170  for ( k = 0; k < (1 << p->nBinSize); k++ )
171  Abc_Print( 1, "%d ", Ssw_RarGetBinPat(p, i, k) );
172  Abc_Print( 1, "\n" );
173  }
174 */
175 }
176 
177 /**Function*************************************************************
178 
179  Synopsis [Select best patterns.]
180 
181  Description []
182 
183  SideEffects []
184 
185  SeeAlso []
186 
187 ***********************************************************************/
189 {
190  Aig_Obj_t * pObj;
191  unsigned * pData;
192  int i, k, Value;
193 
194  // for each pattern
195  for ( k = 0; k < p->nWords * 32; k++ )
196  {
197  for ( i = 0; i < p->nGroups; i++ )
198  p->pGroupValues[i] = 0;
199  // compute its group values
200  Saig_ManForEachLi( p->pAig, pObj, i )
201  {
202  pData = (unsigned *)Vec_PtrEntry( p->vSimInfo, Aig_ObjId(pObj) ) + p->nWords * (p->nFrames - 1);
203  if ( Abc_InfoHasBit(pData, k) && i / p->nBinSize < p->nGroups )
204  p->pGroupValues[i / p->nBinSize] |= (1 << (i % p->nBinSize));
205  }
206  // find the cost of its values
207  p->pPatCosts[k] = 0.0;
208  for ( i = 0; i < p->nGroups; i++ )
209  {
210  Value = Ssw_RarGetBinPat( p, i, p->pGroupValues[i] );
211  assert( Value > 0 );
212  p->pPatCosts[k] += 1.0/(Value*Value);
213  }
214  // print the result
215 // Abc_Print( 1, "%3d : %9.6f\n", k, p->pPatCosts[k] );
216  }
217 
218  // choose as many as there are words
219  Vec_IntClear( vInits );
220  for ( i = 0; i < p->nWords; i++ )
221  {
222  // select the best
223  int iPatBest = -1;
224  double iCostBest = -ABC_INFINITY;
225  for ( k = 0; k < p->nWords * 32; k++ )
226  if ( iCostBest < p->pPatCosts[k] )
227  {
228  iCostBest = p->pPatCosts[k];
229  iPatBest = k;
230  }
231  // remove from costs
232  assert( iPatBest >= 0 );
233  p->pPatCosts[iPatBest] = -ABC_INFINITY;
234  // set the flops
235  Saig_ManForEachLi( p->pAig, pObj, k )
236  {
237  pData = (unsigned *)Vec_PtrEntry( p->vSimInfo, Aig_ObjId(pObj) ) + p->nWords * (p->nFrames - 1);
238  Vec_IntPush( vInits, Abc_InfoHasBit(pData, iPatBest) );
239  }
240 //Abc_Print( 1, "Best pattern %5d\n", iPatBest );
241  }
242  assert( Vec_IntSize(vInits) == Aig_ManRegNum(p->pAig) * p->nWords );
243 }
244 
245 
246 /**Function*************************************************************
247 
248  Synopsis [Performs fraiging for one node.]
249 
250  Description [Returns the fraiged node.]
251 
252  SideEffects []
253 
254  SeeAlso []
255 
256 ***********************************************************************/
258 {
259  Vec_Int_t * vInit;
260  Aig_Obj_t * pObj, * pObjLi;
261  int f, i, iBit;
262  // assign register outputs
263  Saig_ManForEachLi( pAig, pObj, i )
264  pObj->fMarkB = Abc_InfoHasBit( pCex->pData, i );
265  // simulate the timeframes
266  iBit = pCex->nRegs;
267  for ( f = 0; f <= pCex->iFrame; f++ )
268  {
269  // set the PI simulation information
270  Aig_ManConst1(pAig)->fMarkB = 1;
271  Saig_ManForEachPi( pAig, pObj, i )
272  pObj->fMarkB = Abc_InfoHasBit( pCex->pData, iBit++ );
273  Saig_ManForEachLiLo( pAig, pObjLi, pObj, i )
274  pObj->fMarkB = pObjLi->fMarkB;
275  // simulate internal nodes
276  Aig_ManForEachNode( pAig, pObj, i )
277  pObj->fMarkB = ( Aig_ObjFanin0(pObj)->fMarkB ^ Aig_ObjFaninC0(pObj) )
278  & ( Aig_ObjFanin1(pObj)->fMarkB ^ Aig_ObjFaninC1(pObj) );
279  // assign the COs
280  Aig_ManForEachCo( pAig, pObj, i )
281  pObj->fMarkB = ( Aig_ObjFanin0(pObj)->fMarkB ^ Aig_ObjFaninC0(pObj) );
282  }
283  assert( iBit == pCex->nBits );
284  // check that the output failed as expected -- cannot check because it is not an SRM!
285 // pObj = Aig_ManCo( pAig, pCex->iPo );
286 // if ( pObj->fMarkB != 1 )
287 // Abc_Print( 1, "The counter-example does not refine the output.\n" );
288  // record the new pattern
289  vInit = Vec_IntAlloc( Saig_ManRegNum(pAig) );
290  Saig_ManForEachLo( pAig, pObj, i )
291  Vec_IntPush( vInit, pObj->fMarkB );
292  return vInit;
293 }
294 
295 
296 /**Function*************************************************************
297 
298  Synopsis [Perform sequential simulation.]
299 
300  Description []
301 
302  SideEffects []
303 
304  SeeAlso []
305 
306 ***********************************************************************/
307 int Ssw_RarSimulate2( Aig_Man_t * pAig, int nFrames, int nWords, int nBinSize, int nRounds, int TimeOut, int fVerbose )
308 {
309  int fMiter = 1;
310  Ssw_RarMan_t * p;
311  int r;
312  abctime clk, clkTotal = Abc_Clock();
313  abctime nTimeToStop = TimeOut ? TimeOut * CLOCKS_PER_SEC + Abc_Clock(): 0;
314  int RetValue = -1;
315  assert( Aig_ManRegNum(pAig) > 0 );
316  assert( Aig_ManConstrNum(pAig) == 0 );
317  // consider the case of empty AIG
318  if ( Aig_ManNodeNum(pAig) == 0 )
319  return -1;
320  if ( fVerbose )
321  Abc_Print( 1, "Simulating %d words through %d frames with %d binsize, %d rounds, and %d sec timeout.\n",
322  nWords, nFrames, nBinSize, nRounds, TimeOut );
323  // reset random numbers
324  Aig_ManRandom( 1 );
325 
326  // create manager
327  p = Ssw_RarManStart( pAig, nWords, nFrames, nBinSize, fVerbose );
328  p->vInits = Vec_IntStart( Aig_ManRegNum(pAig) * nWords );
329  Ssw_SmlInitializeSpecial( p->pSml, p->vInits );
330 
331  // perform simulation rounds
332  for ( r = 0; r < nRounds; r++ )
333  {
334  clk = Abc_Clock();
335  // simulate
336  Ssw_SmlSimulateOne( p->pSml );
337  if ( fMiter && Ssw_SmlCheckNonConstOutputs(p->pSml) )
338  {
339  if ( fVerbose ) Abc_Print( 1, "\n" );
340  Abc_Print( 1, "Simulation asserted a PO in frame f: %d <= f < %d.\n", r * nFrames, (r+1) * nFrames );
341  RetValue = 0;
342  break;
343  }
344  // get initialization patterns
346  Ssw_RarTransferPatterns( p, p->vInits );
347  Ssw_SmlInitializeSpecial( p->pSml, p->vInits );
348  // printout
349  if ( fVerbose )
350  {
351 // Abc_Print( 1, "Round %3d: ", r );
352 // Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
353  Abc_Print( 1, "." );
354  }
355  // check timeout
356  if ( TimeOut && Abc_Clock() > nTimeToStop )
357  {
358  if ( fVerbose ) Abc_Print( 1, "\n" );
359  Abc_Print( 1, "Reached timeout (%d seconds).\n", TimeOut );
360  break;
361  }
362  }
363  if ( r == nRounds )
364  {
365  if ( fVerbose ) Abc_Print( 1, "\n" );
366  Abc_Print( 1, "Simulation did not assert POs in the first %d frames. ", nRounds * nFrames );
367  Abc_PrintTime( 1, "Time", Abc_Clock() - clkTotal );
368  }
369  // cleanup
370  Ssw_RarManStop( p );
371  return RetValue;
372 }
373 
374 
375 /**Function*************************************************************
376 
377  Synopsis [Filter equivalence classes of nodes.]
378 
379  Description []
380 
381  SideEffects []
382 
383  SeeAlso []
384 
385 ***********************************************************************/
386 int Ssw_RarSignalFilter2( Aig_Man_t * pAig, int nFrames, int nWords, int nBinSize, int nRounds, int TimeOut, Abc_Cex_t * pCex, int fLatchOnly, int fVerbose )
387 {
388  int fMiter = 0;
389  Ssw_RarMan_t * p;
390  int r, i, k;
391  abctime clkTotal = Abc_Clock();
392  abctime nTimeToStop = TimeOut ? TimeOut * CLOCKS_PER_SEC + Abc_Clock(): 0;
393  int RetValue = -1;
394  assert( Aig_ManRegNum(pAig) > 0 );
395  assert( Aig_ManConstrNum(pAig) == 0 );
396  // consider the case of empty AIG
397  if ( Aig_ManNodeNum(pAig) == 0 )
398  return -1;
399  if ( fVerbose )
400  Abc_Print( 1, "Filtering equivs with %d words through %d frames with %d binsize, %d rounds, and %d sec timeout.\n",
401  nWords, nFrames, nBinSize, nRounds, TimeOut );
402  // reset random numbers
403  Aig_ManRandom( 1 );
404 
405  // create manager
406  p = Ssw_RarManStart( pAig, nWords, nFrames, nBinSize, fVerbose );
407  // compute starting state if needed
408  assert( p->vInits == NULL );
409  if ( pCex )
410  p->vInits = Ssw_RarFindStartingState( pAig, pCex );
411  else
412  p->vInits = Vec_IntStart( Aig_ManRegNum(pAig) );
413  // duplicate the array
414  for ( i = 1; i < nWords; i++ )
415  for ( k = 0; k < Aig_ManRegNum(pAig); k++ )
416  Vec_IntPush( p->vInits, Vec_IntEntry(p->vInits, k) );
417  assert( Vec_IntSize(p->vInits) == Aig_ManRegNum(pAig) * nWords );
418  // initialize simulation manager
419  Ssw_SmlInitializeSpecial( p->pSml, p->vInits );
420 
421  // create trivial equivalence classes with all nodes being candidates for constant 1
422  if ( pAig->pReprs == NULL )
423  p->ppClasses = Ssw_ClassesPrepareSimple( pAig, fLatchOnly, 0 );
424  else
425  p->ppClasses = Ssw_ClassesPrepareFromReprs( pAig );
426  Ssw_ClassesSetData( p->ppClasses, p->pSml, NULL, (int(*)(void *,Aig_Obj_t *))Ssw_SmlObjIsConstWord, (int(*)(void *,Aig_Obj_t *,Aig_Obj_t *))Ssw_SmlObjsAreEqualWord );
427  // print the stats
428  if ( fVerbose )
429  {
430  Abc_Print( 1, "Initial : " );
431  Ssw_ClassesPrint( p->ppClasses, 0 );
432  }
433  // refine classes using BMC
434  for ( r = 0; r < nRounds; r++ )
435  {
436  // start filtering equivalence classes
437  if ( Ssw_ClassesCand1Num(p->ppClasses) == 0 && Ssw_ClassesClassNum(p->ppClasses) == 0 )
438  {
439  Abc_Print( 1, "All equivalences are refined away.\n" );
440  break;
441  }
442  // simulate
443  Ssw_SmlSimulateOne( p->pSml );
444  if ( fMiter && Ssw_SmlCheckNonConstOutputs(p->pSml) )
445  {
446  if ( fVerbose ) Abc_Print( 1, "\n" );
447  Abc_Print( 1, "Simulation asserted a PO in frame f: %d <= f < %d.\n", r * nFrames, (r+1) * nFrames );
448  RetValue = 0;
449  break;
450  }
451  // check equivalence classes
452  Ssw_ClassesRefineConst1( p->ppClasses, 1 );
453  Ssw_ClassesRefine( p->ppClasses, 1 );
454  // printout
455  if ( fVerbose )
456  {
457  Abc_Print( 1, "Round %3d: ", r );
458  Ssw_ClassesPrint( p->ppClasses, 0 );
459  }
460  // get initialization patterns
462  Ssw_RarTransferPatterns( p, p->vInits );
463  Ssw_SmlInitializeSpecial( p->pSml, p->vInits );
464  // check timeout
465  if ( TimeOut && Abc_Clock() > nTimeToStop )
466  {
467  if ( fVerbose ) Abc_Print( 1, "\n" );
468  Abc_Print( 1, "Reached timeout (%d seconds).\n", TimeOut );
469  break;
470  }
471  }
472  if ( r == nRounds )
473  {
474  Abc_Print( 1, "Simulation did not assert POs in the first %d frames. ", nRounds * nFrames );
475  Abc_PrintTime( 1, "Time", Abc_Clock() - clkTotal );
476  }
477  // cleanup
478  Ssw_RarManStop( p );
479  return -1;
480 }
481 
482 /**Function*************************************************************
483 
484  Synopsis [Filter equivalence classes of nodes.]
485 
486  Description []
487 
488  SideEffects []
489 
490  SeeAlso []
491 
492 ***********************************************************************/
493 int Ssw_RarSignalFilterGia2( Gia_Man_t * p, int nFrames, int nWords, int nBinSize, int nRounds, int TimeOut, Abc_Cex_t * pCex, int fLatchOnly, int fVerbose )
494 {
495  Aig_Man_t * pAig;
496  int RetValue;
497  pAig = Gia_ManToAigSimple( p );
498  if ( p->pReprs != NULL )
499  {
500  Gia_ManReprToAigRepr2( pAig, p );
501  ABC_FREE( p->pReprs );
502  ABC_FREE( p->pNexts );
503  }
504  RetValue = Ssw_RarSignalFilter2( pAig, nFrames, nWords, nBinSize, nRounds, TimeOut, pCex, fLatchOnly, fVerbose );
505  Gia_ManReprFromAigRepr( pAig, p );
506  Aig_ManStop( pAig );
507  return RetValue;
508 }
509 
510 
511 
512 
513 ////////////////////////////////////////////////////////////////////////
514 /// END OF FILE ///
515 ////////////////////////////////////////////////////////////////////////
516 
517 
int Ssw_SmlCheckNonConstOutputs(Ssw_Sml_t *p)
Definition: sswSim.c:980
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
int Ssw_ClassesClassNum(Ssw_Cla_t *p)
Definition: sswClass.c:275
Vec_Ptr_t * vSimInfo
Definition: sswRarity2.c:44
Aig_Man_t * Gia_ManToAigSimple(Gia_Man_t *p)
Definition: giaAig.c:367
static int Aig_ManConstrNum(Aig_Man_t *p)
Definition: aig.h:261
void Gia_ManReprFromAigRepr(Aig_Man_t *pAig, Gia_Man_t *pGia)
Definition: giaAig.c:487
int * pNexts
Definition: gia.h:122
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
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
static int Abc_InfoHasBit(unsigned *p, int i)
Definition: abc_global.h:258
int Ssw_ClassesCand1Num(Ssw_Cla_t *p)
Definition: sswClass.c:259
#define Saig_ManForEachLiLo(p, pObjLi, pObjLo, i)
Definition: saig.h:101
unsigned int fMarkB
Definition: aig.h:80
int * pGroupValues
Definition: sswRarity2.c:48
Aig_Man_t * pAig
Definition: sswRarity.c:41
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Definition: aig.h:308
void Ssw_ClassesStop(Ssw_Cla_t *p)
Definition: sswClass.c:189
#define Aig_ManForEachCo(p, pObj, i)
Definition: aig.h:398
unsigned Aig_ManRandom(int fReset)
Definition: aigUtil.c:1157
int Ssw_ClassesRefine(Ssw_Cla_t *p, int fRecursive)
Definition: sswClass.c:1034
static void Ssw_RarSetBinPat(Ssw_RarMan_t *p, int iBin, int iPat, int Value)
Definition: sswRarity2.c:59
static abctime Abc_Clock()
Definition: abc_global.h:279
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
Definition: aig.h:309
int Ssw_SmlObjIsConstWord(Ssw_Sml_t *p, Aig_Obj_t *pObj)
Definition: sswSim.c:102
int nWords
Definition: abcNpn.c:127
static int Aig_ManNodeNum(Aig_Man_t *p)
Definition: aig.h:256
static int Ssw_RarGetBinPat(Ssw_RarMan_t *p, int iBin, int iPat)
Definition: sswRarity2.c:53
int Ssw_RarSimulate2(Aig_Man_t *pAig, int nFrames, int nWords, int nBinSize, int nRounds, int TimeOut, int fVerbose)
Definition: sswRarity2.c:307
int Ssw_RarSignalFilterGia2(Gia_Man_t *p, int nFrames, int nWords, int nBinSize, int nRounds, int TimeOut, Abc_Cex_t *pCex, int fLatchOnly, int fVerbose)
Definition: sswRarity2.c:493
static void Abc_PrintTime(int level, const char *pStr, abctime time)
Definition: abc_global.h:367
static void Ssw_RarManStop(Ssw_RarMan_t *p)
Definition: sswRarity2.c:118
static Vec_Int_t * Vec_IntStart(int nSize)
Definition: bblif.c:172
#define Aig_ManForEachNode(p, pObj, i)
Definition: aig.h:413
void Gia_ManReprToAigRepr2(Aig_Man_t *pAig, Gia_Man_t *pGia)
Definition: giaAig.c:459
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
#define Saig_ManForEachLi(p, pObj, i)
Definition: saig.h:98
int Ssw_SmlObjsAreEqualWord(Ssw_Sml_t *p, Aig_Obj_t *pObj0, Aig_Obj_t *pObj1)
Definition: sswSim.c:124
void Ssw_ClassesSetData(Ssw_Cla_t *p, void *pManData, unsigned(*pFuncNodeHash)(void *, Aig_Obj_t *), int(*pFuncNodeIsConst)(void *, Aig_Obj_t *), int(*pFuncNodesAreEqual)(void *, Aig_Obj_t *, Aig_Obj_t *))
Definition: sswClass.c:167
static void Ssw_RarAddToBinPat(Ssw_RarMan_t *p, int iBin, int iPat)
Definition: sswRarity2.c:65
void Ssw_ClassesPrint(Ssw_Cla_t *p, int fVeryVerbose)
Definition: sswClass.c:414
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
Definition: aig.h:69
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
#define Saig_ManForEachLo(p, pObj, i)
Definition: saig.h:96
typedefABC_NAMESPACE_IMPL_START struct Ssw_RarMan_t_ Ssw_RarMan_t
DECLARATIONS ///.
Definition: sswRarity.c:33
static void Vec_IntFreeP(Vec_Int_t **p)
Definition: vecInt.h:289
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
void Ssw_SmlInitializeSpecial(Ssw_Sml_t *p, Vec_Int_t *vInit)
Definition: sswSim.c:928
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
Definition: aig.h:306
static int Saig_ManRegNum(Aig_Man_t *p)
Definition: saig.h:77
void Ssw_SmlStop(Ssw_Sml_t *p)
Definition: sswSim.c:1211
Ssw_Cla_t * ppClasses
Definition: sswRarity.c:42
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
Ssw_Cla_t * Ssw_ClassesPrepareFromReprs(Aig_Man_t *pAig)
Definition: sswClass.c:768
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
Vec_Int_t * vInits
Definition: sswRarity.c:43
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
int Ssw_RarSignalFilter2(Aig_Man_t *pAig, int nFrames, int nWords, int nBinSize, int nRounds, int TimeOut, Abc_Cex_t *pCex, int fLatchOnly, int fVerbose)
Definition: sswRarity2.c:386
Ssw_Cla_t * Ssw_ClassesPrepareSimple(Aig_Man_t *pAig, int fLatchCorr, int nMaxLevs)
Definition: sswClass.c:724
static void Ssw_RarUpdateCounters(Ssw_RarMan_t *p)
Definition: sswRarity2.c:142
static int Aig_ManRegNum(Aig_Man_t *p)
Definition: aig.h:260
void Ssw_SmlSimulateOne(Ssw_Sml_t *p)
Definition: sswSim.c:1005
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static Vec_Int_t * Ssw_RarFindStartingState(Aig_Man_t *pAig, Abc_Cex_t *pCex)
Definition: sswRarity2.c:257
#define ABC_FREE(obj)
Definition: abc_global.h:232
Ssw_Sml_t * pSml
Definition: sswRarity2.c:43
Definition: gia.h:95
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
static void Vec_PtrFreeP(Vec_Ptr_t **p)
Definition: vecPtr.h:240
static int Aig_ObjFaninC1(Aig_Obj_t *pObj)
Definition: aig.h:307
static Ssw_RarMan_t * Ssw_RarManStart(Aig_Man_t *pAig, int nWords, int nFrames, int nBinSize, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: sswRarity2.c:87
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition: abc_global.h:216
static int Aig_ObjId(Aig_Obj_t *pObj)
Definition: aig.h:286
int * pRarity
Definition: sswRarity.c:51
Gia_Rpr_t * pReprs
Definition: gia.h:121
#define assert(ex)
Definition: util_old.h:213
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition: utilCex.h:39
double * pPatCosts
Definition: sswRarity.c:52
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
ABC_INT64_T abctime
Definition: abc_global.h:278
static void Ssw_RarTransferPatterns(Ssw_RarMan_t *p, Vec_Int_t *vInits)
Definition: sswRarity2.c:188
int Ssw_ClassesRefineConst1(Ssw_Cla_t *p, int fRecursive)
Definition: sswClass.c:1119
DECLARATIONS ///.
Definition: sswSim.c:31
Ssw_Sml_t * Ssw_SmlStart(Aig_Man_t *pAig, int nPref, int nFrames, int nWordsFrame)
Definition: sswSim.c:1148
Vec_Ptr_t * Ssw_SmlSimDataPointers(Ssw_Sml_t *p)
Definition: sswSim.c:1189
#define Saig_ManForEachPi(p, pObj, i)
Definition: saig.h:91