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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START void Ssw_ManLabelPiNodes (Ssw_Man_t *p)
 DECLARATIONS ///. More...
 
void Ssw_ManCollectPis_rec (Aig_Obj_t *pObj, Vec_Ptr_t *vNewPis)
 
void Ssw_ManCollectPos_rec (Ssw_Man_t *p, Aig_Obj_t *pObj, Vec_Int_t *vNewPos)
 
void Ssw_ManLoadSolver (Ssw_Man_t *p, Aig_Obj_t *pRepr, Aig_Obj_t *pObj)
 
void Ssw_ManSweepTransferDyn (Ssw_Man_t *p)
 
int Ssw_ManSweepResimulateDyn (Ssw_Man_t *p, int f)
 
int Ssw_ManSweepResimulateDynLocal (Ssw_Man_t *p, int f)
 
int Ssw_ManSweepDyn (Ssw_Man_t *p)
 

Function Documentation

void Ssw_ManCollectPis_rec ( Aig_Obj_t pObj,
Vec_Ptr_t vNewPis 
)

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

Synopsis [Collects new POs in p->vNewPos.]

Description []

SideEffects []

SeeAlso []

Definition at line 76 of file sswDyn.c.

77 {
78  assert( !Aig_IsComplement(pObj) );
79  if ( pObj->fMarkA )
80  return;
81  pObj->fMarkA = 1;
82  if ( Aig_ObjIsCi(pObj) )
83  {
84  Vec_PtrPush( vNewPis, pObj );
85  return;
86  }
87  assert( Aig_ObjIsNode(pObj) );
88  Ssw_ManCollectPis_rec( Aig_ObjFanin0(pObj), vNewPis );
89  Ssw_ManCollectPis_rec( Aig_ObjFanin1(pObj), vNewPis );
90 }
void Ssw_ManCollectPis_rec(Aig_Obj_t *pObj, Vec_Ptr_t *vNewPis)
Definition: sswDyn.c:76
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Definition: aig.h:308
static int Aig_IsComplement(Aig_Obj_t *p)
Definition: aig.h:249
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
unsigned int fMarkA
Definition: aig.h:79
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
Definition: aig.h:309
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
Definition: aig.h:280
#define assert(ex)
Definition: util_old.h:213
static int Aig_ObjIsCi(Aig_Obj_t *pObj)
Definition: aig.h:275
void Ssw_ManCollectPos_rec ( Ssw_Man_t p,
Aig_Obj_t pObj,
Vec_Int_t vNewPos 
)

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

Synopsis [Collects new POs in p->vNewPos.]

Description []

SideEffects []

SeeAlso []

Definition at line 103 of file sswDyn.c.

104 {
105  Aig_Obj_t * pFanout;
106  int iFanout = -1, i;
107  assert( !Aig_IsComplement(pObj) );
108  if ( pObj->fMarkB )
109  return;
110  pObj->fMarkB = 1;
111  if ( pObj->Id > p->nSRMiterMaxId )
112  return;
113  if ( Aig_ObjIsCo(pObj) )
114  {
115  // skip if it is a register input PO
116  if ( Aig_ObjCioId(pObj) >= Aig_ManCoNum(p->pFrames)-Aig_ManRegNum(p->pAig) )
117  return;
118  // add the number of this constraint
119  Vec_IntPush( vNewPos, Aig_ObjCioId(pObj)/2 );
120  return;
121  }
122  // visit the fanouts
123  assert( p->pFrames->pFanData != NULL );
124  Aig_ObjForEachFanout( p->pFrames, pObj, pFanout, iFanout, i )
125  Ssw_ManCollectPos_rec( p, pFanout, vNewPos );
126 }
#define Aig_ObjForEachFanout(p, pObj, pFanout, iFan, i)
Definition: aig.h:427
void Ssw_ManCollectPos_rec(Ssw_Man_t *p, Aig_Obj_t *pObj, Vec_Int_t *vNewPos)
Definition: sswDyn.c:103
Aig_Man_t * pAig
Definition: llb3Image.c:49
static Llb_Mgr_t * p
Definition: llb3Image.c:950
unsigned int fMarkB
Definition: aig.h:80
static int Aig_IsComplement(Aig_Obj_t *p)
Definition: aig.h:249
static int Aig_ManCoNum(Aig_Man_t *p)
Definition: aig.h:252
Definition: aig.h:69
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
static int Aig_ManRegNum(Aig_Man_t *p)
Definition: aig.h:260
#define assert(ex)
Definition: util_old.h:213
int Id
Definition: aig.h:85
static int Aig_ObjIsCo(Aig_Obj_t *pObj)
Definition: aig.h:276
static int Aig_ObjCioId(Aig_Obj_t *pObj)
Definition: aig.h:285
ABC_NAMESPACE_IMPL_START void Ssw_ManLabelPiNodes ( Ssw_Man_t p)

