59 p->nConfMaxBmc = 5000;
60 p->nStableMax = 1000000;
90 printf(
"Saig_ManCexRemap(): The initial counter-example is invalid.\n" );
94 pCex =
Abc_CexAlloc( Aig_ManRegNum(
p), Saig_ManPiNum(
p), pCexAbs->iFrame+1 );
95 pCex->iFrame = pCexAbs->iFrame;
96 pCex->iPo = pCexAbs->iPo;
98 for ( f = 0; f <= pCexAbs->iFrame; f++ )
102 if ( i == Saig_ManPiNum(
p) )
104 if ( Abc_InfoHasBit( pCexAbs->pData, pCexAbs->nRegs + pCexAbs->nPis * f + i ) )
105 Abc_InfoSetBit( pCex->pData, pCex->nRegs + pCex->nPis * f + i );
111 printf(
"Saig_ManCexRemap(): Counter-example is invalid.\n" );
117 Abc_Print( 1,
"Counter-example verification is successful.\n" );
118 Abc_Print( 1,
"Output %d of miter \"%s\" was asserted in frame %d. \n", pCex->iPo,
p->pName, pCex->iFrame );
138 assert( pAbs->vCiNumsOrig != NULL );
141 if ( Vec_IntEntry(pAbs->vCiNumsOrig, i) >= Saig_ManPiNum(
p) )
158Aig_Man_t *
Saig_ManCexRefine(
Aig_Man_t *
p,
Aig_Man_t * pAbs,
Vec_Int_t * vFlops,
int nFrames,
int nConfMaxOne,
int fUseBdds,
int fUseDprove,
int fVerbose,
int * pnUseStart,
int * piRetValue,
int * pnFrames )
161 int i, Entry, RetValue;
163 if ( fUseDprove && Aig_ManRegNum(pAbs) > 0 )
174 pPars->nTimeOut = 10;
175 pPars->fVerbose = fVerbose;
176 if ( pPars->fVerbose )
177 printf(
"Running property directed reachability...\n" );
179 if ( pAbsOrpos->pSeqModel )
181 pAbs->pSeqModel = pAbsOrpos->pSeqModel;
182 pAbsOrpos->pSeqModel = NULL;
188 else if ( fUseBdds && (Aig_ManRegNum(pAbs) > 0 && Aig_ManRegNum(pAbs) <= 80) )
206 Saig_BmcPerform( pAbs, pnUseStart? *pnUseStart: 0, nFrames, 2000, 0, nConfMaxOne, 0, fVerbose, 0, pnFrames, 0, 0 );
208 if ( pAbs->pSeqModel == NULL )
211 *pnUseStart = pAbs->pSeqModel->iFrame;
214 if ( vFlopsNew == NULL )
216 if ( Vec_IntSize(vFlopsNew) == 0 )
218 printf(
"Discovered a true counter-example!\n" );
220 Vec_IntFree( vFlopsNew );
226 printf(
"Adding %d registers to the abstraction (total = %d).\n\n", Vec_IntSize(vFlopsNew), Aig_ManRegNum(pAbs)+Vec_IntSize(vFlopsNew) );
230 Entry = Vec_IntEntry(pAbs->vCiNumsOrig, Entry);
231 assert( Entry >= Saig_ManPiNum(
p) );
232 assert( Entry < Aig_ManCiNum(
p) );
233 Vec_IntPush( vFlops, Entry-Saig_ManPiNum(
p) );
235 Vec_IntFree( vFlopsNew );
237 Vec_IntSort( vFlops, 0 );
239 assert( Vec_IntEntry(vFlops, i-1) != Entry );
267 if ( vFlopsNew == NULL )
272 if ( Vec_IntSize(vFlopsNew) == 0 )
274 printf(
"Refinement did not happen. Discovered a true counter-example.\n" );
275 printf(
"Remapping counter-example from %d to %d primary inputs.\n", Aig_ManCiNum(pAbs), Aig_ManCiNum(
p) );
277 Vec_IntFree( vFlopsNew );
283 printf(
"Adding %d registers to the abstraction (total = %d). ", Vec_IntSize(vFlopsNew), Aig_ManRegNum(
p)+Vec_IntSize(vFlopsNew) );
284 Abc_PrintTime( 1,
"Time", Abc_Clock() - clk );
288 if ( nFfToAddMax > 0 && Vec_IntSize(vFlopsNew) > nFfToAddMax )
293 Vec_IntAddToEntry( vFlopsNew, i, -Saig_ManPiNum(
p) );
296 assert( Vec_IntSize(vFlopsNewBest) == nFfToAddMax );
297 printf(
"Filtering flops based on cost (%d -> %d).\n", Vec_IntSize(vFlopsNew), Vec_IntSize(vFlopsNewBest) );
299 Vec_IntFree( vFlopsNew );
300 vFlopsNew = vFlopsNewBest;
303 Vec_IntAddToEntry( vFlopsNew, i, Saig_ManPiNum(
p) );
308 Entry = Vec_IntEntry(pAbs->vCiNumsOrig, Entry);
309 assert( Entry >= Saig_ManPiNum(
p) );
310 assert( Entry < Aig_ManCiNum(
p) );
311 Vec_IntPush( vFlops, Entry-Saig_ManPiNum(
p) );
313 Vec_IntFree( vFlopsNew );
333 vFlops = Vec_IntAlloc( 100 );
336 Vec_IntPush( vFlops, i );
355 vFlopClasses = Vec_IntStart( Gia_ManRegNum(pGia) );
357 Vec_IntWriteEntry( vFlopClasses, Entry, 1 );
378 printf(
"Gia_ManCexAbstractionRefine(): Abstraction latch map is missing.\n" );
385 pGia->
pCexSeq = pNew->pSeqModel; pNew->pSeqModel = NULL;
386 Vec_IntFree( vFlops );
392 Vec_IntFree( vFlops );
415 assert( Aig_ManRegNum(
p) > 0 );
417 printf(
"Performing counter-example-based refinement.\n" );
419 vFlops = Vec_IntStartNatural( 1 );
433 printf(
"Refining abstraction...\n" );
434 for ( Iter = 0; ; Iter++ )
436 pTemp =
Saig_ManCexRefine(
p, pAbs, vFlops, pPars->
nFramesBmc, pPars->
nConfMaxBmc, pPars->
fUseBdds, pPars->
fUseDprove, pPars->
fVerbose, pPars->
fUseStart?&nUseStart:NULL, &pPars->
Status, &pPars->
nFramesDone );
440 p->pSeqModel = pAbs->pSeqModel;
441 pAbs->pSeqModel = NULL;
447 printf(
"ITER %4d : ", Iter );
454 if ( 100.0*(Aig_ManRegNum(
p)-Aig_ManRegNum(pAbs))/Aig_ManRegNum(
p) < 1.0*pPars->
nRatio )
456 printf(
"Refinements is stopped because flop reduction is less than %d%%\n", pPars->
nRatio );
459 Vec_IntFree( vFlops );
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
int Saig_ManCexFirstFlopPi(Aig_Man_t *p, Aig_Man_t *pAbs)
Aig_Man_t * Saig_ManCexRefine(Aig_Man_t *p, Aig_Man_t *pAbs, Vec_Int_t *vFlops, int nFrames, int nConfMaxOne, int fUseBdds, int fUseDprove, int fVerbose, int *pnUseStart, int *piRetValue, int *pnFrames)
int Gia_ManCexAbstractionRefine(Gia_Man_t *pGia, Abc_Cex_t *pCex, int nFfToAddMax, int fTryFour, int fSensePath, int fVerbose)
ABC_NAMESPACE_IMPL_START void Gia_ManAbsSetDefaultParams(Gia_ParAbs_t *p)
DECLARATIONS ///.
Vec_Int_t * Gia_ManClasses2Flops(Vec_Int_t *vFlopClasses)
int Saig_ManCexRefineStep(Aig_Man_t *p, Vec_Int_t *vFlops, Vec_Int_t *vFlopClasses, Abc_Cex_t *pCex, int nFfToAddMax, int fTryFour, int fSensePath, int fVerbose)
Vec_Int_t * Saig_ManCexAbstractionFlops(Aig_Man_t *p, Gia_ParAbs_t *pPars)
Abc_Cex_t * Saig_ManCexRemap(Aig_Man_t *p, Aig_Man_t *pAbs, Abc_Cex_t *pCexAbs)
Vec_Int_t * Gia_ManFlops2Classes(Gia_Man_t *pGia, Vec_Int_t *vFlops)
struct Gia_ParAbs_t_ Gia_ParAbs_t
Vec_Int_t * Saig_ManExtendCounterExampleTest2(Aig_Man_t *p, int iFirstPi, Abc_Cex_t *pCex, int fVerbose)
Vec_Int_t * Saig_ManCbaFilterFlops(Aig_Man_t *pAig, Abc_Cex_t *pAbsCex, Vec_Int_t *vFlopClasses, Vec_Int_t *vAbsFfsToAdd, int nFfsToSelect)
FUNCTION DEFINITIONS ///.
void Aig_ManSetCioIds(Aig_Man_t *p)
void Aig_ManStop(Aig_Man_t *p)
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
struct Aig_Obj_t_ Aig_Obj_t
void Aig_ManPrintStats(Aig_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
int Saig_BmcPerform(Aig_Man_t *pAig, int nStart, int nFramesMax, int nNodesMax, int nTimeOut, int nConfMaxOne, int nConfMaxAll, int fVerbose, int fVerbOverwrite, int *piFrames, int fSilent, int fUseSatoko)
Aig_Man_t * Gia_ManToAig(Gia_Man_t *p, int fChoices)
struct Gia_Man_t_ Gia_Man_t
void Ioa_WriteAiger(Aig_Man_t *pMan, char *pFileName, int fWriteSymbols, int fCompact)
void Pdr_ManSetDefaultParams(Pdr_Par_t *pPars)
MACRO DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Pdr_Par_t_ Pdr_Par_t
INCLUDES ///.
int Pdr_ManSolve(Aig_Man_t *p, Pdr_Par_t *pPars)
void Bbr_ManSetDefaultParams(Saig_ParBbr_t *p)
int Aig_ManVerifyUsingBdds(Aig_Man_t *pInit, Saig_ParBbr_t *pPars)
Vec_Int_t * Saig_ManExtendCounterExampleTest3(Aig_Man_t *pAig, int iFirstFlopPi, Abc_Cex_t *pCex, int fVerbose)
struct Saig_ParBbr_t_ Saig_ParBbr_t
Aig_Man_t * Saig_ManDupAbstraction(Aig_Man_t *pAig, Vec_Int_t *vFlops)
int Saig_ManFindFailedPoCex(Aig_Man_t *pAig, Abc_Cex_t *p)
Aig_Man_t * Saig_ManDupOrpos(Aig_Man_t *p)
DECLARATIONS ///.
#define Saig_ManForEachPi(p, pObj, i)
int Saig_ManVerifyCex(Aig_Man_t *pAig, Abc_Cex_t *p)
void Abc_CexFree(Abc_Cex_t *p)
ABC_NAMESPACE_IMPL_START Abc_Cex_t * Abc_CexAlloc(int nRegs, int nRealPis, int nFrames)
DECLARATIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
#define Vec_IntForEachEntryStart(vVec, Entry, i, Start)