49 assert( pCex->nBits == pCex->nRegs + pCex->nPis * (pCex->iFrame + 1) );
50 assert( pCex->nBits - pCex->nRegs + Gia_ManRegNum(pAig) <= Vec_PtrSize(vInfo) );
51 nWords = Vec_PtrReadWordsSimInfo( vInfo );
63 for ( k = 0; k < pCex->nRegs; k++ )
64 if ( Abc_InfoHasBit( pCex->pData, k ) )
66 if ( k < pCex->nRegs )
67 Abc_Print( 0,
"The CEX has flop values different from 0, but they are currently not used by \"resim\".\n" );
70 for ( k = 0; k < Gia_ManRegNum(pAig); k++ )
72 pInfo = (
unsigned *)Vec_PtrEntry( vInfo, k );
73 for ( w = 0; w <
nWords; w++ )
76 for ( i = pCex->nRegs; i < pCex->nBits; i++ )
78 pInfo = (
unsigned *)Vec_PtrEntry( vInfo, k++ );
79 for ( w = 0; w <
nWords; w++ )
82 pInfo[0] = (pInfo[0] << 1) | Abc_InfoHasBit( pCex->pData, i );
85 for ( ; k < Vec_PtrSize(vInfo); k++ )
87 pInfo = (
unsigned *)Vec_PtrEntry( vInfo, k );
88 for ( w = 0; w <
nWords; w++ )
108 nWords = Vec_PtrReadWordsSimInfo( vInfo );
109 assert( pCex == NULL || Gia_ManRegNum(pAig) == pCex->nRegs );
110 assert( Gia_ManRegNum(pAig) <= Vec_PtrSize(vInfo) );
111 for ( k = 0; k < Gia_ManRegNum(pAig); k++ )
113 pInfo = (
unsigned *)Vec_PtrEntry( vInfo, k );
114 for ( w = 0; w <
nWords; w++ )
115 pInfo[w] = (pCex && Abc_InfoHasBit(pCex->pData, k))? ~0 : 0;
118 for ( ; k < Vec_PtrSize(vInfo); k++ )
120 pInfo = (
unsigned *)Vec_PtrEntry( vInfo, k );
121 for ( w = 0; w <
nWords; w++ )
139 unsigned * pInfo0, * pInfo1;
142 assert( Vec_PtrSize(vInfo) == Gia_ManRegNum(
p->pAig) + Gia_ManPiNum(
p->pAig) *
p->pPars->nFrames );
143 for ( k = 0; k < Gia_ManRegNum(
p->pAig); k++ )
145 pInfo0 = (
unsigned *)Vec_PtrEntry( vInfo, k );
146 pInfo1 = (
unsigned *)Vec_PtrEntry(
p->vCoSimInfo, Gia_ManPoNum(
p->pAig) + k );
147 for ( w = 0; w <
p->nWords; w++ )
148 pInfo1[w] = pInfo0[w];
150 for ( f = 0; f <
p->pPars->nFrames; f++ )
152 for ( i = 0; i < Gia_ManPiNum(
p->pAig); i++ )
154 pInfo0 = (
unsigned *)Vec_PtrEntry( vInfo, k++ );
155 pInfo1 = (
unsigned *)Vec_PtrEntry(
p->vCiSimInfo, i );
156 for ( w = 0; w <
p->nWords; w++ )
157 pInfo1[w] = pInfo0[w];
159 for ( i = 0; i < Gia_ManRegNum(
p->pAig); i++ )
161 pInfo0 = (
unsigned *)Vec_PtrEntry(
p->vCoSimInfo, Gia_ManPoNum(
p->pAig) + i );
162 pInfo1 = (
unsigned *)Vec_PtrEntry(
p->vCiSimInfo, Gia_ManPiNum(
p->pAig) + i );
163 for ( w = 0; w <
p->nWords; w++ )
164 pInfo1[w] = pInfo0[w];
169 assert( k == Vec_PtrSize(vInfo) );
189 assert( (Vec_PtrSize(vSimInfo) - Gia_ManRegNum(pAig)) % Gia_ManPiNum(pAig) == 0 );
191 pParsSim->
nFrames = (Vec_PtrSize(vSimInfo) - Gia_ManRegNum(pAig)) / Gia_ManPiNum(pAig);
192 pParsSim->
nWords = Vec_PtrReadWordsSimInfo( vSimInfo );
219 abctime clkTotal = Abc_Clock();
222 Abc_Print( 1,
"Cec_ManSeqResimulateCounter(): Counter-example is not available.\n" );
225 if ( pAig->
pReprs == NULL )
227 Abc_Print( 1,
"Cec_ManSeqResimulateCounter(): Equivalence classes are not available.\n" );
230 if ( Gia_ManRegNum(pAig) == 0 )
232 Abc_Print( 1,
"Cec_ManSeqResimulateCounter(): Not a sequential AIG.\n" );
236 if ( Gia_ManPiNum(pAig) != pCex->nPis )
238 Abc_Print( 1,
"Cec_ManSeqResimulateCounter(): The number of PIs in the AIG and the counter-example differ.\n" );
242 Abc_Print( 1,
"Resimulating %d timeframes.\n", pPars->
nFrames + pCex->iFrame + 1 );
244 vSimInfo = Vec_PtrAllocSimInfo( Gia_ManRegNum(pAig) +
245 Gia_ManPiNum(pAig) * (pPars->
nFrames + pCex->iFrame + 1), 1 );
252 Vec_PtrFree( vSimInfo );
254 ABC_PRT(
"Time", Abc_Clock() - clkTotal );
276 if ( pAig->
pReprs == NULL )
279 if ( !Gia_ObjIsConst( pAig, Gia_ObjFaninId0p(pAig, pObj) ) )
299 if ( pAig->
pReprs == NULL )
303 Gia_ObjFanin0(pObj)->fMark0 = 1;
306 if ( Gia_ObjIsCand(pObj) && !pObj->
fMark0 && Gia_ObjRepr(pAig, i) !=
GIA_VOID )
313 Gia_ObjFanin0(pObj)->fMark0 = 0;
338 int r, nPats, RetValue = 0;
339 if ( pAig->
pReprs == NULL )
341 Abc_Print( 1,
"Cec_ManSeqSemiformal(): Equivalence classes are not available.\n" );
344 if ( Gia_ManRegNum(pAig) == 0 )
346 Abc_Print( 1,
"Cec_ManSeqSemiformal(): Not a sequential AIG.\n" );
356 pParsSat->nBTLimit = pPars->
nBTLimit;
357 pParsSat->fVerbose = pPars->
fVerbose;
358 if ( pParsSat->fVerbose )
360 Abc_Print( 1,
"Starting: " );
365 for ( r = 0; r < pPars->
nRounds; r++ )
369 Abc_Print( 1,
"Cec_ManSeqSemiformal: There are only trivial equiv candidates left (PO drivers). Quitting.\n" );
378 Abc_Print( 1,
"Quitting refinement because miter could not be unrolled.\n" );
381 assert( Gia_ManRegNum(pSrm) == 0 && Gia_ManPiNum(pSrm) == (Gia_ManPiNum(pAig) * nFramesReal) );
383 Abc_Print( 1,
"Unrolled for %d frames.\n", nFramesReal );
385 vSimInfo = Vec_PtrAllocSimInfo( Gia_ManRegNum(pAig) +
386 Gia_ManPiNum(pAig) * (nFramesReal + nAddFrames), pPars->
nWords );
389 vStatus =
Cec_ManSatSolveSeq( vSimInfo, pSrm, pParsSat, Gia_ManRegNum(pAig), &nPats );
390 Vec_StrFree( vStatus );
394 Vec_PtrFree( vSimInfo );
395 assert( pState->iPo >= 0 );
399 Abc_Print( 1,
"BMC = %3d ", nPats );
419 Abc_Print( 1,
"Cec_ManSeqSemiformal(): An output of the miter is asserted. Refinement stopped.\n" );
433 Abc_Print( 1,
"The number of POs that are not const-0 candidates = %d.\n", nNonConsts );
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
struct Vec_Str_t_ Vec_Str_t
int Cec_ManSimSimulateRound(Cec_ManSim_t *p, Vec_Ptr_t *vInfoCis, Vec_Ptr_t *vInfoCos)
void Cec_ManSimStop(Cec_ManSim_t *p)
Cec_ManSim_t * Cec_ManSimStart(Gia_Man_t *pAig, Cec_ParSim_t *pPars)
struct Cec_ManSim_t_ Cec_ManSim_t
Vec_Str_t * Cec_ManSatSolveSeq(Vec_Ptr_t *vPatts, Gia_Man_t *pAig, Cec_ParSat_t *pPars, int nRegs, int *pnPats)
int Cec_ManCheckNonTrivialCands(Gia_Man_t *pAig)
void Cec_ManSeqDeriveInfoInitRandom(Vec_Ptr_t *vInfo, Gia_Man_t *pAig, Abc_Cex_t *pCex)
int Cec_ManSeqSemiformal(Gia_Man_t *pAig, Cec_ParSmf_t *pPars)
int Cec_ManCountNonConstOutputs(Gia_Man_t *pAig)
int Cec_ManSeqResimulateInfo(Gia_Man_t *pAig, Vec_Ptr_t *vSimInfo, Abc_Cex_t *pBestState, int fCheckMiter)
int Cec_ManSeqResimulateCounter(Gia_Man_t *pAig, Cec_ParSim_t *pPars, Abc_Cex_t *pCex)
int Cec_ManSeqResimulate(Cec_ManSim_t *p, Vec_Ptr_t *vInfo)
ABC_NAMESPACE_IMPL_START void Cec_ManSeqDeriveInfoFromCex(Vec_Ptr_t *vInfo, Gia_Man_t *pAig, Abc_Cex_t *pCex)
DECLARATIONS ///.
void Cec_ManSatSetDefaultParams(Cec_ParSat_t *p)
DECLARATIONS ///.
void Cec_ManSimSetDefaultParams(Cec_ParSim_t *p)
typedefABC_NAMESPACE_HEADER_START struct Cec_ParSat_t_ Cec_ParSat_t
INCLUDES ///.
struct Cec_ParSmf_t_ Cec_ParSmf_t
struct Cec_ParSim_t_ Cec_ParSim_t
void Gia_ManStop(Gia_Man_t *p)
#define Gia_ManForEachPo(p, pObj, i)
void Gia_ManCreateValueRefs(Gia_Man_t *p)
struct Gia_Obj_t_ Gia_Obj_t
void Gia_ManEquivPrintClasses(Gia_Man_t *p, int fVerbose, float Mem)
struct Gia_Man_t_ Gia_Man_t
void Gia_ManCleanMark0(Gia_Man_t *p)
Gia_Man_t * Gia_ManSeqStructSweep(Gia_Man_t *p, int fConst, int fEquiv, int fVerbose)
Gia_Man_t * Gia_ManSpecReduce(Gia_Man_t *p, int fDualOut, int fSynthesis, int fReduce, int fSkipSome, int fVerbose)
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
unsigned Gia_ManRandom(int fReset)
FUNCTION DEFINITIONS ///.
Gia_Man_t * Gia_ManSpecReduceInitFrames(Gia_Man_t *p, Abc_Cex_t *pInit, int nFramesMax, int *pnFrames, int fDualOut, int nMinOutputs)
void Gia_AigerWrite(Gia_Man_t *p, char *pFileName, int fWriteSymbols, int fCompact, int fWriteNewLine)
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 ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.