mirror of https://github.com/YosysHQ/abc.git
working on incremental pdr
This commit is contained in:
parent
fdc0b471e5
commit
fc0f3b8d0d
|
|
@ -527,7 +527,6 @@ int IPdr_ManSolve( Aig_Man_t * pAig, Pdr_Par_t * pPars )
|
||||||
{
|
{
|
||||||
Pdr_Man_t * p;
|
Pdr_Man_t * p;
|
||||||
int k, RetValue;
|
int k, RetValue;
|
||||||
int i, nRegs;
|
|
||||||
Vec_Vec_t * vClausesSaved;
|
Vec_Vec_t * vClausesSaved;
|
||||||
|
|
||||||
abctime clk = Abc_Clock();
|
abctime clk = Abc_Clock();
|
||||||
|
|
@ -549,46 +548,49 @@ int IPdr_ManSolve( Aig_Man_t * pAig, Pdr_Par_t * pPars )
|
||||||
pPars->fSolveAll ? "yes" : "no" );
|
pPars->fSolveAll ? "yes" : "no" );
|
||||||
}
|
}
|
||||||
ABC_FREE( pAig->pSeqModel );
|
ABC_FREE( pAig->pSeqModel );
|
||||||
|
|
||||||
|
|
||||||
p = Pdr_ManStart( pAig, pPars, NULL );
|
p = Pdr_ManStart( pAig, pPars, NULL );
|
||||||
RetValue = IPdr_ManSolveInt( p );
|
while ( 1 ) {
|
||||||
if ( RetValue == 0 )
|
RetValue = IPdr_ManSolveInt( p );
|
||||||
assert( pAig->pSeqModel != NULL || p->vCexes != NULL );
|
|
||||||
if ( p->vCexes )
|
|
||||||
{
|
|
||||||
assert( p->pAig->vSeqModelVec == NULL );
|
|
||||||
p->pAig->vSeqModelVec = p->vCexes;
|
|
||||||
p->vCexes = NULL;
|
|
||||||
}
|
|
||||||
if ( p->pPars->fDumpInv )
|
|
||||||
{
|
|
||||||
char * pFileName = Extra_FileNameGenericAppend(p->pAig->pName, "_inv.pla");
|
|
||||||
Abc_FrameSetInv( Pdr_ManDeriveInfinityClauses( p, RetValue!=1 ) );
|
|
||||||
Pdr_ManDumpClauses( p, pFileName, RetValue==1 );
|
|
||||||
}
|
|
||||||
else if ( RetValue == 1 )
|
|
||||||
Abc_FrameSetInv( Pdr_ManDeriveInfinityClauses( p, RetValue!=1 ) );
|
|
||||||
p->tTotal += Abc_Clock() - clk;
|
|
||||||
|
|
||||||
if (pPars->iFrame == pPars->nFrameMax)
|
if ( RetValue == -1 && pPars->iFrame == pPars->nFrameMax) {
|
||||||
{
|
vClausesSaved = IPdr_ManSaveClauses( p );
|
||||||
vClausesSaved = IPdr_ManSaveClauses(p);
|
|
||||||
nRegs = Aig_ManRegNum(p->pAig);
|
|
||||||
|
|
||||||
|
Pdr_ManStop( p );
|
||||||
|
|
||||||
|
p = Pdr_ManStart( pAig, pPars, NULL );
|
||||||
|
IPdr_ManRestore( p, vClausesSaved );
|
||||||
|
|
||||||
|
pPars->nFrameMax = pPars->nFrameMax << 1;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( RetValue == 0 )
|
||||||
|
assert( pAig->pSeqModel != NULL || p->vCexes != NULL );
|
||||||
|
if ( p->vCexes )
|
||||||
|
{
|
||||||
|
assert( p->pAig->vSeqModelVec == NULL );
|
||||||
|
p->pAig->vSeqModelVec = p->vCexes;
|
||||||
|
p->vCexes = NULL;
|
||||||
|
}
|
||||||
|
if ( p->pPars->fDumpInv )
|
||||||
|
{
|
||||||
|
char * pFileName = Extra_FileNameGenericAppend(p->pAig->pName, "_inv.pla");
|
||||||
|
Abc_FrameSetInv( Pdr_ManDeriveInfinityClauses( p, RetValue!=1 ) );
|
||||||
|
Pdr_ManDumpClauses( p, pFileName, RetValue==1 );
|
||||||
|
}
|
||||||
|
else if ( RetValue == 1 )
|
||||||
|
Abc_FrameSetInv( Pdr_ManDeriveInfinityClauses( p, RetValue!=1 ) );
|
||||||
|
|
||||||
|
p->tTotal += Abc_Clock() - clk;
|
||||||
Pdr_ManStop( p );
|
Pdr_ManStop( p );
|
||||||
|
|
||||||
printf("PDR reached the max frame: %d\n", pPars->iFrame);
|
break;
|
||||||
IPdr_ManPrintClauses(vClausesSaved, 0, nRegs);
|
|
||||||
|
|
||||||
p = Pdr_ManStart( pAig, pPars, NULL );
|
|
||||||
IPdr_ManRestore( p, vClausesSaved );
|
|
||||||
|
|
||||||
// Solve again
|
|
||||||
pPars->nFrameMax = pPars->nFrameMax + 1;
|
|
||||||
RetValue = IPdr_ManSolveInt(p);
|
|
||||||
IPdr_ManPrintClauses(p->vClauses, 0, nRegs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Pdr_ManStop( p );
|
|
||||||
pPars->iFrame--;
|
pPars->iFrame--;
|
||||||
// convert all -2 (unknown) entries into -1 (undec)
|
// convert all -2 (unknown) entries into -1 (undec)
|
||||||
if ( pPars->vOutMap )
|
if ( pPars->vOutMap )
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue