abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
cecChoice.c File Reference
#include "cecInt.h"
#include "aig/gia/giaAig.h"
#include "proof/dch/dch.h"

Go to the source code of this file.

Functions

static
ABC_NAMESPACE_IMPL_START void 
Cec_ManCombSpecReduce_rec (Gia_Man_t *pNew, Gia_Man_t *p, Gia_Obj_t *pObj)
 DECLARATIONS ///. More...
 
int Cec_ManResimulateCounterExamplesComb (Cec_ManSim_t *pSim, Vec_Int_t *vCexStore)
 
int Gia_ManCheckRefinements (Gia_Man_t *p, Vec_Str_t *vStatus, Vec_Int_t *vOutputs, Cec_ManSim_t *pSim, int fRings)
 
static int Cec_ManCombSpecReal (Gia_Man_t *pNew, Gia_Man_t *p, Gia_Obj_t *pObj)
 FUNCTION DEFINITIONS ///. More...
 
Gia_Man_tCec_ManCombSpecReduce (Gia_Man_t *p, Vec_Int_t **pvOutputs, int fRings)
 
int Cec_ManChoiceComputation_int (Gia_Man_t *pAig, Cec_ParChc_t *pPars)
 
Gia_Man_tCec_ManChoiceComputationVec (Gia_Man_t *pGia, int nGias, Cec_ParChc_t *pPars)
 
Gia_Man_tCec_ManChoiceComputation (Gia_Man_t *pAig, Cec_ParChc_t *pParsChc)
 
Aig_Man_tCec_ComputeChoices (Gia_Man_t *pGia, Dch_Pars_t *pPars)
 

Function Documentation

Aig_Man_t* Cec_ComputeChoices ( Gia_Man_t pGia,
Dch_Pars_t pPars 
)

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

Synopsis [Performs computation of AIGs with choices.]

Description [Takes several AIGs and performs choicing.]

SideEffects []

SeeAlso []

Definition at line 385 of file cecChoice.c.

386 {
387  Cec_ParChc_t ParsChc, * pParsChc = &ParsChc;
388  Aig_Man_t * pAig;
389  if ( pPars->fVerbose )
390  Abc_PrintTime( 1, "Synthesis time", pPars->timeSynth );
391  Cec_ManChcSetDefaultParams( pParsChc );
392  pParsChc->nBTLimit = pPars->nBTLimit;
393  pParsChc->fUseCSat = pPars->fUseCSat;
394  if ( pParsChc->fUseCSat && pParsChc->nBTLimit > 100 )
395  pParsChc->nBTLimit = 100;
396  pParsChc->fVerbose = pPars->fVerbose;
397  pGia = Cec_ManChoiceComputationVec( pGia, 3, pParsChc );
398  Gia_ManSetRegNum( pGia, Gia_ManRegNum(pGia) );
399  pAig = Gia_ManToAig( pGia, 1 );
400  Gia_ManStop( pGia );
401  return pAig;
402 }
int fUseCSat
Definition: cec.h:166
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
void Cec_ManChcSetDefaultParams(Cec_ParChc_t *p)
Definition: cecCore.c:211
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
Definition: giaMan.c:628
static void Abc_PrintTime(int level, const char *pStr, abctime time)
Definition: abc_global.h:367
int nBTLimit
Definition: cec.h:164
Aig_Man_t * Gia_ManToAig(Gia_Man_t *p, int fChoices)
Definition: giaAig.c:277
int fVerbose
Definition: cec.h:168
Gia_Man_t * Cec_ManChoiceComputationVec(Gia_Man_t *pGia, int nGias, Cec_ParChc_t *pPars)
Definition: cecChoice.c:313
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
Gia_Man_t* Cec_ManChoiceComputation ( Gia_Man_t pAig,
Cec_ParChc_t pParsChc 
)

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

Synopsis [Computes choices for one AIGs.]

Description []

SideEffects []

SeeAlso []

Definition at line 348 of file cecChoice.c.

