51 Vec_Bit_t * vLeaves = Vec_BitStart( Wlc_NtkObjNumMax(
p) );
55 if ( vUnmark && Vec_BitEntry(vUnmark, i) )
59 if ( Wlc_ObjRange(pObj) >= pPars->
nBitsAdd )
60 Vec_BitWriteEntry( vLeaves, Wlc_ObjId(
p, pObj), 1 ), Count[0]++;
65 if ( Wlc_ObjRange(pObj) >= pPars->
nBitsMul )
66 Vec_BitWriteEntry( vLeaves, Wlc_ObjId(
p, pObj), 1 ), Count[1]++;
71 if ( Wlc_ObjRange(pObj) >= pPars->
nBitsMux )
72 Vec_BitWriteEntry( vLeaves, Wlc_ObjId(
p, pObj), 1 ), Count[2]++;
75 if ( Wlc_ObjIsCi(pObj) && !Wlc_ObjIsPi(pObj) )
77 if ( Wlc_ObjRange(pObj) >= pPars->
nBitsFlop )
78 Vec_BitWriteEntry( vLeaves, Wlc_ObjId(
p, pObj), 1 ), Count[3]++;
83 printf(
"Abstraction engine marked %d adds/subs, %d muls/divs, %d muxes, and %d flops to be abstracted away.\n", Count[0], Count[1], Count[2], Count[3] );
107 if ( Vec_BitEntry(vLeaves, Wlc_ObjId(
p, pObj)) )
109 assert( !Wlc_ObjIsPi(pObj) );
110 Vec_IntPush( vPisNew, Wlc_ObjId(
p, pObj) );
113 if ( Wlc_ObjIsCi(pObj) )
115 if ( Wlc_ObjIsPi(pObj) )
116 Vec_IntPush( vPisOld, Wlc_ObjId(
p, pObj) );
118 Vec_IntPush( vFlops, Wlc_ObjId(
p, pObj) );
122 Wlc_NtkAbsMarkNodes_rec(
p, Wlc_NtkObj(
p, iFanin), vLeaves, vPisOld, vPisNew, vFlops );
130 Wlc_NtkAbsMarkNodes_rec(
p, pObj, vLeaves, vPisOld, vPisNew, vFlops );
132 Wlc_NtkAbsMarkNodes_rec(
p, Wlc_ObjFo2Fi(
p, pObj), vLeaves, vPisOld, vPisNew, vFlops );
138 Vec_IntSort( vPisOld, 0 );
139 Vec_IntSort( vPisNew, 0 );
140 Vec_IntSort( vFlops, 0 );
162 Vec_Int_t * vPisOld = Vec_IntAlloc( 100 );
163 Vec_Int_t * vPisNew = Vec_IntAlloc( 100 );
164 Vec_Int_t * vFlops = Vec_IntAlloc( 100 );
165 Vec_Bit_t * vLeaves = Wlc_NtkAbsMarkOpers(
p, pPars, vUnmark, fVerbose );
166 Wlc_NtkAbsMarkNodes(
p, vLeaves, vPisOld, vPisNew, vFlops );
167 Vec_BitFree( vLeaves );
169 Vec_IntFree( vPisOld );
170 Vec_IntFree( vFlops );
174 Vec_IntFree( vPisNew );
194 Vec_Int_t * vRefine = Vec_IntAlloc( 100 );
198 int f, i, b, nRealPis, nPpiBits = 0;
199 Vec_Int_t * vMap = Vec_IntStartFull( pCex->nPis );
201 for ( b = 0; b < Wlc_ObjRange(pObj); b++ )
202 Vec_IntWriteEntry( vMap, nPpiBits++, Wlc_ObjId(
p, pObj) );
204 nRealPis = pCex->nPis - nPpiBits;
207 assert( pCexCare->nPis == pCex->nPis );
209 for ( f = 0; f <= pCexCare->iFrame; f++ )
210 for ( i = nRealPis; i < pCexCare->nPis; i++ )
211 if ( Abc_InfoHasBit(pCexCare->pData, pCexCare->nRegs + pCexCare->nPis * f + i) )
212 Vec_IntPushUniqueOrder( vRefine, Vec_IntEntry(vMap, i-nRealPis) );
215 if ( Vec_IntSize(vRefine) == 0 )
216 Vec_IntFreeP( &vRefine );
234 int i, Fanin, Counter = 1;
235 if ( Wlc_ObjIsCi(pNode) )
237 Vec_BitWriteEntry( vUnmark, Wlc_ObjId(
p, pNode), 1 );
240 Vec_IntAddToEntry( &
p->vRefs, Fanin, -1 );
241 if ( Vec_IntEntry(&
p->vRefs, Fanin) == 0 )
242 Counter += Wlc_NtkNodeDeref_rec(
p, Wlc_NtkObj(
p, Fanin), vUnmark );
248 int i, Fanin, Counter = 1;
249 if ( Wlc_ObjIsCi(pNode) )
253 if ( Vec_IntEntry(&
p->vRefs, Fanin) == 0 )
254 Counter += Wlc_NtkNodeRef_rec(
p, Wlc_NtkObj(
p, Fanin) );
255 Vec_IntAddToEntry( &
p->vRefs, Fanin, 1 );
263 while ( Wlc_ObjIsCi(pNode) )
265 Vec_BitWriteEntry( vUnmark, Wlc_ObjId(
p, pNode), 1 );
266 pNode = Wlc_ObjFo2Fi(
p, pNode);
268 assert( !Wlc_ObjIsCi(pNode) );
270 Count1 = Wlc_NtkNodeDeref_rec(
p, pNode, vUnmark );
272 Count2 = Wlc_NtkNodeRef_rec(
p, pNode );
273 assert( Count1 == Count2 );
279 if ( Vec_IntSize(&
p->vRefs) == 0 )
282 nNodes += Wlc_NtkMarkMffc(
p, pObj, vUnmark );
305 int nIters, nNodes, nDcFlops, RetValue = -1;
308 Vec_Bit_t * vUnmark = Vec_BitStart( Wlc_NtkObjNumMax(
p) );
310 Pdr_Par_t PdrPars, * pPdrPars = &PdrPars;
312 pPdrPars->fUseAbs = 1;
314 pPdrPars->fSkipDown = 0;
318 for ( nIters = 1; nIters < pPars->
nIterMax; nIters++ )
327 printf(
"\nIteration %d:\n", nIters );
330 pAbs = Wlc_NtkAbs(
p, pPars, vUnmark, &vPisNew, pPars->
fVerbose );
351 printf(
"Derived abstraction with %d objects and %d PPIs. Bit-blasted AIG stats are:\n", Wlc_NtkObjNum(pAbs), Vec_IntSize(vPisNew) );
359 pCex = pAig->pSeqModel; pAig->pSeqModel = NULL;
367 Vec_IntFree( vPisNew );
372 vRefine = Wlc_NtkAbsRefinement(
p, pGia, pCex, vPisNew );
374 Vec_IntFree( vPisNew );
375 if ( vRefine == NULL )
382 nNodes = Wlc_NtkRemoveFromAbstraction(
p, vRefine, vUnmark );
384 printf(
"Refinement of CEX in frame %d came up with %d un-abstacted PPIs, whose MFFCs include %d objects.\n", pCex->iFrame, Vec_IntSize(vRefine), nNodes );
385 Vec_IntFree( vRefine );
388 Vec_BitFree( vUnmark );
392 printf(
"Abstraction " );
394 printf(
"resulted in a real CEX" );
395 else if ( RetValue == 1 )
396 printf(
"is successfully proved" );
398 printf(
"timed out" );
399 printf(
" after %d iterations. ", nIters );
400 Abc_PrintTime( 1,
"Time", Abc_Clock() - clk );
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
void Aig_ManStop(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 ///.
Abc_Cex_t * Bmc_CexCareMinimizeAig(Gia_Man_t *p, int nRealPis, Abc_Cex_t *pCex, int nTryCexes, int fCheck, int fVerbose)
Aig_Man_t * Gia_ManToAigSimple(Gia_Man_t *p)
void Gia_ManStop(Gia_Man_t *p)
Gia_Man_t * Gia_ManPermuteInputs(Gia_Man_t *p, int nPpis, int nExtra)
struct Gia_Man_t_ Gia_Man_t
Gia_Man_t * Gia_ManTransformMiter2(Gia_Man_t *p)
void Gia_ManPrintStats(Gia_Man_t *p, Gps_Par_t *pPars)
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 Abc_CexFree(Abc_Cex_t *p)
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Bit_t_ Vec_Bit_t
INCLUDES ///.
int Wlc_NtkAbsCore2(Wlc_Ntk_t *p, Wlc_Par_t *pPars)
struct Wlc_Par_t_ Wlc_Par_t
Wlc_Ntk_t * Wlc_NtkDupDfsAbs(Wlc_Ntk_t *p, Vec_Int_t *vPisOld, Vec_Int_t *vPisNew, Vec_Int_t *vFlops)
Gia_Man_t * Wlc_NtkBitBlast(Wlc_Ntk_t *p, Wlc_BstPar_t *pPars)
void Wlc_NtkCleanMarks(Wlc_Ntk_t *p)
#define Wlc_NtkForEachObjVec(vVec, p, pObj, i)
void Wlc_NtkFree(Wlc_Ntk_t *p)
void Wlc_NtkSetRefs(Wlc_Ntk_t *p)
struct Wlc_Ntk_t_ Wlc_Ntk_t
#define Wlc_NtkForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
#define Wlc_ObjForEachFanin(pObj, iFanin, i)
int Wlc_NtkCountObjBits(Wlc_Ntk_t *p, Vec_Int_t *vPisNew)
struct Wlc_Obj_t_ Wlc_Obj_t
BASIC TYPES ///.
#define Wlc_NtkForEachCo(p, pCo, i)
int Wlc_NtkDcFlopNum(Wlc_Ntk_t *p)