55 p->nBTLimitGlobal = 5000000;
58 p->nResimDelta = 1000;
73 p->nRecycleCalls = 50;
75 p->nSatVarMax2 = 5000;
76 p->nRecycleCalls2 = 250;
114 pAig1 =
Aig_ManScl( pAux = pAig1, 1, 1, 0, -1, -1, 0, 0 );
117 pAig2 =
Aig_ManScl( pAux = pAig2, 1, 1, 0, -1, -1, 0, 0 );
192 int i,
nTotal = 0, nRemoved = 0;
202 if ( pAig->pReprs[i] != NULL )
206 if ( pAig->pReprs[i] )
208 if ( p->pPars->fConstrs && !p->pPars->fMergeFull )
210 pAig->pReprs[i] = NULL;
219 p->nEquivsConstr = nRemoved;
236 int nSatProof, nSatCallsSat, nRecycles, nSatFailsReal, nUniques;
238 int RetValue, nIter = -1;
245 if ( p->pPars->fVerbose )
250 if ( !p->pPars->fLatchCorr )
253 if ( p->pPars->fConstrs )
261 if ( p->pPars->fVerbose )
278 if ( p->pPars->pFunc )
280 ((int (*)(
void *))p->pPars->pFunc)( p->pPars->pData );
281 ((int (*)(
void *))p->pPars->pFunc)( p->pPars->pData );
283 if ( p->pPars->nStepsMax == 0 )
285 Abc_Print( 1,
"Stopped signal correspondence after BMC.\n" );
289 nSatProof = nSatCallsSat = nRecycles = nSatFailsReal = nUniques = 0;
290 for ( nIter = 0; ; nIter++ )
292 if ( p->pPars->nStepsMax == nIter )
294 Abc_Print( 1,
"Stopped signal correspondence after %d refiment iterations.\n", nIter );
297 if ( p->pPars->nItersStop >= 0 && p->pPars->nItersStop == nIter )
302 Abc_Print( 1,
"Iterative refinement is stopped before iteration %d.\n", nIter );
303 Abc_Print( 1,
"The network is reduced using candidate equivalences.\n" );
304 Abc_Print( 1,
"Speculatively reduced miter is saved in file \"%s\".\n",
"srm.blif" );
305 Abc_Print( 1,
"If the miter is SAT, the reduced result is incorrect.\n" );
311 if ( p->pPars->fLatchCorrOpt )
314 if ( p->pPars->fVerbose )
316 Abc_Print( 1,
"%3d : C =%7d. Cl =%7d. Pr =%6d. Cex =%5d. R =%4d. F =%4d. ",
318 p->nSatProof-nSatProof, p->nSatCallsSat-nSatCallsSat,
319 p->nRecycles-nRecycles, p->nSatFailsReal-nSatFailsReal );
325 if ( p->pPars->fConstrs )
327 else if ( p->pPars->fDynamic )
332 p->pPars->nConflicts += p->pMSat->pSat->stats.conflicts;
333 if ( p->pPars->fVerbose )
335 Abc_Print( 1,
"%3d : C =%7d. Cl =%7d. LR =%6d. NR =%6d. ",
338 if ( p->pPars->fDynamic )
340 Abc_Print( 1,
"Cex =%5d. ", p->nSatCallsSat-nSatCallsSat );
341 Abc_Print( 1,
"R =%4d. ", p->nRecycles-nRecycles );
343 Abc_Print( 1,
"F =%5d. %s ", p->nSatFailsReal-nSatFailsReal,
352 printf(
"Iterative refinement is stopped after iteration %d\n", nIter );
353 printf(
"because the property output is no longer a candidate constant.\n" );
355 p->nLitsEnd = p->nLitsBeg;
356 p->nNodesEnd = p->nNodesBeg;
357 p->nRegsEnd = p->nRegsBeg;
368 nSatProof = p->nSatProof;
369 nSatCallsSat = p->nSatCallsSat;
370 nRecycles = p->nRecycles;
371 nSatFailsReal = p->nSatFailsReal;
372 nUniques = p->nUniques;
374 p->nVarsMax =
Abc_MaxInt( p->nVarsMax, p->pMSat->nSatVars );
375 p->nCallsMax =
Abc_MaxInt( p->nCallsMax, p->pMSat->nSolverCalls );
381 if ( p->pPars->pFunc )
382 ((int (*)(
void *))p->pPars->pFunc)( p->pPars->pData );
386 p->pPars->nIters = nIter + 1;
434 if ( pPars->fLatchCorrOpt )
436 pPars->fLatchCorr = 1;
437 pPars->nFramesAddSim = 0;
438 if ( (pAig->vClockDoms &&
Vec_VecSize(pAig->vClockDoms) > 0) )
443 assert( pPars->nFramesK > 0 );
445 if ( (pPars->nPartSize > 0 && pPars->nPartSize <
Aig_ManRegNum(pAig))
446 || (pAig->vClockDoms &&
Vec_VecSize(pAig->vClockDoms) > 0) )
450 if ( pPars->fScorrGia )
452 if ( pPars->fLatchCorrOpt )
468 if ( p->pPars->fConstrs )
476 Abc_Print( 1,
"Ssw_SignalCorrespondence(): The init state does not satisfy the constraints!\n" );
477 p->pPars->fVerbose = 0;
487 p->ppClasses =
Ssw_ClassesPrepare( pAig, pPars->nFramesK, pPars->fLatchCorr, pPars->fConstCorr, pPars->fOutputCorr, pPars->nMaxLevs, pPars->fVerbose );
489 if ( pPars->fLatchCorrOpt )
491 else if ( pPars->fDynamic )
492 p->pSml =
Ssw_SmlStart( pAig, 0, p->nFrames + p->pPars->nFramesAddSim, 1 );
494 p->pSml =
Ssw_SmlStart( pAig, 0, 1 + p->pPars->nFramesAddSim, 1 );
498 if ( p->pPars->fLocalSim )
503 if ( pPars->fConstrs && pPars->fVerbose )
void Ssw_ManStop(Ssw_Man_t *p)
void Ssw_ManUpdateEquivs(Ssw_Man_t *p, Aig_Man_t *pAig, int fVerbose)
unsigned Ssw_SmlObjHashWord(Ssw_Sml_t *p, Aig_Obj_t *pObj)
FUNCTION DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
int Ssw_ClassesClassNum(Ssw_Cla_t *p)
void Ssw_ManCleanup(Ssw_Man_t *p)
ABC_NAMESPACE_IMPL_START Ssw_Sat_t * Ssw_SatStart(int fPolarFlip)
DECLARATIONS ///.
static int Saig_ManPoNum(Aig_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
static Aig_Obj_t * Aig_ObjChild0(Aig_Obj_t *pObj)
void Ssw_ReportOneOutput(Aig_Man_t *p, Aig_Obj_t *pObj)
void Aig_ManStop(Aig_Man_t *p)
Aig_Man_t * Cec_SignalCorrespondence(Aig_Man_t *pAig, int nConfs, int fUseCSat)
int Aig_ManSeqCleanup(Aig_Man_t *p)
int Ssw_ClassesCand1Num(Ssw_Cla_t *p)
static int Aig_ObjIsTravIdCurrent(Aig_Man_t *p, Aig_Obj_t *pObj)
int Ssw_ManSweepLatch(Ssw_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Ssw_Pars_t_ Ssw_Pars_t
INCLUDES ///.
Aig_Man_t * Aig_ManDupOrdered(Aig_Man_t *p)
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
void Aig_ManCleanMarkB(Aig_Man_t *p)
int Ssw_SmlNumFrames(Ssw_Sml_t *p)
static Aig_Obj_t * Aig_ManConst0(Aig_Man_t *p)
unsigned Aig_ManRandom(int fReset)
typedefABC_NAMESPACE_HEADER_START struct Ssw_Man_t_ Ssw_Man_t
INCLUDES ///.
static abctime Abc_Clock()
static int Abc_MaxInt(int a, int b)
int Ssw_ManSweepDyn(Ssw_Man_t *p)
static int Vec_PtrSize(Vec_Ptr_t *p)
int Ssw_SmlObjIsConstWord(Ssw_Sml_t *p, Aig_Obj_t *pObj)
static int Aig_ManNodeNum(Aig_Man_t *p)
int Ssw_ManSweepConstr(Ssw_Man_t *p)
void Aig_ManSetPhase(Aig_Man_t *pAig)
int Ssw_SmlObjsAreEqualBit(void *p, Aig_Obj_t *pObj0, Aig_Obj_t *pObj1)
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
static int Saig_ManConstrNum(Aig_Man_t *p)
int Ssw_ManSweepBmcConstr(Ssw_Man_t *p)
Ssw_Man_t * Ssw_ManCreate(Aig_Man_t *pAig, Ssw_Pars_t *pPars)
DECLARATIONS ///.
void Aig_ManReprStart(Aig_Man_t *p, int nIdMax)
DECLARATIONS ///.
int Ssw_ManSweep(Ssw_Man_t *p)
Ssw_Cla_t * Ssw_ClassesPrepare(Aig_Man_t *pAig, int nFramesK, int fLatchCorr, int fConstCorr, int fOutputCorr, int nMaxLevs, int fVerbose)
Aig_Man_t * Cec_LatchCorrespondence(Aig_Man_t *pAig, int nConfs, int fUseCSat)
int Ssw_SmlObjsAreEqualWord(Ssw_Sml_t *p, Aig_Obj_t *pObj0, Aig_Obj_t *pObj1)
Aig_Man_t * Aig_ManScl(Aig_Man_t *pAig, int fLatchConst, int fLatchEqual, int fUseMvSweep, int nFramesSymb, int nFramesSatur, int fVerbose, int fVeryVerbose)
Vec_Ptr_t * Aig_ManDfsNodes(Aig_Man_t *p, Aig_Obj_t **ppNodes, int nNodes)
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 *))
void Ssw_ClassesPrint(Ssw_Cla_t *p, int fVeryVerbose)
static int Aig_ManCiNum(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_END
Aig_Man_t * Ssw_LatchCorrespondence(Aig_Man_t *pAig, Ssw_Pars_t *pPars)
void Ssw_ReportConeReductions(Ssw_Man_t *p, Aig_Man_t *pAigInit, Aig_Man_t *pAigStop)
Aig_Man_t * Ssw_SignalCorrespondenceRefine(Ssw_Man_t *p)
int Ssw_ManSweepBmc(Ssw_Man_t *p)
void Aig_ManDumpBlif(Aig_Man_t *p, char *pFileName, Vec_Ptr_t *vPiNames, Vec_Ptr_t *vPoNames)
static void Abc_Print(int level, const char *format,...)
Aig_Man_t * Aig_ManDupRepr(Aig_Man_t *p, int fOrdered)
static int Aig_ManObjNumMax(Aig_Man_t *p)
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_START
static Aig_Obj_t * Aig_ManCo(Aig_Man_t *p, int i)
Ssw_Cla_t * Ssw_ClassesPrepareSimple(Aig_Man_t *pAig, int fLatchCorr, int nMaxLevs)
static int Aig_ManRegNum(Aig_Man_t *p)
int Ssw_SmlObjIsConstBit(void *p, Aig_Obj_t *pObj)
ABC_NAMESPACE_IMPL_START void Ssw_ManSetDefaultParams(Ssw_Pars_t *p)
DECLARATIONS ///.
#define Aig_ManForEachObj(p, pObj, i)
int Ssw_ManSetConstrPhases(Aig_Man_t *p, int nFrames, Vec_Int_t **pvInits)
void Ssw_ReportOutputs(Aig_Man_t *pAig)
Aig_Man_t * Aig_ManDupOneOutput(Aig_Man_t *p, int iPoNum, int fAddRegs)
static int Ssw_ObjIsConst1Cand(Aig_Man_t *pAig, Aig_Obj_t *pObj)
#define ABC_CALLOC(type, num)
static int Vec_VecSize(Vec_Vec_t *p)
#define Saig_ManForEachPo(p, pObj, i)
void Ssw_ManSetDefaultParamsLcorr(Ssw_Pars_t *p)
void Ssw_SatStop(Ssw_Sat_t *p)
void Ssw_ManRefineByConstrSim(Ssw_Man_t *p)
static int Aig_ObjIsCi(Aig_Obj_t *pObj)
Aig_Man_t * Ssw_SpeculativeReduction(Ssw_Man_t *p)
static void ** Vec_PtrArray(Vec_Ptr_t *p)
Aig_Man_t * Aig_ManDupSimple(Aig_Man_t *p)
DECLARATIONS ///.
Aig_Man_t * Ssw_SignalCorrespondence(Aig_Man_t *pAig, Ssw_Pars_t *pPars)
Ssw_Sml_t * Ssw_SmlStart(Aig_Man_t *pAig, int nPref, int nFrames, int nWordsFrame)
int Ssw_ClassesLitNum(Ssw_Cla_t *p)
Aig_Man_t * Ssw_SignalCorrespondencePart(Aig_Man_t *pAig, Ssw_Pars_t *pPars)
DECLARATIONS ///.
int nTotal
DECLARATIONS ///.
static void Vec_PtrFree(Vec_Ptr_t *p)