DECLARATIONS ///.

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

FileName [sswDyn.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Inductive prover with constraints.]

Synopsis [Dynamic loading of constraints.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - September 1, 2008.]

Revision [

Id:
sswDyn.c,v 1.00 2008/09/01 00:00:00 alanmi Exp

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

Synopsis [Label PIs nodes of the frames corresponding to PIs of AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 46 of file sswDyn.c.

47 {
48  Aig_Obj_t * pObj, * pObjFrames;
49  int f, i;
50  Aig_ManConst1( p->pFrames )->fMarkA = 1;
51  Aig_ManConst1( p->pFrames )->fMarkB = 1;
52  for ( f = 0; f < p->nFrames; f++ )
53  {
54  Saig_ManForEachPi( p->pAig, pObj, i )
55  {
56  pObjFrames = Ssw_ObjFrame( p, pObj, f );
57  assert( Aig_ObjIsCi(pObjFrames) );
58  assert( pObjFrames->fMarkB == 0 );
59  pObjFrames->fMarkA = 1;
60  pObjFrames->fMarkB = 1;
61  }
62  }
63 }
Aig_Man_t * pAig
Definition: llb3Image.c:49
static Llb_Mgr_t * p
Definition: llb3Image.c:950
unsigned int fMarkB
Definition: aig.h:80
unsigned int fMarkA
Definition: aig.h:79
Definition: aig.h:69
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
#define assert(ex)
Definition: util_old.h:213
static int Aig_ObjIsCi(Aig_Obj_t *pObj)
Definition: aig.h:275
#define Saig_ManForEachPi(p, pObj, i)
Definition: saig.h:91
static Aig_Obj_t * Ssw_ObjFrame(Ssw_Man_t *p, Aig_Obj_t *pObj, int i)
Definition: sswInt.h:182
void Ssw_ManLoadSolver ( Ssw_Man_t p,
Aig_Obj_t pRepr,
Aig_Obj_t pObj 
)

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

Synopsis [Loads logic cones and relevant constraints.]

Description [Both pRepr and pObj are objects of the AIG. The result is the current SAT solver loaded with the logic cones for pRepr and pObj corresponding to them in the frames, as well as all the relevant constraints.]

SideEffects []

SeeAlso []

Definition at line 142 of file sswDyn.c.

143 {
144  Aig_Obj_t * pObjFrames, * pReprFrames;
145  Aig_Obj_t * pTemp, * pObj0, * pObj1;
146  int i, iConstr, RetValue;
147 
148  assert( pRepr != pObj );
149  // get the corresponding frames nodes
150  pReprFrames = Aig_Regular( Ssw_ObjFrame( p, pRepr, p->pPars->nFramesK ) );
151  pObjFrames = Aig_Regular( Ssw_ObjFrame( p, pObj, p->pPars->nFramesK ) );
152  assert( pReprFrames != pObjFrames );
153  /*
154  // compute the AIG support
155  Vec_PtrClear( p->vNewLos );
156  Ssw_ManCollectPis_rec( pRepr, p->vNewLos );
157  Ssw_ManCollectPis_rec( pObj, p->vNewLos );
158  // add logic cones for register outputs
159  Vec_PtrForEachEntry( Aig_Obj_t *, p->vNewLos, pTemp, i )
160  {
161  pObj0 = Aig_Regular( Ssw_ObjFrame( p, pTemp, p->pPars->nFramesK ) );
162  Ssw_CnfNodeAddToSolver( p->pMSat, pObj0 );
163  }
164 */
165  // add cones for the nodes
166  Ssw_CnfNodeAddToSolver( p->pMSat, pReprFrames );
167  Ssw_CnfNodeAddToSolver( p->pMSat, pObjFrames );
168 
169  // compute the frames support
170  Vec_PtrClear( p->vNewLos );
171  Ssw_ManCollectPis_rec( pReprFrames, p->vNewLos );
172  Ssw_ManCollectPis_rec( pObjFrames, p->vNewLos );
173  // these nodes include both nodes corresponding to PIs and LOs
174  // (the nodes corresponding to PIs should be labeled with fMarkB!)
175 
176  // collect the related constraint POs
177  Vec_IntClear( p->vNewPos );
178  Vec_PtrForEachEntry( Aig_Obj_t *, p->vNewLos, pTemp, i )
179  Ssw_ManCollectPos_rec( p, pTemp, p->vNewPos );
180  // check if the corresponding pairs are added
181  Vec_IntForEachEntry( p->vNewPos, iConstr, i )
182  {
183  pObj0 = Aig_ManCo( p->pFrames, 2*iConstr );
184  pObj1 = Aig_ManCo( p->pFrames, 2*iConstr+1 );
185 // if ( pObj0->fMarkB && pObj1->fMarkB )
186  if ( pObj0->fMarkB || pObj1->fMarkB )
187  {
188  pObj0->fMarkB = 1;
189  pObj1->fMarkB = 1;
191  }
192  }
193  if ( p->pMSat->pSat->qtail != p->pMSat->pSat->qhead )
194  {
195  RetValue = sat_solver_simplify(p->pMSat->pSat);
196  assert( RetValue != 0 );
197  }
198 }
void Ssw_ManCollectPos_rec(Ssw_Man_t *p, Aig_Obj_t *pObj, Vec_Int_t *vNewPos)
Definition: sswDyn.c:103
void Ssw_CnfNodeAddToSolver(Ssw_Sat_t *p, Aig_Obj_t *pObj)
Definition: sswCnf.c:351
void Ssw_ManCollectPis_rec(Aig_Obj_t *pObj, Vec_Ptr_t *vNewPis)
Definition: sswDyn.c:76
static Aig_Obj_t * Aig_ObjChild0(Aig_Obj_t *pObj)
Definition: aig.h:310
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int Ssw_NodesAreConstrained(Ssw_Man_t *p, Aig_Obj_t *pOld, Aig_Obj_t *pNew)
Definition: sswSat.c:196
unsigned int fMarkB
Definition: aig.h:80
static Aig_Obj_t * Aig_Regular(Aig_Obj_t *p)
Definition: aig.h:246
Definition: aig.h:69
static Aig_Obj_t * Aig_ManCo(Aig_Man_t *p, int i)
Definition: aig.h:267
int sat_solver_simplify(sat_solver *s)
Definition: satSolver.c:1276
#define assert(ex)
Definition: util_old.h:213
static void Vec_PtrClear(Vec_Ptr_t *p)
Definition: vecPtr.h:545
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecInt.h:54
static Aig_Obj_t * Ssw_ObjFrame(Ssw_Man_t *p, Aig_Obj_t *pObj, int i)
Definition: sswInt.h:182
int Ssw_ManSweepDyn ( Ssw_Man_t p)

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

Synopsis [Performs fraiging for the internal nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 373 of file sswDyn.c.

374 {
375  Bar_Progress_t * pProgress = NULL;
376  Aig_Obj_t * pObj, * pObjNew;
377  int i, f;
378  abctime clk;
379 
380  // perform speculative reduction
381 clk = Abc_Clock();
382  // create timeframes
383  p->pFrames = Ssw_FramesWithClasses( p );
384  Aig_ManFanoutStart( p->pFrames );
385  p->nSRMiterMaxId = Aig_ManObjNumMax( p->pFrames );
386 
387  // map constants and PIs of the last frame
388  f = p->pPars->nFramesK;
389  Ssw_ObjSetFrame( p, Aig_ManConst1(p->pAig), f, Aig_ManConst1(p->pFrames) );
390  Saig_ManForEachPi( p->pAig, pObj, i )
391  Ssw_ObjSetFrame( p, pObj, f, Aig_ObjCreateCi(p->pFrames) );
392  Aig_ManSetCioIds( p->pFrames );
393  // label nodes corresponding to primary inputs
394  Ssw_ManLabelPiNodes( p );
395 p->timeReduce += Abc_Clock() - clk;
396 
397  // prepare simulation info
398  assert( p->vSimInfo == NULL );
399  p->vSimInfo = Vec_PtrAllocSimInfo( Aig_ManCiNum(p->pFrames), 1 );
400  Vec_PtrCleanSimInfo( p->vSimInfo, 0, 1 );
401 
402  // sweep internal nodes
403  p->fRefined = 0;
404  Ssw_ClassesClearRefined( p->ppClasses );
405  if ( p->pPars->fVerbose )
406  pProgress = Bar_ProgressStart( stdout, Aig_ManObjNumMax(p->pAig) );
407  p->iNodeStart = 0;
408  Aig_ManForEachObj( p->pAig, pObj, i )
409  {
410  if ( p->iNodeStart == 0 )
411  p->iNodeStart = i;
412  if ( p->pPars->fVerbose )
413  Bar_ProgressUpdate( pProgress, i, NULL );
414  if ( Saig_ObjIsLo(p->pAig, pObj) )
415  p->fRefined |= Ssw_ManSweepNode( p, pObj, f, 0, NULL );
416  else if ( Aig_ObjIsNode(pObj) )
417  {
418  pObjNew = Aig_And( p->pFrames, Ssw_ObjChild0Fra(p, pObj, f), Ssw_ObjChild1Fra(p, pObj, f) );
419  Ssw_ObjSetFrame( p, pObj, f, pObjNew );
420  p->fRefined |= Ssw_ManSweepNode( p, pObj, f, 0, NULL );
421  }
422  // check if it is time to recycle the solver
423  if ( p->pMSat->pSat == NULL ||
424  (p->pPars->nSatVarMax2 &&
425  p->pMSat->nSatVars > p->pPars->nSatVarMax2 &&
426  p->nRecycleCalls > p->pPars->nRecycleCalls2) )
427  {
428  // resimulate
429  if ( p->nPatterns > 0 )
430  {
431  p->iNodeLast = i;
432  if ( p->pPars->fLocalSim )
434  else
436  p->iNodeStart = i+1;
437  }
438 // Abc_Print( 1, "Recycling SAT solver with %d vars and %d calls.\n",
439 // p->pMSat->nSatVars, p->nRecycleCalls );
440 // Aig_ManCleanMarkAB( p->pAig );
441  Aig_ManCleanMarkAB( p->pFrames );
442  // label nodes corresponding to primary inputs
443  Ssw_ManLabelPiNodes( p );
444  // replace the solver
445  if ( p->pMSat )
446  {
447  p->nVarsMax = Abc_MaxInt( p->nVarsMax, p->pMSat->nSatVars );
448  p->nCallsMax = Abc_MaxInt( p->nCallsMax, p->pMSat->nSolverCalls );
449  Ssw_SatStop( p->pMSat );
450  p->nRecycles++;
451  p->nRecyclesTotal++;
452  p->nRecycleCalls = 0;
453  }
454  p->pMSat = Ssw_SatStart( 0 );
455  assert( p->nPatterns == 0 );
456  }
457  // resimulate
458  if ( p->nPatterns == 32 )
459  {
460  p->iNodeLast = i;
461  if ( p->pPars->fLocalSim )
463  else
465  p->iNodeStart = i+1;
466  }
467  }
468  // resimulate
469  if ( p->nPatterns > 0 )
470  {
471  p->iNodeLast = i;
472  if ( p->pPars->fLocalSim )
474  else
476  }
477  // collect stats
478  if ( p->pPars->fVerbose )
479  Bar_ProgressStop( pProgress );
480 
481  // cleanup
482 // Ssw_ClassesCheck( p->ppClasses );
483  return p->fRefined;
484 }
Aig_Man_t * pAig
Definition: llb3Image.c:49
ABC_NAMESPACE_IMPL_START Ssw_Sat_t * Ssw_SatStart(int fPolarFlip)
DECLARATIONS ///.
Definition: sswCnf.c:45
static int Saig_ObjIsLo(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: saig.h:84
int Ssw_ManSweepResimulateDynLocal(Ssw_Man_t *p, int f)
Definition: sswDyn.c:295
static Aig_Obj_t * Ssw_ObjChild0Fra(Ssw_Man_t *p, Aig_Obj_t *pObj, int i)
Definition: sswInt.h:185
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_PtrCleanSimInfo(Vec_Ptr_t *vInfo, int iWord, int nWords)
Definition: vecPtr.h:968
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
Definition: aigObj.c:45
static abctime Abc_Clock()
Definition: abc_global.h:279
static int Abc_MaxInt(int a, int b)
Definition: abc_global.h:238
static Aig_Obj_t * Ssw_ObjChild1Fra(Ssw_Man_t *p, Aig_Obj_t *pObj, int i)
Definition: sswInt.h:186
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Definition: aigOper.c:104
void Aig_ManFanoutStart(Aig_Man_t *p)
FUNCTION DEFINITIONS ///.
Definition: aigFanout.c:56
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
Definition: aig.h:280
void Ssw_ClassesClearRefined(Ssw_Cla_t *p)
Definition: sswClass.c:243
static void Bar_ProgressUpdate(Bar_Progress_t *p, int nItemsCur, char *pString)
Definition: bar.h:63
ABC_NAMESPACE_IMPL_START void Ssw_ManLabelPiNodes(Ssw_Man_t *p)
DECLARATIONS ///.
Definition: sswDyn.c:46
static int Aig_ManCiNum(Aig_Man_t *p)
Definition: aig.h:251
if(last==0)
Definition: sparse_int.h:34
int Ssw_ManSweepNode(Ssw_Man_t *p, Aig_Obj_t *pObj, int f, int fBmc, Vec_Int_t *vPairs)
Definition: sswSweep.c:187
Definition: aig.h:69
void Aig_ManSetCioIds(Aig_Man_t *p)
Definition: aigUtil.c:965
DECLARATIONS ///.
Definition: bar.c:36
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
#define Aig_ManForEachObj(p, pObj, i)
Definition: aig.h:403
static void Ssw_ObjSetFrame(Ssw_Man_t *p, Aig_Obj_t *pObj, int i, Aig_Obj_t *pNode)
Definition: sswInt.h:183
void Aig_ManCleanMarkAB(Aig_Man_t *p)
Definition: aigUtil.c:186
Aig_Man_t * Ssw_FramesWithClasses(Ssw_Man_t *p)
Definition: sswAig.c:144
#define assert(ex)
Definition: util_old.h:213
void Ssw_SatStop(Ssw_Sat_t *p)
Definition: sswCnf.c:81
ABC_INT64_T abctime
Definition: abc_global.h:278
void Bar_ProgressStop(Bar_Progress_t *p)
Definition: bar.c:126
int Ssw_ManSweepResimulateDyn(Ssw_Man_t *p, int f)
Definition: sswDyn.c:263
Bar_Progress_t * Bar_ProgressStart(FILE *pFile, int nItemsTotal)
FUNCTION DEFINITIONS ///.
Definition: bar.c:66
static Vec_Ptr_t * Vec_PtrAllocSimInfo(int nEntries, int nWords)
Definition: vecPtr.h:929
#define Saig_ManForEachPi(p, pObj, i)
Definition: saig.h:91
int Ssw_ManSweepResimulateDyn ( Ssw_Man_t p,
int  f 
)

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

Synopsis [Performs one round of simulation with counter-examples.]

Description []

SideEffects []

SeeAlso []

Definition at line 263 of file sswDyn.c.

264 {
265  int RetValue1, RetValue2;
266  abctime clk = Abc_Clock();
267  // transfer PI simulation information from storage
268 // Ssw_SmlAssignDist1Plus( p->pSml, p->pPatWords );
270  // simulate internal nodes
271 // Ssw_SmlSimulateOneFrame( p->pSml );
272  Ssw_SmlSimulateOne( p->pSml );
273  // check equivalence classes
274  RetValue1 = Ssw_ClassesRefineConst1( p->ppClasses, 1 );
275  RetValue2 = Ssw_ClassesRefine( p->ppClasses, 1 );
276  // prepare simulation info for the next round
277  Vec_PtrCleanSimInfo( p->vSimInfo, 0, 1 );
278  p->nPatterns = 0;
279  p->nSimRounds++;
280 p->timeSimSat += Abc_Clock() - clk;
281  return RetValue1 > 0 || RetValue2 > 0;
282 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_PtrCleanSimInfo(Vec_Ptr_t *vInfo, int iWord, int nWords)
Definition: vecPtr.h:968
int Ssw_ClassesRefine(Ssw_Cla_t *p, int fRecursive)
Definition: sswClass.c:1034
static abctime Abc_Clock()
Definition: abc_global.h:279
void Ssw_ManSweepTransferDyn(Ssw_Man_t *p)
Definition: sswDyn.c:211
void Ssw_SmlSimulateOne(Ssw_Sml_t *p)
Definition: sswSim.c:1005
ABC_INT64_T abctime
Definition: abc_global.h:278
int Ssw_ClassesRefineConst1(Ssw_Cla_t *p, int fRecursive)
Definition: sswClass.c:1119
int Ssw_ManSweepResimulateDynLocal ( Ssw_Man_t p,
int  f 
)

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

Synopsis [Performs one round of simulation with counter-examples.]

Description []

SideEffects []

SeeAlso []

Definition at line 295 of file sswDyn.c.

296 {
297  Aig_Obj_t * pObj, * pRepr, ** ppClass;
298  int i, k, nSize, RetValue1, RetValue2;
299  abctime clk = Abc_Clock();
300  p->nSimRounds++;
301  // transfer PI simulation information from storage
302 // Ssw_SmlAssignDist1Plus( p->pSml, p->pPatWords );
304  // determine const1 cands and classes to be simulated
305  Vec_PtrClear( p->vResimConsts );
306  Vec_PtrClear( p->vResimClasses );
308  for ( i = p->iNodeStart; i < p->iNodeLast + p->pPars->nResimDelta; i++ )
309  {
310  if ( i >= Aig_ManObjNumMax( p->pAig ) )
311  break;
312  pObj = Aig_ManObj( p->pAig, i );
313  if ( pObj == NULL )
314  continue;
315  if ( Ssw_ObjIsConst1Cand(p->pAig, pObj) )
316  {
317  Vec_PtrPush( p->vResimConsts, pObj );
318  continue;
319  }
320  pRepr = Aig_ObjRepr(p->pAig, pObj);
321  if ( pRepr == NULL )
322  continue;
323  if ( Aig_ObjIsTravIdCurrent(p->pAig, pRepr) )
324  continue;
325  Aig_ObjSetTravIdCurrent(p->pAig, pRepr);
326  Vec_PtrPush( p->vResimClasses, pRepr );
327  }
328  // simulate internal nodes
329 // Ssw_SmlSimulateOneFrame( p->pSml );
330 // Ssw_SmlSimulateOne( p->pSml );
331  // resimulate dynamically
332 // Aig_ManIncrementTravId( p->pAig );
333 // Aig_ObjIsTravIdCurrent( p->pAig, Aig_ManConst1(p->pAig) );
334  p->nVisCounter++;
335  Vec_PtrForEachEntry( Aig_Obj_t *, p->vResimConsts, pObj, i )
336  Ssw_SmlSimulateOneDyn_rec( p->pSml, pObj, p->nFrames-1, p->pVisited, p->nVisCounter );
337  // resimulate the cone of influence of the cand classes
338  Vec_PtrForEachEntry( Aig_Obj_t *, p->vResimClasses, pRepr, i )
339  {
340  ppClass = Ssw_ClassesReadClass( p->ppClasses, pRepr, &nSize );
341  for ( k = 0; k < nSize; k++ )
342  Ssw_SmlSimulateOneDyn_rec( p->pSml, ppClass[k], p->nFrames-1, p->pVisited, p->nVisCounter );
343  }
344 
345  // check equivalence classes
346 // RetValue1 = Ssw_ClassesRefineConst1( p->ppClasses, 1 );
347 // RetValue2 = Ssw_ClassesRefine( p->ppClasses, 1 );
348  // refine these nodes
349  RetValue1 = Ssw_ClassesRefineConst1Group( p->ppClasses, p->vResimConsts, 1 );
350  RetValue2 = 0;
351  Vec_PtrForEachEntry( Aig_Obj_t *, p->vResimClasses, pRepr, i )
352  RetValue2 += Ssw_ClassesRefineOneClass( p->ppClasses, pRepr, 1 );
353 
354  // prepare simulation info for the next round
355  Vec_PtrCleanSimInfo( p->vSimInfo, 0, 1 );
356  p->nPatterns = 0;
357  p->nSimRounds++;
358 p->timeSimSat += Abc_Clock() - clk;
359  return RetValue1 > 0 || RetValue2 > 0;
360 }
static Aig_Obj_t * Aig_ObjRepr(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: aig.h:330
Aig_Man_t * pAig
Definition: llb3Image.c:49
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Aig_ObjIsTravIdCurrent(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: aig.h:295
int Ssw_ClassesRefineConst1Group(Ssw_Cla_t *p, Vec_Ptr_t *vRoots, int fRecursive)
Definition: sswClass.c:1074
static void Vec_PtrCleanSimInfo(Vec_Ptr_t *vInfo, int iWord, int nWords)
Definition: vecPtr.h:968
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static Aig_Obj_t * Aig_ManObj(Aig_Man_t *p, int i)
Definition: aig.h:270
static abctime Abc_Clock()
Definition: abc_global.h:279
static void Aig_ObjSetTravIdCurrent(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: aig.h:293
void Aig_ManIncrementTravId(Aig_Man_t *p)
DECLARATIONS ///.
Definition: aigUtil.c:44
void Ssw_ManSweepTransferDyn(Ssw_Man_t *p)
Definition: sswDyn.c:211
int Ssw_ClassesRefineOneClass(Ssw_Cla_t *p, Aig_Obj_t *pReprOld, int fRecursive)
Definition: sswClass.c:970
Definition: aig.h:69
static int Aig_ManObjNumMax(Aig_Man_t *p)
Definition: aig.h:259
Aig_Obj_t ** Ssw_ClassesReadClass(Ssw_Cla_t *p, Aig_Obj_t *pRepr, int *pnSize)
Definition: sswClass.c:307
static int Ssw_ObjIsConst1Cand(Aig_Man_t *pAig, Aig_Obj_t *pObj)
Definition: sswInt.h:172
static void Vec_PtrClear(Vec_Ptr_t *p)
Definition: vecPtr.h:545
void Ssw_SmlSimulateOneDyn_rec(Ssw_Sml_t *p, Aig_Obj_t *pObj, int f, int *pVisited, int nVisCounter)
Definition: sswSim.c:1076
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
ABC_INT64_T abctime
Definition: abc_global.h:278
void Ssw_ManSweepTransferDyn ( Ssw_Man_t p)

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

Synopsis [Tranfers simulation information from FRAIG to AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 211 of file sswDyn.c.

212 {
213  Aig_Obj_t * pObj, * pObjFraig;
214  unsigned * pInfo;
215  int i, f, nFrames;
216 
217  // transfer simulation information
218  Aig_ManForEachCi( p->pAig, pObj, i )
219  {
220  pObjFraig = Ssw_ObjFrame( p, pObj, 0 );
221  if ( pObjFraig == Aig_ManConst0(p->pFrames) )
222  {
223  Ssw_SmlObjAssignConst( p->pSml, pObj, 0, 0 );
224  continue;
225  }
226  assert( !Aig_IsComplement(pObjFraig) );
227  assert( Aig_ObjIsCi(pObjFraig) );
228  pInfo = (unsigned *)Vec_PtrEntry( p->vSimInfo, Aig_ObjCioId(pObjFraig) );
229  Ssw_SmlObjSetWord( p->pSml, pObj, pInfo[0], 0, 0 );
230  }
231  // set random simulation info for the second frame
232  for ( f = 1; f < p->nFrames; f++ )
233  {
234  Saig_ManForEachPi( p->pAig, pObj, i )
235  {
236  pObjFraig = Ssw_ObjFrame( p, pObj, f );
237  assert( !Aig_IsComplement(pObjFraig) );
238  assert( Aig_ObjIsCi(pObjFraig) );
239  pInfo = (unsigned *)Vec_PtrEntry( p->vSimInfo, Aig_ObjCioId(pObjFraig) );
240  Ssw_SmlObjSetWord( p->pSml, pObj, pInfo[0], 0, f );
241  }
242  }
243  // create random info
244  nFrames = Ssw_SmlNumFrames( p->pSml );
245  for ( ; f < nFrames; f++ )
246  {
247  Saig_ManForEachPi( p->pAig, pObj, i )
248  Ssw_SmlAssignRandomFrame( p->pSml, pObj, f );
249  }
250 }
Aig_Man_t * pAig
Definition: llb3Image.c:49
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
int Ssw_SmlNumFrames(Ssw_Sml_t *p)
Definition: sswSim.c:1288
static Aig_Obj_t * Aig_ManConst0(Aig_Man_t *p)
Definition: aig.h:263
void Ssw_SmlObjSetWord(Ssw_Sml_t *p, Aig_Obj_t *pObj, unsigned Word, int iWord, int iFrame)
Definition: sswSim.c:603
void Ssw_SmlAssignRandomFrame(Ssw_Sml_t *p, Aig_Obj_t *pObj, int iFrame)
Definition: sswSim.c:538
Definition: aig.h:69
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
#define assert(ex)
Definition: util_old.h:213
static int Aig_ObjIsCi(Aig_Obj_t *pObj)
Definition: aig.h:275
static int Aig_ObjCioId(Aig_Obj_t *pObj)
Definition: aig.h:285
void Ssw_SmlObjAssignConst(Ssw_Sml_t *p, Aig_Obj_t *pObj, int fConst1, int iFrame)
Definition: sswSim.c:560
#define Saig_ManForEachPi(p, pObj, i)
Definition: saig.h:91
static Aig_Obj_t * Ssw_ObjFrame(Ssw_Man_t *p, Aig_Obj_t *pObj, int i)
Definition: sswInt.h:182