Commit 519b9fdf by Alan Mishchenko

Updating &gla_refine to perform suffix refinement.

parent 002117c0
...@@ -1781,7 +1781,7 @@ finish: ...@@ -1781,7 +1781,7 @@ finish:
Abc_Print( 1, "\n" ); Abc_Print( 1, "\n" );
if ( !Gia_ManVerifyCex( pAig, pAig->pCexSeq, 0 ) ) if ( !Gia_ManVerifyCex( pAig, pAig->pCexSeq, 0 ) )
Abc_Print( 1, " Gia_GlaPerform(): CEX verification has failed!\n" ); Abc_Print( 1, " Gia_GlaPerform(): CEX verification has failed!\n" );
Abc_Print( 1, "Counter-example detected in frame %d. ", f ); Abc_Print( 1, "True counter-example detected in frame %d. ", f );
p->pPars->iFrame = f - 1; p->pPars->iFrame = f - 1;
Vec_IntFreeP( &pAig->vGateClasses ); Vec_IntFreeP( &pAig->vGateClasses );
RetValue = 0; RetValue = 0;
......
...@@ -324,9 +324,9 @@ void Gia_ManCheckCex( Gia_Man_t * pAig, Abc_Cex_t * p, int iFrame ) ...@@ -324,9 +324,9 @@ void Gia_ManCheckCex( Gia_Man_t * pAig, Abc_Cex_t * p, int iFrame )
RetValue = Gia_ManPo(pAig, p->iPo)->fMark0; RetValue = Gia_ManPo(pAig, p->iPo)->fMark0;
Gia_ManCleanMark0(pAig); Gia_ManCleanMark0(pAig);
if ( RetValue == 1 ) if ( RetValue == 1 )
printf( "CEX holds for the transformed model.\n" ); printf( "Shortened CEX holds for the abstraction of the fast-forwarded model.\n" );
else else
printf( "CEX does not hold for the transformed model.\n" ); printf( "Shortened CEX does not hold for the abstraction of the fast-forwarded model.\n" );
} }
/**Function************************************************************* /**Function*************************************************************
...@@ -376,7 +376,8 @@ Gia_Man_t * Gia_ManTransformFlops( Gia_Man_t * p, Vec_Int_t * vFlops, Vec_Int_t ...@@ -376,7 +376,8 @@ Gia_Man_t * Gia_ManTransformFlops( Gia_Man_t * p, Vec_Int_t * vFlops, Vec_Int_t
int Gia_ManNewRefine( Gia_Man_t * p, Abc_Cex_t * pCex, int iFrameStart, int iFrameExtra, int fVerbose ) int Gia_ManNewRefine( Gia_Man_t * p, Abc_Cex_t * pCex, int iFrameStart, int iFrameExtra, int fVerbose )
{ {
Gia_Man_t * pAbs, * pNew; Gia_Man_t * pAbs, * pNew;
Vec_Int_t * vPis, * vPPis, * vFlops, * vInit; Vec_Int_t * vFlops, * vInit;
Vec_Int_t * vCopy;
clock_t clk = clock(); clock_t clk = clock();
int RetValue; int RetValue;
ABC_FREE( p->pCexSeq ); ABC_FREE( p->pCexSeq );
...@@ -385,6 +386,7 @@ int Gia_ManNewRefine( Gia_Man_t * p, Abc_Cex_t * pCex, int iFrameStart, int iFra ...@@ -385,6 +386,7 @@ int Gia_ManNewRefine( Gia_Man_t * p, Abc_Cex_t * pCex, int iFrameStart, int iFra
Abc_Print( 1, "Gia_ManNewRefine(): Abstraction gate map is missing.\n" ); Abc_Print( 1, "Gia_ManNewRefine(): Abstraction gate map is missing.\n" );
return -1; return -1;
} }
vCopy = Vec_IntDup( p->vGateClasses );
Abc_Print( 1, "Refining with %d-frame CEX, starting in frame %d, with %d extra frames.\n", pCex->iFrame, iFrameStart, iFrameExtra ); Abc_Print( 1, "Refining with %d-frame CEX, starting in frame %d, with %d extra frames.\n", pCex->iFrame, iFrameStart, iFrameExtra );
// derive abstraction // derive abstraction
pAbs = Gia_ManDupAbsGates( p, p->vGateClasses ); pAbs = Gia_ManDupAbsGates( p, p->vGateClasses );
...@@ -394,6 +396,7 @@ int Gia_ManNewRefine( Gia_Man_t * p, Abc_Cex_t * pCex, int iFrameStart, int iFra ...@@ -394,6 +396,7 @@ int Gia_ManNewRefine( Gia_Man_t * p, Abc_Cex_t * pCex, int iFrameStart, int iFra
{ {
Abc_Print( 1, "Gia_ManNewRefine(): The PI counts in GLA and in CEX do not match.\n" ); Abc_Print( 1, "Gia_ManNewRefine(): The PI counts in GLA and in CEX do not match.\n" );
Gia_ManStop( pAbs ); Gia_ManStop( pAbs );
Vec_IntFree( vCopy );
return -1; return -1;
} }
// get the state in frame iFrameStart // get the state in frame iFrameStart
...@@ -402,30 +405,27 @@ int Gia_ManNewRefine( Gia_Man_t * p, Abc_Cex_t * pCex, int iFrameStart, int iFra ...@@ -402,30 +405,27 @@ int Gia_ManNewRefine( Gia_Man_t * p, Abc_Cex_t * pCex, int iFrameStart, int iFra
{ {
Abc_Print( 1, "Gia_ManNewRefine(): The initial counter-example is invalid.\n" ); Abc_Print( 1, "Gia_ManNewRefine(): The initial counter-example is invalid.\n" );
Gia_ManStop( pAbs ); Gia_ManStop( pAbs );
Vec_IntFree( vCopy );
return -1; return -1;
} }
if ( fVerbose ) if ( fVerbose )
Abc_Print( 1, "Gia_ManNewRefine(): The initial counter-example is correct.\n" ); Abc_Print( 1, "Gia_ManNewRefine(): The initial counter-example is correct.\n" );
// get inputs // get inputs
Gia_ManGlaCollect( p, p->vGateClasses, &vPis, &vPPis, &vFlops, NULL ); Gia_ManGlaCollect( p, p->vGateClasses, NULL, NULL, &vFlops, NULL );
assert( Vec_IntSize(vPis) + Vec_IntSize(vPPis) == Gia_ManPiNum(pAbs) ); assert( Vec_IntSize(vPis) + Vec_IntSize(vPPis) == Gia_ManPiNum(pAbs) );
Gia_ManStop( pAbs ); Gia_ManStop( pAbs );
//Vec_IntPrint( vFlops ); //Vec_IntPrint( vFlops );
//Vec_IntPrint( vInit ); //Vec_IntPrint( vInit );
// transform the manager to have new init state // transform the manager to have new init state
pNew = Gia_ManTransformFlops( p, vFlops, vInit ); pNew = Gia_ManTransformFlops( p, vFlops, vInit );
Vec_IntFree( vPis );
Vec_IntFree( vPPis );
Vec_IntFree( vFlops ); Vec_IntFree( vFlops );
Vec_IntFree( vInit ); Vec_IntFree( vInit );
// verify abstraction // verify abstraction
/*
{ {
Gia_Man_t * pAbs = Gia_ManDupAbsGates( pNew, p->vGateClasses ); Gia_Man_t * pAbs = Gia_ManDupAbsGates( pNew, p->vGateClasses );
Gia_ManCheckCex( pAbs, pCex, iFrameStart ); Gia_ManCheckCex( pAbs, pCex, iFrameStart );
Gia_ManStop( pAbs ); Gia_ManStop( pAbs );
} }
*/
// transfer abstraction // transfer abstraction
assert( pNew->vGateClasses == NULL ); assert( pNew->vGateClasses == NULL );
pNew->vGateClasses = Vec_IntDup( p->vGateClasses ); pNew->vGateClasses = Vec_IntDup( p->vGateClasses );
...@@ -436,6 +436,11 @@ int Gia_ManNewRefine( Gia_Man_t * p, Abc_Cex_t * pCex, int iFrameStart, int iFra ...@@ -436,6 +436,11 @@ int Gia_ManNewRefine( Gia_Man_t * p, Abc_Cex_t * pCex, int iFrameStart, int iFra
pPars->nFramesMax = pCex->iFrame - iFrameStart + 1 + iFrameExtra; pPars->nFramesMax = pCex->iFrame - iFrameStart + 1 + iFrameExtra;
pPars->fVerbose = fVerbose; pPars->fVerbose = fVerbose;
RetValue = Ga2_ManPerform( pNew, pPars ); RetValue = Ga2_ManPerform( pNew, pPars );
if ( RetValue == 0 ) // spurious SAT
{
Vec_IntFreeP( &pNew->vGateClasses );
pNew->vGateClasses = Vec_IntDup( vCopy );
}
} }
// move the abstraction map // move the abstraction map
Vec_IntFreeP( &p->vGateClasses ); Vec_IntFreeP( &p->vGateClasses );
...@@ -443,6 +448,7 @@ int Gia_ManNewRefine( Gia_Man_t * p, Abc_Cex_t * pCex, int iFrameStart, int iFra ...@@ -443,6 +448,7 @@ int Gia_ManNewRefine( Gia_Man_t * p, Abc_Cex_t * pCex, int iFrameStart, int iFra
pNew->vGateClasses = NULL; pNew->vGateClasses = NULL;
// cleanup // cleanup
Gia_ManStop( pNew ); Gia_ManStop( pNew );
Vec_IntFree( vCopy );
return -1; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment