49 assert( pCexAbs->iPo == 0 );
51 pCex =
Abc_CexAlloc( Gia_ManRegNum(
p), Gia_ManPiNum(
p), pCexAbs->iFrame+1 );
52 pCex->iFrame = pCexAbs->iFrame;
53 pCex->iPo = pCexAbs->iPo;
55 for ( f = 0; f <= pCexAbs->iFrame; f++ )
56 for ( i = 0; i < Vec_IntSize(vPis); i++ )
58 if ( Abc_InfoHasBit( pCexAbs->pData, pCexAbs->nRegs + pCexAbs->nPis * f + i ) )
60 iPiNum = Gia_ObjCioId( Gia_ManObj(
p, Vec_IntEntry(vPis, i)) );
61 Abc_InfoSetBit( pCex->pData, pCex->nRegs + pCex->nPis * f + iPiNum );
67 Abc_Print( 1,
"Gia_ManCexRemap(): Counter-example is invalid.\n" );
73 Abc_Print( 1,
"Counter-example verification is successful.\n" );
74 Abc_Print( 1,
"Output %d of miter \"%s\" was asserted in frame %d. \n", pCex->iPo,
p->pName, pCex->iFrame );
101 int nOnes = 0, Counter = 0;
102 if (
p->vGateClasses == NULL )
104 Abc_Print( 1,
"Gia_ManGlaRefine(): Abstraction gate map is missing.\n" );
111 if ( Gia_ManPiNum(pAbs) != pCex->nPis )
113 Abc_Print( 1,
"Gia_ManGlaRefine(): The PI counts in GLA and in CEX do not match.\n" );
119 Abc_Print( 1,
"Gia_ManGlaRefine(): The initial counter-example is invalid.\n" );
127 assert( Vec_IntSize(vPis) + Vec_IntSize(vPPis) == Gia_ManPiNum(pAbs) );
133 Gia_ObjTerSimSet0( Gia_ManConst0(pAbs) );
134 for ( f = 0; f <= pCex->iFrame; f++ )
138 if ( i >= Vec_IntSize(vPis) )
139 Gia_ObjTerSimSetX( pObj );
140 else if ( Abc_InfoHasBit(pCex->pData, pCex->nRegs + pCex->nPis * f + i) )
141 Gia_ObjTerSimSet1( pObj );
143 Gia_ObjTerSimSet0( pObj );
148 Gia_ObjTerSimSet0( pObj );
150 Gia_ObjTerSimRo( pAbs, pObj );
153 Gia_ObjTerSimAnd( pObj );
155 Gia_ObjTerSimCo( pObj );
157 pObj = Gia_ManPo( pAbs, 0 );
158 if ( Gia_ObjTerSimGet1(pObj) )
161 Abc_Print( 1,
"Procedure &gla_refine found a real counter-example in frame %d.\n", pCexNew->iFrame );
166 Gia_ObjTerSimSetC( pObj );
167 if ( pCexNew == NULL )
172 assert( Vec_IntEntry(
p->vGateClasses, iObjId ) == 0 );
173 Vec_IntWriteEntry(
p->vGateClasses, iObjId, 1 );
177 Abc_Print( 1,
"Additional objects = %d. ", Vec_IntSize(vPPis) );
178 Abc_PrintTime( 1,
"Time", Abc_Clock() - clk );
189 Abc_Print( 1,
"Counter-example minimization has failed.\n" );
192 for ( f = 0; f <= pCare->iFrame; f++ )
193 for ( i = 0; i < pCare->nPis; i++ )
194 if ( Abc_InfoHasBit( pCare->pData, pCare->nRegs + f * pCare->nPis + i ) )
197 assert( i >= Vec_IntSize(vPis) );
198 iObjId = Vec_IntEntry( vPPis, i - Vec_IntSize(vPis) );
199 assert( iObjId > 0 && iObjId < Gia_ManObjNum(
p) );
200 if ( Vec_IntEntry(
p->vGateClasses, iObjId ) > 0 )
202 assert( Vec_IntEntry(
p->vGateClasses, iObjId ) == 0 );
203 Vec_IntWriteEntry(
p->vGateClasses, iObjId, 1 );
211 Abc_Print( 1,
"Essential bits = %d. Additional objects = %d. ", nOnes, Counter );
212 Abc_PrintTime( 1,
"Time", Abc_Clock() - clk );
218 Abc_Print( 1,
"Procedure &gla_refine found a real counter-example in frame %d.\n", pCexNew->iFrame );
222 Vec_IntFree( vPPis );
227 p->pCexSeq = pCexNew;
253 Vec_Int_t * vInit = Vec_IntAlloc( Gia_ManRegNum(pAig) );
255 int RetValue, i, k, iBit = 0;
256 assert( iFrame >= 0 && iFrame <= p->iFrame );
260 for ( i = 0, iBit =
p->nRegs; i <= p->iFrame; i++ )
265 Vec_IntPush( vInit, pObjRo->
fMark0 );
268 pObj->
fMark0 = Abc_InfoHasBit(
p->pData, iBit++);
270 pObj->
fMark0 = (Gia_ObjFanin0(pObj)->fMark0 ^ Gia_ObjFaninC0(pObj)) &
271 (Gia_ObjFanin1(pObj)->fMark0 ^ Gia_ObjFaninC1(pObj));
273 pObj->
fMark0 = Gia_ObjFanin0(pObj)->fMark0 ^ Gia_ObjFaninC0(pObj);
274 if ( i ==
p->iFrame )
280 RetValue = Gia_ManPo(pAig,
p->iPo)->fMark0;
282 Vec_IntFreeP( &vInit );
301 int RetValue, i, k, iBit = 0;
302 assert( iFrame >= 0 && iFrame <= p->iFrame );
306 for ( i = iFrame, iBit +=
p->nRegs + Gia_ManPiNum(pAig) * iFrame; i <=
p->iFrame; i++ )
309 pObj->
fMark0 = Abc_InfoHasBit(
p->pData, iBit++);
311 pObj->
fMark0 = (Gia_ObjFanin0(pObj)->fMark0 ^ Gia_ObjFaninC0(pObj)) &
312 (Gia_ObjFanin1(pObj)->fMark0 ^ Gia_ObjFaninC1(pObj));
314 pObj->
fMark0 = Gia_ObjFanin0(pObj)->fMark0 ^ Gia_ObjFaninC0(pObj);
315 if ( i ==
p->iFrame )
321 RetValue = Gia_ManPo(pAig,
p->iPo)->fMark0;
324 printf(
"Shortened CEX holds for the abstraction of the fast-forwarded model.\n" );
326 printf(
"Shortened CEX does not hold for the abstraction of the fast-forwarded model.\n" );
346 assert( Vec_IntSize(vInit) == Vec_IntSize(vFlops) );
347 vInitNew = Vec_BitStart( Gia_ManRegNum(
p) );
350 assert( Gia_ObjIsRo(
p, pObj) );
351 if ( Vec_IntEntry(vInit, i) == 0 )
353 iFlopId = Gia_ObjCioId(pObj) - Gia_ManPiNum(
p);
354 assert( iFlopId >= 0 && iFlopId < Gia_ManRegNum(
p) );
355 Vec_BitWriteEntry( vInitNew, iFlopId, 1 );
358 Vec_BitFree( vInitNew );
381 if (
p->vGateClasses == NULL )
383 Abc_Print( 1,
"Gia_ManNewRefine(): Abstraction gate map is missing.\n" );
386 vCopy = Vec_IntDup(
p->vGateClasses );
387 Abc_Print( 1,
"Refining with %d-frame CEX, starting in frame %d, with %d extra frames.\n", pCex->iFrame, iFrameStart, iFrameExtra );
392 if ( Gia_ManPiNum(pAbs) != pCex->nPis )
394 Abc_Print( 1,
"Gia_ManNewRefine(): The PI counts in GLA and in CEX do not match.\n" );
396 Vec_IntFree( vCopy );
403 Abc_Print( 1,
"Gia_ManNewRefine(): The initial counter-example is invalid.\n" );
405 Vec_IntFree( vCopy );
409 Abc_Print( 1,
"Gia_ManNewRefine(): The initial counter-example is correct.\n" );
418 Vec_IntFree( vFlops );
419 Vec_IntFree( vInit );
433 pPars->nFramesMax = pCex->iFrame - iFrameStart + 1 + iFrameExtra;
434 pPars->fVerbose = fVerbose;
443 Vec_IntFreeP( &
p->vGateClasses );
448 Vec_IntFree( vCopy );
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
Gia_Man_t * Gia_ManTransformFlops(Gia_Man_t *p, Vec_Int_t *vFlops, Vec_Int_t *vInit)
Vec_Int_t * Gia_ManGetStateAndCheckCex(Gia_Man_t *pAig, Abc_Cex_t *p, int iFrame)
ABC_NAMESPACE_IMPL_START Abc_Cex_t * Gia_ManCexRemap(Gia_Man_t *p, Abc_Cex_t *pCexAbs, Vec_Int_t *vPis)
DECLARATIONS ///.
int Gia_ManGlaRefine(Gia_Man_t *p, Abc_Cex_t *pCex, int fMinCut, int fVerbose)
void Gia_ManCheckCex(Gia_Man_t *pAig, Abc_Cex_t *p, int iFrame)
int Gia_ManNewRefine(Gia_Man_t *p, Abc_Cex_t *pCex, int iFrameStart, int iFrameExtra, int fVerbose)
Gia_Man_t * Gia_ManDupAbsGates(Gia_Man_t *p, Vec_Int_t *vGateClasses)
void Abs_ParSetDefaults(Abs_Par_t *p)
DECLARATIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Abs_Par_t_ Abs_Par_t
INCLUDES ///.
int Gia_ManPerformGla(Gia_Man_t *p, Abs_Par_t *pPars)
void Gia_ManGlaCollect(Gia_Man_t *p, Vec_Int_t *vGateClasses, Vec_Int_t **pvPis, Vec_Int_t **pvPPis, Vec_Int_t **pvFlops, Vec_Int_t **pvNodes)
Abc_Cex_t * Saig_ManCbaFindCexCareBits(Aig_Man_t *pAig, Abc_Cex_t *pCex, int nInputs, int fVerbose)
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 ///.
Aig_Man_t * Gia_ManToAigSimple(Gia_Man_t *p)
void Gia_ManStop(Gia_Man_t *p)
#define Gia_ManForEachRo(p, pObj, i)
Gia_Man_t * Gia_ManDupFlip(Gia_Man_t *p, int *pInitState)
#define Gia_ManForEachAnd(p, pObj, i)
#define Gia_ManForEachPi(p, pObj, i)
struct Gia_Obj_t_ Gia_Obj_t
struct Gia_Man_t_ Gia_Man_t
#define Gia_ManForEachObjVec(vVec, p, pObj, i)
void Gia_ManCleanMark0(Gia_Man_t *p)
int Gia_ManVerifyCex(Gia_Man_t *pAig, Abc_Cex_t *p, int fDualOut)
DECLARATIONS ///.
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
#define Gia_ManForEachCo(p, pObj, i)
#define Gia_ManForEachRiRo(p, pObjRi, pObjRo, i)
void Nwk_ManDeriveMinCut(Gia_Man_t *p, int fVerbose)
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 ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Bit_t_ Vec_Bit_t
INCLUDES ///.
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.