349 {
350 // extern Aig_Man_t * Dar_ManChoiceNew( Aig_Man_t * pAig, Dch_Pars_t * pPars );
351  Dch_Pars_t Pars, * pPars = &Pars;
352  Aig_Man_t * pMan, * pManNew;
353  Gia_Man_t * pGia;
354  if ( 0 )
355  {
356  pGia = Cec_ManChoiceComputationVec( pAig, 3, pParsChc );
357  }
358  else
359  {
360  pMan = Gia_ManToAig( pAig, 0 );
361  Dch_ManSetDefaultParams( pPars );
362  pPars->fUseGia = 1;
363  pPars->nBTLimit = pParsChc->nBTLimit;
364  pPars->fUseCSat = pParsChc->fUseCSat;
365  pPars->fVerbose = pParsChc->fVerbose;
366  pManNew = Dar_ManChoiceNew( pMan, pPars );
367  pGia = Gia_ManFromAig( pManNew );
368  Aig_ManStop( pManNew );
369 // Aig_ManStop( pMan );
370  }
371  return pGia;
372 }
int fUseCSat
Definition: cec.h:166
Aig_Man_t * Dar_ManChoiceNew(Aig_Man_t *pAig, Dch_Pars_t *pPars)
Definition: darScript.c:849
void Dch_ManSetDefaultParams(Dch_Pars_t *p)
DECLARATIONS ///.
Definition: dchCore.c:45
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
typedefABC_NAMESPACE_HEADER_START struct Dch_Pars_t_ Dch_Pars_t
INCLUDES ///.
Definition: dch.h:43
Gia_Man_t * Gia_ManFromAig(Aig_Man_t *p)
INCLUDES ///.
Definition: giaAig.c:73
int nBTLimit
Definition: cec.h:164
Aig_Man_t * Gia_ManToAig(Gia_Man_t *p, int fChoices)
Definition: giaAig.c:277
Definition: gia.h:95
int fVerbose
Definition: cec.h:168
Gia_Man_t * Cec_ManChoiceComputationVec(Gia_Man_t *pGia, int nGias, Cec_ParChc_t *pPars)
Definition: cecChoice.c:313
int Cec_ManChoiceComputation_int ( Gia_Man_t pAig,
Cec_ParChc_t pPars 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 201 of file cecChoice.c.

202 {
203  int nItersMax = 1000;
204  Vec_Str_t * vStatus;
205  Vec_Int_t * vOutputs;
206  Vec_Int_t * vCexStore;
207  Cec_ParSim_t ParsSim, * pParsSim = &ParsSim;
208  Cec_ParSat_t ParsSat, * pParsSat = &ParsSat;
209  Cec_ManSim_t * pSim;
210  Gia_Man_t * pSrm;
211  int r, RetValue;
212  abctime clkSat = 0, clkSim = 0, clkSrm = 0, clkTotal = Abc_Clock();
213  abctime clk2, clk = Abc_Clock();
214  ABC_FREE( pAig->pReprs );
215  ABC_FREE( pAig->pNexts );
216  Gia_ManRandom( 1 );
217  // prepare simulation manager
218  Cec_ManSimSetDefaultParams( pParsSim );
219  pParsSim->nWords = pPars->nWords;
220  pParsSim->nFrames = pPars->nRounds;
221  pParsSim->fVerbose = pPars->fVerbose;
222  pParsSim->fLatchCorr = 0;
223  pParsSim->fSeqSimulate = 0;
224  // create equivalence classes of registers
225  pSim = Cec_ManSimStart( pAig, pParsSim );
226  Cec_ManSimClassesPrepare( pSim, -1 );
227  Cec_ManSimClassesRefine( pSim );
228  // prepare SAT solving
229  Cec_ManSatSetDefaultParams( pParsSat );
230  pParsSat->nBTLimit = pPars->nBTLimit;
231  pParsSat->fVerbose = pPars->fVerbose;
232  if ( pPars->fVerbose )
233  {
234  Abc_Print( 1, "Obj = %7d. And = %7d. Conf = %5d. Ring = %d. CSat = %d.\n",
235  Gia_ManObjNum(pAig), Gia_ManAndNum(pAig), pPars->nBTLimit, pPars->fUseRings, pPars->fUseCSat );
236  Cec_ManRefinedClassPrintStats( pAig, NULL, 0, Abc_Clock() - clk );
237  }
238  // perform refinement of equivalence classes
239  for ( r = 0; r < nItersMax; r++ )
240  {
241  clk = Abc_Clock();
242  // perform speculative reduction
243  clk2 = Abc_Clock();
244  pSrm = Cec_ManCombSpecReduce( pAig, &vOutputs, pPars->fUseRings );
245  assert( Gia_ManRegNum(pSrm) == 0 && Gia_ManCiNum(pSrm) == Gia_ManCiNum(pAig) );
246  clkSrm += Abc_Clock() - clk2;
247  if ( Gia_ManCoNum(pSrm) == 0 )
248  {
249  if ( pPars->fVerbose )
250  Cec_ManRefinedClassPrintStats( pAig, NULL, r+1, Abc_Clock() - clk );
251  Vec_IntFree( vOutputs );
252  Gia_ManStop( pSrm );
253  break;
254  }
255 //Gia_DumpAiger( pSrm, "choicesrm", r, 2 );
256  // found counter-examples to speculation
257  clk2 = Abc_Clock();
258  if ( pPars->fUseCSat )
259  vCexStore = Cbs_ManSolveMiterNc( pSrm, pPars->nBTLimit, &vStatus, 0 );
260  else
261  vCexStore = Cec_ManSatSolveMiter( pSrm, pParsSat, &vStatus );
262  Gia_ManStop( pSrm );
263  clkSat += Abc_Clock() - clk2;
264  if ( Vec_IntSize(vCexStore) == 0 )
265  {
266  if ( pPars->fVerbose )
267  Cec_ManRefinedClassPrintStats( pAig, vStatus, r+1, Abc_Clock() - clk );
268  Vec_IntFree( vCexStore );
269  Vec_StrFree( vStatus );
270  Vec_IntFree( vOutputs );
271  break;
272  }
273  // refine classes with these counter-examples
274  clk2 = Abc_Clock();
275  RetValue = Cec_ManResimulateCounterExamplesComb( pSim, vCexStore );
276  Vec_IntFree( vCexStore );
277  clkSim += Abc_Clock() - clk2;
278  Gia_ManCheckRefinements( pAig, vStatus, vOutputs, pSim, pPars->fUseRings );
279  if ( pPars->fVerbose )
280  Cec_ManRefinedClassPrintStats( pAig, vStatus, r+1, Abc_Clock() - clk );
281  Vec_StrFree( vStatus );
282  Vec_IntFree( vOutputs );
283 //Gia_ManEquivPrintClasses( pAig, 1, 0 );
284  }
285  // check the overflow
286  if ( r == nItersMax )
287  Abc_Print( 1, "The refinement was not finished. The result may be incorrect.\n" );
288  Cec_ManSimStop( pSim );
289  clkTotal = Abc_Clock() - clkTotal;
290  // report the results
291  if ( pPars->fVerbose )
292  {
293  Abc_PrintTimeP( 1, "Srm ", clkSrm, clkTotal );
294  Abc_PrintTimeP( 1, "Sat ", clkSat, clkTotal );
295  Abc_PrintTimeP( 1, "Sim ", clkSim, clkTotal );
296  Abc_PrintTimeP( 1, "Other", clkTotal-clkSat-clkSrm-clkSim, clkTotal );
297  Abc_PrintTime( 1, "TOTAL", clkTotal );
298  }
299  return 0;
300 }
int fVerbose
Definition: cec.h:73
int fUseCSat
Definition: cec.h:166
int Cec_ManSimClassesPrepare(Cec_ManSim_t *p, int LevelMax)
Definition: cecClass.c:851
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
int fLatchCorr
Definition: cec.h:70
int * pNexts
Definition: gia.h:122
int fSeqSimulate
Definition: cec.h:69
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
Vec_Int_t * Cec_ManSatSolveMiter(Gia_Man_t *pAig, Cec_ParSat_t *pPars, Vec_Str_t **pvStatus)
Definition: cecSolve.c:1026
void Cec_ManRefinedClassPrintStats(Gia_Man_t *p, Vec_Str_t *vStatus, int iIter, abctime Time)
MACRO DEFINITIONS ///.
Definition: cecCorr.c:725
void Cec_ManSimStop(Cec_ManSim_t *p)
Definition: cecMan.c:232
int fUseRings
Definition: cec.h:165
static abctime Abc_Clock()
Definition: abc_global.h:279
static void Abc_PrintTimeP(int level, const char *pStr, abctime time, abctime Time)
Definition: abc_global.h:372
Cec_ManSim_t * Cec_ManSimStart(Gia_Man_t *pAig, Cec_ParSim_t *pPars)
Definition: cecMan.c:198
Vec_Int_t * Cbs_ManSolveMiterNc(Gia_Man_t *pGia, int nConfs, Vec_Str_t **pvStatus, int fVerbose)
Definition: giaCSat.c:998
unsigned Gia_ManRandom(int fReset)
FUNCTION DEFINITIONS ///.
Definition: giaUtil.c:49
int Gia_ManCheckRefinements(Gia_Man_t *p, Vec_Str_t *vStatus, Vec_Int_t *vOutputs, Cec_ManSim_t *pSim, int fRings)
Definition: cecCorr.c:612
void Cec_ManSimSetDefaultParams(Cec_ParSim_t *p)
Definition: cecCore.c:70
int nRounds
Definition: cec.h:163
int nWords
Definition: cec.h:162
static void Abc_PrintTime(int level, const char *pStr, abctime time)
Definition: abc_global.h:367
static int Gia_ManAndNum(Gia_Man_t *p)
Definition: gia.h:389
int Cec_ManResimulateCounterExamplesComb(Cec_ManSim_t *pSim, Vec_Int_t *vCexStore)
Definition: cecCorr.c:583
int nBTLimit
Definition: cec.h:164
Gia_Man_t * Cec_ManCombSpecReduce(Gia_Man_t *p, Vec_Int_t **pvOutputs, int fRings)
Definition: cecChoice.c:96
static void Vec_StrFree(Vec_Str_t *p)
Definition: bblif.c:616
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static int Gia_ManCiNum(Gia_Man_t *p)
Definition: gia.h:383
int Cec_ManSimClassesRefine(Cec_ManSim_t *p)
Definition: cecClass.c:908
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
int nFrames
Definition: cec.h:62
#define ABC_FREE(obj)
Definition: abc_global.h:232
Definition: gia.h:95
typedefABC_NAMESPACE_HEADER_START struct Cec_ParSat_t_ Cec_ParSat_t
INCLUDES ///.
Definition: cec.h:43
Gia_Rpr_t * pReprs
Definition: gia.h:121
#define assert(ex)
Definition: util_old.h:213
int nWords
Definition: cec.h:61
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
ABC_INT64_T abctime
Definition: abc_global.h:278
void Cec_ManSatSetDefaultParams(Cec_ParSat_t *p)
DECLARATIONS ///.
Definition: cecCore.c:45
int fVerbose
Definition: cec.h:168
static int Gia_ManObjNum(Gia_Man_t *p)
Definition: gia.h:388
static int Gia_ManCoNum(Gia_Man_t *p)
Definition: gia.h:384
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
Gia_Man_t* Cec_ManChoiceComputationVec ( Gia_Man_t pGia,
int  nGias,
Cec_ParChc_t pPars 
)

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

Synopsis [Computes choices for the vector of AIGs.]

Description []

SideEffects []

SeeAlso []

Definition at line 313 of file cecChoice.c.

314 {
315  Gia_Man_t * pNew;
316  int RetValue;
317  // compute equivalences of the miter
318 // pMiter = Gia_ManChoiceMiter( vGias );
319 // Gia_ManSetRegNum( pMiter, 0 );
320  RetValue = Cec_ManChoiceComputation_int( pGia, pPars );
321  // derive AIG with choices
322  pNew = Gia_ManEquivToChoices( pGia, nGias );
323 // Gia_ManHasChoices_very_old( pNew );
324 // Gia_ManStop( pMiter );
325  // report the results
326  if ( pPars->fVerbose )
327  {
328 // Abc_Print( 1, "NBeg = %d. NEnd = %d. (Gain = %6.2f %%). RBeg = %d. REnd = %d. (Gain = %6.2f %%).\n",
329 // Gia_ManAndNum(pAig), Gia_ManAndNum(pNew),
330 // 100.0*(Gia_ManAndNum(pAig)-Gia_ManAndNum(pNew))/(Gia_ManAndNum(pAig)?Gia_ManAndNum(pAig):1),
331 // Gia_ManRegNum(pAig), Gia_ManRegNum(pNew),
332 // 100.0*(Gia_ManRegNum(pAig)-Gia_ManRegNum(pNew))/(Gia_ManRegNum(pAig)?Gia_ManRegNum(pAig):1) );
333  }
334  return pNew;
335 }
Gia_Man_t * Gia_ManEquivToChoices(Gia_Man_t *p, int nSnapshots)
Definition: giaEquiv.c:1629
int Cec_ManChoiceComputation_int(Gia_Man_t *pAig, Cec_ParChc_t *pPars)
Definition: cecChoice.c:201
Definition: gia.h:95
int fVerbose
Definition: cec.h:168
static int Cec_ManCombSpecReal ( Gia_Man_t pNew,
Gia_Man_t p,
Gia_Obj_t pObj 
)
inlinestatic

FUNCTION DEFINITIONS ///.

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

Synopsis [Computes the real value of the literal w/o spec reduction.]

Description []

SideEffects []

SeeAlso []

Definition at line 52 of file cecChoice.c.

53 {
54  assert( Gia_ObjIsAnd(pObj) );
55  Cec_ManCombSpecReduce_rec( pNew, p, Gia_ObjFanin0(pObj) );
56  Cec_ManCombSpecReduce_rec( pNew, p, Gia_ObjFanin1(pObj) );
57  return Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
58 }
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
Definition: gia.h:454
static int Gia_ObjFanin1Copy(Gia_Obj_t *pObj)
Definition: gia.h:482
static int Gia_ObjFanin0Copy(Gia_Obj_t *pObj)
Definition: gia.h:481
static ABC_NAMESPACE_IMPL_START void Cec_ManCombSpecReduce_rec(Gia_Man_t *pNew, Gia_Man_t *p, Gia_Obj_t *pObj)
DECLARATIONS ///.
Definition: cecChoice.c:71
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
Definition: gia.h:422
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
Definition: gia.h:455
#define assert(ex)
Definition: util_old.h:213
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
Definition: giaHash.c:572
Gia_Man_t* Cec_ManCombSpecReduce ( Gia_Man_t p,
Vec_Int_t **  pvOutputs,
int  fRings 
)

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

Synopsis [Derives SRM for signal correspondence.]

Description []

SideEffects []

SeeAlso []

Definition at line 96 of file cecChoice.c.

97 {
98  Gia_Man_t * pNew, * pTemp;
99  Gia_Obj_t * pObj, * pRepr;
100  Vec_Int_t * vXorLits;
101  int i, iPrev, iObj, iPrevNew, iObjNew;
102  assert( p->pReprs != NULL );
103  Gia_ManSetPhase( p );
104  Gia_ManFillValue( p );
105  pNew = Gia_ManStart( Gia_ManObjNum(p) );
106  pNew->pName = Abc_UtilStrsav( p->pName );
107  pNew->pSpec = Abc_UtilStrsav( p->pSpec );
108  Gia_ManHashAlloc( pNew );
109  Gia_ManConst0(p)->Value = 0;
110  Gia_ManForEachCi( p, pObj, i )
111  pObj->Value = Gia_ManAppendCi(pNew);
112  *pvOutputs = Vec_IntAlloc( 1000 );
113  vXorLits = Vec_IntAlloc( 1000 );
114  if ( fRings )
115  {
116  Gia_ManForEachObj1( p, pObj, i )
117  {
118  if ( Gia_ObjIsConst( p, i ) )
119  {
120  iObjNew = Cec_ManCombSpecReal( pNew, p, pObj );
121  iObjNew = Abc_LitNotCond( iObjNew, Gia_ObjPhase(pObj) );
122  if ( iObjNew != 0 )
123  {
124  Vec_IntPush( *pvOutputs, 0 );
125  Vec_IntPush( *pvOutputs, i );
126  Vec_IntPush( vXorLits, iObjNew );
127  }
128  }
129  else if ( Gia_ObjIsHead( p, i ) )
130  {
131  iPrev = i;
132  Gia_ClassForEachObj1( p, i, iObj )
133  {
134  iPrevNew = Cec_ManCombSpecReal( pNew, p, Gia_ManObj(p, iPrev) );
135  iObjNew = Cec_ManCombSpecReal( pNew, p, Gia_ManObj(p, iObj) );
136  iPrevNew = Abc_LitNotCond( iPrevNew, Gia_ObjPhase(pObj) ^ Gia_ObjPhase(Gia_ManObj(p, iPrev)) );
137  iObjNew = Abc_LitNotCond( iObjNew, Gia_ObjPhase(pObj) ^ Gia_ObjPhase(Gia_ManObj(p, iObj)) );
138  if ( iPrevNew != iObjNew && iPrevNew != 0 && iObjNew != 1 )
139  {
140  Vec_IntPush( *pvOutputs, iPrev );
141  Vec_IntPush( *pvOutputs, iObj );
142  Vec_IntPush( vXorLits, Gia_ManHashAnd(pNew, iPrevNew, Abc_LitNot(iObjNew)) );
143  }
144  iPrev = iObj;
145  }
146  iObj = i;
147  iPrevNew = Cec_ManCombSpecReal( pNew, p, Gia_ManObj(p, iPrev) );
148  iObjNew = Cec_ManCombSpecReal( pNew, p, Gia_ManObj(p, iObj) );
149  iPrevNew = Abc_LitNotCond( iPrevNew, Gia_ObjPhase(pObj) ^ Gia_ObjPhase(Gia_ManObj(p, iPrev)) );
150  iObjNew = Abc_LitNotCond( iObjNew, Gia_ObjPhase(pObj) ^ Gia_ObjPhase(Gia_ManObj(p, iObj)) );
151  if ( iPrevNew != iObjNew && iPrevNew != 0 && iObjNew != 1 )
152  {
153  Vec_IntPush( *pvOutputs, iPrev );
154  Vec_IntPush( *pvOutputs, iObj );
155  Vec_IntPush( vXorLits, Gia_ManHashAnd(pNew, iPrevNew, Abc_LitNot(iObjNew)) );
156  }
157  }
158  }
159  }
160  else
161  {
162  Gia_ManForEachObj1( p, pObj, i )
163  {
164  pRepr = Gia_ObjReprObj( p, Gia_ObjId(p,pObj) );
165  if ( pRepr == NULL )
166  continue;
167  iPrevNew = Gia_ObjIsConst(p, i)? 0 : Cec_ManCombSpecReal( pNew, p, pRepr );
168  iObjNew = Cec_ManCombSpecReal( pNew, p, pObj );
169  iObjNew = Abc_LitNotCond( iObjNew, Gia_ObjPhase(pRepr) ^ Gia_ObjPhase(pObj) );
170  if ( iPrevNew != iObjNew )
171  {
172  Vec_IntPush( *pvOutputs, Gia_ObjId(p, pRepr) );
173  Vec_IntPush( *pvOutputs, Gia_ObjId(p, pObj) );
174  Vec_IntPush( vXorLits, Gia_ManHashXor(pNew, iPrevNew, iObjNew) );
175  }
176  }
177  }
178  Vec_IntForEachEntry( vXorLits, iObjNew, i )
179  Gia_ManAppendCo( pNew, iObjNew );
180  Vec_IntFree( vXorLits );
181  Gia_ManHashStop( pNew );
182 //Abc_Print( 1, "Before sweeping = %d\n", Gia_ManAndNum(pNew) );
183  pNew = Gia_ManCleanup( pTemp = pNew );
184 //Abc_Print( 1, "After sweeping = %d\n", Gia_ManAndNum(pNew) );
185  Gia_ManStop( pTemp );
186  return pNew;
187 }
static int Gia_ObjPhase(Gia_Obj_t *pObj)
Definition: gia.h:415
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
static int Gia_ManAppendCo(Gia_Man_t *p, int iLit0)
Definition: gia.h:703
int Gia_ManHashXor(Gia_Man_t *p, int iLit0, int iLit1)
Definition: giaHash.c:658
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Gia_ManAppendCi(Gia_Man_t *p)
Definition: gia.h:583
static int Gia_ObjIsHead(Gia_Man_t *p, int Id)
Definition: gia.h:916
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
Definition: gia.h:402
static int Abc_LitNotCond(int Lit, int c)
Definition: abc_global.h:267
Definition: gia.h:75
#define Gia_ManForEachCi(p, pObj, i)
Definition: gia.h:1016
char * pName
Definition: gia.h:97
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
static int Cec_ManCombSpecReal(Gia_Man_t *pNew, Gia_Man_t *p, Gia_Obj_t *pObj)
FUNCTION DEFINITIONS ///.
Definition: cecChoice.c:52
static int Gia_ObjIsConst(Gia_Man_t *p, int Id)
Definition: gia.h:915
if(last==0)
Definition: sparse_int.h:34
char * pSpec
Definition: gia.h:98
Gia_Man_t * Gia_ManStart(int nObjsMax)
DECLARATIONS ///.
Definition: giaMan.c:52
#define Gia_ClassForEachObj1(p, i, iObj)
Definition: gia.h:933
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:410
void Gia_ManFillValue(Gia_Man_t *p)
Definition: giaUtil.c:328
static Gia_Obj_t * Gia_ObjReprObj(Gia_Man_t *p, int Id)
Definition: gia.h:886
static int Abc_LitNot(int Lit)
Definition: abc_global.h:266
Definition: gia.h:95
static Gia_Obj_t * Gia_ManConst0(Gia_Man_t *p)
Definition: gia.h:400
Gia_Rpr_t * pReprs
Definition: gia.h:121
#define assert(ex)
Definition: util_old.h:213
void Gia_ManSetPhase(Gia_Man_t *p)
Definition: giaUtil.c:379
unsigned Value
Definition: gia.h:87
void Gia_ManHashAlloc(Gia_Man_t *p)
Definition: giaHash.c:99
#define Gia_ManForEachObj1(p, pObj, i)
Definition: gia.h:986
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
Definition: giaScl.c:84
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecInt.h:54
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
Definition: giaHash.c:572
static int Gia_ManObjNum(Gia_Man_t *p)
Definition: gia.h:388
void Gia_ManHashStop(Gia_Man_t *p)
Definition: giaHash.c:142
void Cec_ManCombSpecReduce_rec ( Gia_Man_t pNew,
Gia_Man_t p,
Gia_Obj_t pObj 
)
static

DECLARATIONS ///.

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

FileName [cecChoice.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Combinational equivalence checking.]

Synopsis [Computation of structural choices.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

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

Synopsis [Recursively performs speculative reduction for the object.]

Description []

SideEffects []

SeeAlso []

Definition at line 71 of file cecChoice.c.

72 {
73  Gia_Obj_t * pRepr;
74  if ( ~pObj->Value )
75  return;
76  if ( (pRepr = Gia_ObjReprObj(p, Gia_ObjId(p, pObj))) )
77  {
78  Cec_ManCombSpecReduce_rec( pNew, p, pRepr );
79  pObj->Value = Abc_LitNotCond( pRepr->Value, Gia_ObjPhase(pRepr) ^ Gia_ObjPhase(pObj) );
80  return;
81  }
82  pObj->Value = Cec_ManCombSpecReal( pNew, p, pObj );
83 }
static int Gia_ObjPhase(Gia_Obj_t *pObj)
Definition: gia.h:415
static int Abc_LitNotCond(int Lit, int c)
Definition: abc_global.h:267
Definition: gia.h:75
static int Cec_ManCombSpecReal(Gia_Man_t *pNew, Gia_Man_t *p, Gia_Obj_t *pObj)
FUNCTION DEFINITIONS ///.
Definition: cecChoice.c:52
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:410
static Gia_Obj_t * Gia_ObjReprObj(Gia_Man_t *p, int Id)
Definition: gia.h:886
static ABC_NAMESPACE_IMPL_START void Cec_ManCombSpecReduce_rec(Gia_Man_t *pNew, Gia_Man_t *p, Gia_Obj_t *pObj)
DECLARATIONS ///.
Definition: cecChoice.c:71
unsigned Value
Definition: gia.h:87
int Cec_ManResimulateCounterExamplesComb ( Cec_ManSim_t pSim,
Vec_Int_t vCexStore 
)

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

Synopsis [Resimulates counter-examples derived by the SAT solver.]

Description []

SideEffects []

SeeAlso []

Definition at line 583 of file cecCorr.c.

584 {
585  Vec_Ptr_t * vSimInfo;
586  int RetValue = 0, iStart = 0;
587  Gia_ManCreateValueRefs( pSim->pAig );
588  pSim->pPars->nFrames = 1;
589  vSimInfo = Vec_PtrAllocSimInfo( Gia_ManCiNum(pSim->pAig), pSim->pPars->nWords );
590  while ( iStart < Vec_IntSize(vCexStore) )
591  {
592  Cec_ManStartSimInfo( vSimInfo, 0 );
593  iStart = Cec_ManLoadCounterExamples( vSimInfo, vCexStore, iStart );
594  RetValue |= Cec_ManSeqResimulate( pSim, vSimInfo );
595  }
596  assert( iStart == Vec_IntSize(vCexStore) );
597  Vec_PtrFree( vSimInfo );
598  return RetValue;
599 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
void Cec_ManStartSimInfo(Vec_Ptr_t *vInfo, int nFlops)
Definition: cecCorr.c:292
Gia_Man_t * pAig
Definition: cecInt.h:115
void Gia_ManCreateValueRefs(Gia_Man_t *p)
Definition: giaUtil.c:687
int Cec_ManLoadCounterExamples(Vec_Ptr_t *vInfo, Vec_Int_t *vCexStore, int iStart)
Definition: cecCorr.c:458
static int Gia_ManCiNum(Gia_Man_t *p)
Definition: gia.h:383
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
int nFrames
Definition: cec.h:62
Cec_ParSim_t * pPars
Definition: cecInt.h:116
#define assert(ex)
Definition: util_old.h:213
int nWords
Definition: cec.h:61
int Cec_ManSeqResimulate(Cec_ManSim_t *p, Vec_Ptr_t *vInfo)
Definition: cecSeq.c:137
static Vec_Ptr_t * Vec_PtrAllocSimInfo(int nEntries, int nWords)
Definition: vecPtr.h:929
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
int Gia_ManCheckRefinements ( Gia_Man_t p,
Vec_Str_t vStatus,
Vec_Int_t vOutputs,
Cec_ManSim_t pSim,
int  fRings 
)

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

Synopsis [Updates equivalence classes by marking those that timed out.]

Description [Returns 1 if all ndoes are proved.]

SideEffects []

SeeAlso []

Definition at line 612 of file cecCorr.c.

613 {
614  int i, status, iRepr, iObj;
615  int Counter = 0;
616  assert( 2 * Vec_StrSize(vStatus) == Vec_IntSize(vOutputs) );
617  Vec_StrForEachEntry( vStatus, status, i )
618  {
619  iRepr = Vec_IntEntry( vOutputs, 2*i );
620  iObj = Vec_IntEntry( vOutputs, 2*i+1 );
621  if ( status == 1 )
622  continue;
623  if ( status == 0 )
624  {
625  if ( Gia_ObjHasSameRepr(p, iRepr, iObj) )
626  Counter++;
627 // if ( Gia_ObjHasSameRepr(p, iRepr, iObj) )
628 // Abc_Print( 1, "Gia_ManCheckRefinements(): Disproved equivalence (%d,%d) is not refined!\n", iRepr, iObj );
629 // if ( Gia_ObjHasSameRepr(p, iRepr, iObj) )
630 // Cec_ManSimClassRemoveOne( pSim, iObj );
631  continue;
632  }
633  if ( status == -1 )
634  {
635 // if ( !Gia_ObjFailed( p, iObj ) )
636 // Abc_Print( 1, "Gia_ManCheckRefinements(): Failed equivalence is not marked as failed!\n" );
637 // Gia_ObjSetFailed( p, iRepr );
638 // Gia_ObjSetFailed( p, iObj );
639 // if ( fRings )
640 // Cec_ManSimClassRemoveOne( pSim, iRepr );
641  Cec_ManSimClassRemoveOne( pSim, iObj );
642  continue;
643  }
644  }
645 // if ( Counter )
646 // Abc_Print( 1, "Gia_ManCheckRefinements(): Could not refine %d nodes.\n", Counter );
647  return 1;
648 }
#define Vec_StrForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecStr.h:54
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
static int Counter
static int Vec_StrSize(Vec_Str_t *p)
Definition: bblif.c:600
static int Gia_ObjHasSameRepr(Gia_Man_t *p, int i, int k)
Definition: gia.h:920
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
#define assert(ex)
Definition: util_old.h:213
int Cec_ManSimClassRemoveOne(Cec_ManSim_t *p, int i)
Definition: cecClass.c:308