61 pCex = pAig->pSeqModel, pAig->pSeqModel = NULL;
63 Abc_Print( 1,
"Output %d of miter \"%s\" was asserted in frame %d.\n", pCex->iPo,
p->pName, pCex->iFrame );
65 else if ( fVeryVerbose )
66 Abc_Print( 1,
"No output asserted in %d frames. Resource limit reached.\n", pPars->
iFrame+2 );
88 pNew->
pName = Abc_UtilStrsav(
p->pName );
89 pNew->
pSpec = Abc_UtilStrsav(
p->pSpec );
90 Gia_ManConst0(
p)->Value = 0;
93 if ( Gia_ObjIsAnd(pObj) )
94 pObj->
Value = Gia_ManAppendAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
95 else if ( Gia_ObjIsCi(pObj) )
97 pObj->
Value = Gia_ManAppendCi( pNew );
100 else if ( Gia_ObjIsCo(pObj) )
102 pObj->
Value = Gia_ObjFanin0Copy(pObj);
104 pObj->
Value = Gia_ManAppendCo( pNew, pObj->
Value );
114 int RetValue, i, k, iBit = 0;
117 pObj->
fMark0 = Abc_InfoHasBit(
p->pData, iBit++);
118 for ( i = 0; i <=
p->iFrame; i++ )
121 pObj->
fMark0 = Abc_InfoHasBit(
p->pData, iBit++);
123 pObj->
fMark0 = (Gia_ObjFanin0(pObj)->fMark0 ^ Gia_ObjFaninC0(pObj)) &
124 (Gia_ObjFanin1(pObj)->fMark0 ^ Gia_ObjFaninC1(pObj));
126 pObj->
fMark0 = Gia_ObjFanin0(pObj)->fMark0 ^ Gia_ObjFaninC0(pObj);
127 if ( i ==
p->iFrame )
133 RetValue = Gia_ManPo(pGia,
p->iPo)->fMark0;
164 pNew->
pName = Abc_UtilStrsav(
p->pName );
165 pNew->
pSpec = Abc_UtilStrsav(
p->pSpec );
166 Gia_ManConst0(
p)->Value = 0;
170 if ( Gia_ObjIsAnd(pObj) )
172 else if ( Gia_ObjIsPi(
p, pObj) )
173 pObj->
Value = Gia_ManAppendCi( pNew );
174 else if ( Gia_ObjIsCi(pObj) )
176 else if ( Gia_ObjIsPo(
p, pObj) )
177 Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
180 assert( Gia_ManPiNum(
p) == Gia_ManPiNum(pNew) );
181 assert( Gia_ManPoNum(
p) == Gia_ManPoNum(pNew) );
196 Vec_IntClear( vSatIds );
198 Vec_IntPush( vSatIds, pCnf->
pVarNums[ Aig_ObjId(pObj) ] );
199 assert( Vec_IntSize(vSatIds) == Gia_ManPiNum(
p) );
214 int i, j, Lit, status = 0;
218 vSatIds = Vec_IntAlloc( Gia_ManPiNum(
p) );
220 vOutputs = Vec_IntAlloc( 100 );
223 if ( Gia_ObjFaninLit0p(pInit, pObj) == 0 )
225 Lit = Abc_Var2Lit( i+1, 0 );
230 Vec_IntPush( vOutputs, i );
237 for ( j = 0; j < Gia_ManPiNum(
p); j++ )
238 if ( sat_solver_var_value( pSat, Vec_IntEntry(vSatIds, j) ) )
239 Abc_InfoSetBit( pCex->pData, Gia_ManRegNum(
p) + j );
240 Vec_PtrPush( vCexes, pCex );
246 Vec_IntFree( vSatIds );
263 assert( Gia_ObjIsCo(pObj) );
264 pObj->
iDiff0 = Gia_ObjId(
p, pObj );
272 Count += (Gia_ObjFaninLit0p(
p, pObj) != 0);
281 assert( Gia_ObjFaninLit0p(
p, pObj) != 0 );
282 Gia_ObjMakePoConst0(
p, pObj );
283 assert( Gia_ObjFaninLit0p(
p, pObj) == 0 );
301 int Iter, IterMax = 10000;
305 abctime clk2, clk = Abc_Clock();
313 *pvCexes = Vec_PtrAlloc( 1000 );
314 for ( Iter = 0; Iter < IterMax; Iter++ )
316 if ( Gia_ManPoNum(pNew) == 0 )
319 printf(
"Finished all POs.\n" );
325 clkBmc += Abc_Clock() - clk2;
329 printf(
"BMC could not detect a failed output in %d frames with %d conflicts.\n", nFrameMax, nConfMax );
332 assert( !Iter || pCex->iFrame > 0 );
337 DepthTotal += pCex->iFrame;
338 clkMov += Abc_Clock() - clk2;
342 assert( Vec_IntFind(vOutputs, pCex->iPo) >= 0 );
345 Vec_PtrPush( *pvCexes, pCex );
348 clkSat += Abc_Clock() - clk2;
353 clkCln += Abc_Clock() - clk2;
358 clkSwp += Abc_Clock() - clk2;
363 printf(
"Iter %4d : ", Iter+1 );
364 printf(
"Depth =%5d ", DepthTotal );
365 printf(
"FailPo =%5d ", Vec_IntSize(vOutputs) );
366 printf(
"UndecPo =%5d ", nNonConst );
367 printf(
"(%6.2f %%) ", 100.0 * nNonConst / Gia_ManPoNum(pNew) );
368 printf(
"AIG =%8d ", Gia_ManAndNum(pNew) );
369 Abc_PrintTime( 1,
"Time", Abc_Clock() - clk );
371 Vec_IntFree( vOutputs );
373 printf(
"Completed a CEX chain with %d segments, %d frames, and %d failed POs (out of %d). ",
377 Abc_PrintTime( 1,
"Time", Abc_Clock() - clk );
378 Abc_PrintTimeP( 1,
"BMC ", clkBmc, Abc_Clock() - clk );
379 Abc_PrintTimeP( 1,
"Init ", clkMov, Abc_Clock() - clk );
380 Abc_PrintTimeP( 1,
"SAT ", clkSat, Abc_Clock() - clk );
381 Abc_PrintTimeP( 1,
"Clean", clkCln, Abc_Clock() - clk );
386 printf(
"Total number of CEXes collected = %d.\n", Vec_PtrSize(*pvCexes) );
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
void Aig_ManStop(Aig_Man_t *p)
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
struct Aig_Obj_t_ Aig_Obj_t
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Gia_Man_t * Gia_ManVerifyCexAndMove(Gia_Man_t *pGia, Abc_Cex_t *p)
sat_solver * Gia_ManDeriveSatSolver(Gia_Man_t *p, Vec_Int_t *vSatIds)
ABC_NAMESPACE_IMPL_START Abc_Cex_t * Bmc_ChainFailOneOutput(Gia_Man_t *p, int nFrameMax, int nConfMax, int fVerbose, int fVeryVerbose)
DECLARATIONS ///.
Gia_Man_t * Gia_ManDupPosAndPropagateInit(Gia_Man_t *p)
Gia_Man_t * Gia_ManDupWithInit(Gia_Man_t *p)
Vec_Int_t * Bmc_ChainFindFailedOutputs(Gia_Man_t *p, Vec_Ptr_t *vCexes)
int Gia_ManCountNonConst0(Gia_Man_t *p)
Gia_Man_t * Bmc_ChainCleanup(Gia_Man_t *p, Vec_Int_t *vOutputs)
int Bmc_ChainTest(Gia_Man_t *p, int nFrameMax, int nConfMax, int fVerbose, int fVeryVerbose, Vec_Ptr_t **pvCexes)
void Saig_ParBmcSetDefaultParams(Saig_ParBmc_t *p)
int Saig_ManBmcScalable(Aig_Man_t *pAig, Saig_ParBmc_t *pPars)
struct Saig_ParBmc_t_ Saig_ParBmc_t
Cnf_Dat_t * Cnf_Derive(Aig_Man_t *pAig, int nOutputs)
struct Cnf_Dat_t_ Cnf_Dat_t
void Cnf_DataFree(Cnf_Dat_t *p)
Aig_Man_t * Gia_ManToAigSimple(Gia_Man_t *p)
void Gia_ManStop(Gia_Man_t *p)
Gia_Man_t * Gia_ManDup(Gia_Man_t *p)
#define Gia_ManForEachRo(p, pObj, i)
#define Gia_ManForEachPo(p, pObj, i)
#define Gia_ManForEachAnd(p, pObj, i)
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
void Gia_ManHashAlloc(Gia_Man_t *p)
#define Gia_ManForEachPi(p, pObj, i)
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
struct Gia_Obj_t_ Gia_Obj_t
struct Gia_Man_t_ Gia_Man_t
#define Gia_ManForEachObj1(p, pObj, i)
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
void Gia_ManCleanMark0(Gia_Man_t *p)
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
#define Gia_ManForEachCo(p, pObj, i)
#define Gia_ManForEachRiRo(p, pObjRi, pObjRo, i)
void Gia_ManHashStop(Gia_Man_t *p)
void * Cnf_DataWriteIntoSolver(Cnf_Dat_t *p, int nFrames, int fInit)
void sat_solver_delete(sat_solver *s)
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 ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.