55 p->nBTLimitGlobal = 5000000;
58 p->nResimDelta = 1000;
74 p->nRecycleCalls = 50;
76 p->nSatVarMax2 = 5000;
77 p->nRecycleCalls2 = 250;
115 pAig1 =
Aig_ManScl( pAux = pAig1, 1, 1, 0, -1, -1, 0, 0 );
118 pAig2 =
Aig_ManScl( pAux = pAig2, 1, 1, 0, -1, -1, 0, 0 );
121 p->nNodesBegC = Aig_ManNodeNum(pAig1);
122 p->nNodesEndC = Aig_ManNodeNum(pAig2);
123 p->nRegsBegC = Aig_ManRegNum(pAig1);
124 p->nRegsEndC = Aig_ManRegNum(pAig2);
143 if ( pObj == Aig_ManConst1(
p) )
145 else if ( pObj == Aig_ManConst0(
p) )
168 if ( i < Saig_ManPoNum(pAig)-Saig_ManConstrNum(pAig) )
174 Abc_Print( 1,
"\n" );
193 int i,
nTotal = 0, nRemoved = 0;
195 pArray = (
Aig_Obj_t **)Vec_PtrArray(pAig->vCos);
196 pArray += Saig_ManPoNum(pAig) - Saig_ManConstrNum(pAig);
201 if ( !Aig_ObjIsCi(pObj) && !Aig_ObjIsNode(pObj) )
203 if ( pAig->pReprs[i] != NULL )
205 if ( !Aig_ObjIsTravIdCurrent(pAig, pObj) )
207 if ( pAig->pReprs[i] )
209 if (
p->pPars->fConstrs && !
p->pPars->fMergeFull )
211 pAig->pReprs[i] = NULL;
217 p->nConesTotal = Aig_ManCiNum(pAig) + Aig_ManNodeNum(pAig);
218 p->nConesConstr = Vec_PtrSize(vCones);
220 p->nEquivsConstr = nRemoved;
221 Vec_PtrFree( vCones );
237 int nSatProof, nSatCallsSat, nRecycles, nSatFailsReal, nUniques;
239 int RetValue, nIter = -1, nPrev[4] = {0};
240 abctime clk, clkTotal = Abc_Clock();
243 p->nNodesBeg = Aig_ManNodeNum(
p->pAig);
244 p->nRegsBeg = Aig_ManRegNum(
p->pAig);
246 if (
p->pPars->fVerbose )
248 Abc_Print( 1,
"Before BMC: " );
251 if ( !
p->pPars->fLatchCorr ||
p->pPars->nFramesK > 1 )
254 if (
p->pPars->fConstrs )
262 if (
p->pPars->fVerbose )
264 Abc_Print( 1,
"After BMC: " );
279 if (
p->pPars->pFunc )
281 ((int (*)(
void *))
p->pPars->pFunc)(
p->pPars->pData );
282 ((int (*)(
void *))
p->pPars->pFunc)(
p->pPars->pData );
284 if (
p->pPars->nStepsMax == 0 )
286 Abc_Print( 1,
"Stopped signal correspondence after BMC.\n" );
290 nSatProof = nSatCallsSat = nRecycles = nSatFailsReal = nUniques = 0;
291 for ( nIter = 0; ; nIter++ )
293 if (
p->pPars->nStepsMax == nIter )
295 Abc_Print( 1,
"Stopped signal correspondence after %d refiment iterations.\n", nIter );
298 if (
p->pPars->nItersStop >= 0 &&
p->pPars->nItersStop == nIter )
303 Abc_Print( 1,
"Iterative refinement is stopped before iteration %d.\n", nIter );
304 Abc_Print( 1,
"The network is reduced using candidate equivalences.\n" );
305 Abc_Print( 1,
"Speculatively reduced miter is saved in file \"%s\".\n",
"srm.blif" );
306 Abc_Print( 1,
"If the miter is SAT, the reduced result is incorrect.\n" );
312 if (
p->pPars->fLatchCorrOpt )
315 if (
p->pPars->fVerbose )
317 Abc_Print( 1,
"%3d : C =%7d. Cl =%7d. Pr =%6d. Cex =%5d. R =%4d. F =%4d. ",
319 p->nSatProof-nSatProof,
p->nSatCallsSat-nSatCallsSat,
320 p->nRecycles-nRecycles,
p->nSatFailsReal-nSatFailsReal );
321 ABC_PRT(
"T", Abc_Clock() - clk );
326 if (
p->pPars->fConstrs )
328 else if (
p->pPars->fDynamic )
333 p->pPars->nConflicts +=
p->pMSat->pSat->stats.conflicts;
334 if (
p->pPars->fVerbose )
336 Abc_Print( 1,
"%3d : C =%7d. Cl =%7d. LR =%6d. NR =%6d. ",
338 p->nConstrReduced, Aig_ManNodeNum(
p->pFrames) );
339 if (
p->pPars->fDynamic )
341 Abc_Print( 1,
"Cex =%5d. ",
p->nSatCallsSat-nSatCallsSat );
342 Abc_Print( 1,
"R =%4d. ",
p->nRecycles-nRecycles );
344 Abc_Print( 1,
"F =%5d. %s ",
p->nSatFailsReal-nSatFailsReal,
345 (Saig_ManPoNum(
p->pAig)==1 && Ssw_ObjIsConst1Cand(
p->pAig,Aig_ObjFanin0(Aig_ManCo(
p->pAig,0))))?
"+" :
"-" );
346 ABC_PRT(
"T", Abc_Clock() - clk );
351 if (
p->pPars->fStopWhenGone && Saig_ManPoNum(
p->pAig) == 1 && !Ssw_ObjIsConst1Cand(
p->pAig,Aig_ObjFanin0(Aig_ManCo(
p->pAig,0))) )
353 printf(
"Iterative refinement is stopped after iteration %d\n", nIter );
354 printf(
"because the property output is no longer a candidate constant.\n" );
356 p->nLitsEnd =
p->nLitsBeg;
357 p->nNodesEnd =
p->nNodesBeg;
358 p->nRegsEnd =
p->nRegsBeg;
369 nSatProof =
p->nSatProof;
370 nSatCallsSat =
p->nSatCallsSat;
371 nRecycles =
p->nRecycles;
372 nSatFailsReal =
p->nSatFailsReal;
373 nUniques =
p->nUniques;
375 p->nVarsMax = Abc_MaxInt(
p->nVarsMax,
p->pMSat->nSatVars );
376 p->nCallsMax = Abc_MaxInt(
p->nCallsMax,
p->pMSat->nSolverCalls );
382 if (
p->pPars->pFunc )
383 ((int (*)(
void *))
p->pPars->pFunc)(
p->pPars->pData );
384 if (
p->pPars->nLimitMax )
387 if ( nIter > 4 && nPrev[0] - nCur <= 4*p->pPars->nLimitMax )
389 printf(
"Iterative refinement is stopped after iteration %d\n", nIter );
390 printf(
"because the refinment is very slow.\n" );
392 p->nLitsEnd =
p->nLitsBeg;
393 p->nNodesEnd =
p->nNodesBeg;
394 p->nRegsEnd =
p->nRegsBeg;
408 p->pPars->nIters = nIter + 1;
409p->timeTotal = Abc_Clock() - clkTotal;
417 p->nNodesEnd = Aig_ManNodeNum(pAigNew);
418 p->nRegsEnd = Aig_ManRegNum(pAigNew);
441 assert( Aig_ManRegNum(pAig) > 0 );
458 if ( pPars->fLatchCorrOpt )
460 pPars->fLatchCorr = 1;
461 pPars->nFramesAddSim = 0;
462 if ( (pAig->vClockDoms && Vec_VecSize(pAig->vClockDoms) > 0) )
467 assert( pPars->nFramesK > 0 );
469 if ( (pPars->nPartSize > 0 && pPars->nPartSize < Aig_ManRegNum(pAig))
470 || (pAig->vClockDoms && Vec_VecSize(pAig->vClockDoms) > 0) )
474 if ( pPars->fScorrGia )
476 if ( pPars->fLatchCorrOpt )
492 if (
p->pPars->fConstrs )
500 Abc_Print( 1,
"Ssw_SignalCorrespondence(): The init state does not satisfy the constraints!\n" );
501 p->pPars->fVerbose = 0;
511 p->ppClasses =
Ssw_ClassesPrepare( pAig, pPars->nFramesK, pPars->fLatchCorr, pPars->fConstCorr, pPars->fOutputCorr, pPars->nMaxLevs, pPars->fVerbose );
513 if ( pPars->fLatchCorrOpt )
515 else if ( pPars->fDynamic )
516 p->pSml =
Ssw_SmlStart( pAig, 0,
p->nFrames +
p->pPars->nFramesAddSim, 1 );
518 p->pSml =
Ssw_SmlStart( pAig, 0, 1 +
p->pPars->nFramesAddSim, 1 );
522 if (
p->pPars->fLocalSim &&
p->pSml )
527 if ( pPars->fConstrs && pPars->fVerbose )
#define ABC_CALLOC(type, num)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
Aig_Man_t * Aig_ManDupRepr(Aig_Man_t *p, int fOrdered)
void Aig_ManCleanMarkB(Aig_Man_t *p)
int Aig_ManSeqCleanup(Aig_Man_t *p)
Aig_Man_t * Aig_ManDupSimple(Aig_Man_t *p)
DECLARATIONS ///.
#define Aig_ManForEachObj(p, pObj, i)
void Aig_ManStop(Aig_Man_t *p)
struct Aig_Obj_t_ Aig_Obj_t
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Vec_Ptr_t * Aig_ManDfsNodes(Aig_Man_t *p, Aig_Obj_t **ppNodes, int nNodes)
Aig_Man_t * Aig_ManDupOneOutput(Aig_Man_t *p, int iPoNum, int fAddRegs)
Aig_Man_t * Aig_ManScl(Aig_Man_t *pAig, int fLatchConst, int fLatchEqual, int fUseMvSweep, int nFramesSymb, int nFramesSatur, int fVerbose, int fVeryVerbose)
void Aig_ManSetPhase(Aig_Man_t *pAig)
unsigned Aig_ManRandom(int fReset)
void Aig_ManDumpBlif(Aig_Man_t *p, char *pFileName, Vec_Ptr_t *vPiNames, Vec_Ptr_t *vPoNames)
int nTotal
DECLARATIONS ///.
Aig_Man_t * Cec_LatchCorrespondence(Aig_Man_t *pAig, int nConfs, int fUseCSat)
Aig_Man_t * Cec_SignalCorrespondence(Aig_Man_t *pAig, int nConfs, int fUseCSat)
#define Saig_ManForEachPo(p, pObj, i)
Aig_Man_t * Ssw_SpeculativeReduction(Ssw_Man_t *p)
int Ssw_ClassesCand1Num(Ssw_Cla_t *p)
int Ssw_ClassesLitNum(Ssw_Cla_t *p)
Ssw_Cla_t * Ssw_ClassesPrepareSimple(Aig_Man_t *pAig, int fLatchCorr, int nMaxLevs)
int Ssw_ClassesClassNum(Ssw_Cla_t *p)
void Ssw_ClassesPrint(Ssw_Cla_t *p, int fVeryVerbose)
Ssw_Cla_t * Ssw_ClassesPrepare(Aig_Man_t *pAig, int nFramesK, int fLatchCorr, int fConstCorr, int fOutputCorr, int nMaxLevs, int fVerbose)
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_SatStop(Ssw_Sat_t *p)
ABC_NAMESPACE_IMPL_START Ssw_Sat_t * Ssw_SatStart(int fPolarFlip)
DECLARATIONS ///.
void Ssw_ManRefineByConstrSim(Ssw_Man_t *p)
int Ssw_ManSweepConstr(Ssw_Man_t *p)
int Ssw_ManSweepBmcConstr(Ssw_Man_t *p)
void Ssw_ReportOneOutput(Aig_Man_t *p, Aig_Obj_t *pObj)
void Ssw_ManUpdateEquivs(Ssw_Man_t *p, Aig_Man_t *pAig, int fVerbose)
ABC_NAMESPACE_IMPL_START void Ssw_ManSetDefaultParams(Ssw_Pars_t *p)
DECLARATIONS ///.
void Ssw_ReportOutputs(Aig_Man_t *pAig)
Aig_Man_t * Ssw_SignalCorrespondenceRefine(Ssw_Man_t *p)
void Ssw_ManSetDefaultParamsLcorr(Ssw_Pars_t *p)
void Ssw_ReportConeReductions(Ssw_Man_t *p, Aig_Man_t *pAigInit, Aig_Man_t *pAigStop)
Aig_Man_t * Ssw_LatchCorrespondence(Aig_Man_t *pAig, Ssw_Pars_t *pPars)
Aig_Man_t * Ssw_SignalCorrespondence(Aig_Man_t *pAig, Ssw_Pars_t *pPars)
int Ssw_ManSweepDyn(Ssw_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Ssw_Man_t_ Ssw_Man_t
INCLUDES ///.
Ssw_Sml_t * Ssw_SmlStart(Aig_Man_t *pAig, int nPref, int nFrames, int nWordsFrame)
int Ssw_ManSweepLatch(Ssw_Man_t *p)
void Ssw_ManStop(Ssw_Man_t *p)
int Ssw_SmlObjIsConstBit(void *p, Aig_Obj_t *pObj)
int Ssw_SmlObjsAreEqualBit(void *p, Aig_Obj_t *pObj0, Aig_Obj_t *pObj1)
int Ssw_ManSweepBmc(Ssw_Man_t *p)
void Ssw_ManCleanup(Ssw_Man_t *p)
Ssw_Man_t * Ssw_ManCreate(Aig_Man_t *pAig, Ssw_Pars_t *pPars)
DECLARATIONS ///.
unsigned Ssw_SmlObjHashWord(Ssw_Sml_t *p, Aig_Obj_t *pObj)
FUNCTION DEFINITIONS ///.
int Ssw_ManSweep(Ssw_Man_t *p)
int Ssw_SmlObjIsConstWord(Ssw_Sml_t *p, Aig_Obj_t *pObj)
int Ssw_ManSetConstrPhases(Aig_Man_t *p, int nFrames, Vec_Int_t **pvInits)
int Ssw_SmlObjsAreEqualWord(Ssw_Sml_t *p, Aig_Obj_t *pObj0, Aig_Obj_t *pObj1)
Aig_Man_t * Ssw_SignalCorrespondencePart(Aig_Man_t *pAig, Ssw_Pars_t *pPars)
typedefABC_NAMESPACE_HEADER_START struct Ssw_Pars_t_ Ssw_Pars_t
INCLUDES ///.
int Ssw_SmlNumFrames(Ssw_Sml_t *p)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.