Commit d22b3d05 by Alan Mishchenko

Fixing problem with max limit on the number of abstracted objects in &gla.

parent 65b652fa
...@@ -1417,10 +1417,10 @@ int Ga2_ManPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars ) ...@@ -1417,10 +1417,10 @@ int Ga2_ManPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars )
if ( p->pPars->fVerbose ) if ( p->pPars->fVerbose )
{ {
Abc_Print( 1, "Running gate-level abstraction (GLA) with the following parameters:\n" ); Abc_Print( 1, "Running gate-level abstraction (GLA) with the following parameters:\n" );
Abc_Print( 1, "FrameMax = %d ConfMax = %d Timeout = %d RatioMin = %d %%.\n", Abc_Print( 1, "FrameMax = %d ConfMax = %d Timeout = %d RatioMin = %d %% RatioMax = %d %%\n",
pPars->nFramesMax, pPars->nConfLimit, pPars->nTimeOut, pPars->nRatioMin ); pPars->nFramesMax, pPars->nConfLimit, pPars->nTimeOut, pPars->nRatioMin, pPars->nRatioMax );
Abc_Print( 1, "LearnStart = %d LearnDelta = %d LearnRatio = %d %%.\n", Abc_Print( 1, "LrnStart = %d LrnDelta = %d LrnRatio = %d %% Skip = %d SimpleCNF = %d Dump = %d\n",
pPars->nLearnedStart, pPars->nLearnedDelta, pPars->nLearnedPerce ); pPars->nLearnedStart, pPars->nLearnedDelta, pPars->nLearnedPerce, pPars->fUseSkip, pPars->fUseSimple, pPars->fDumpVabs );
Abc_Print( 1, " Frame %% Abs PPI FF LUT Confl Cex Vars Clas Lrns Time Mem\n" ); Abc_Print( 1, " Frame %% Abs PPI FF LUT Confl Cex Vars Clas Lrns Time Mem\n" );
} }
// iterate unrolling // iterate unrolling
...@@ -1517,9 +1517,6 @@ int Ga2_ManPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars ) ...@@ -1517,9 +1517,6 @@ int Ga2_ManPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars )
Vec_IntFree( vPPis ); Vec_IntFree( vPPis );
if ( pPars->fVerbose ) if ( pPars->fVerbose )
Ga2_ManAbsPrintFrame( p, f, sat_solver2_nconflicts(p->pSat)-nConflsBeg, c+1, clock() - clk, 0 ); Ga2_ManAbsPrintFrame( p, f, sat_solver2_nconflicts(p->pSat)-nConflsBeg, c+1, clock() - clk, 0 );
// verify
// if ( Vec_IntCheckUnique(p->vAbs) )
// Abc_Print( 1, "Vector has %d duplicated entries.\n", Vec_IntCheckUnique(p->vAbs) );
continue; continue;
} }
p->timeUnsat += clock() - clk2; p->timeUnsat += clock() - clk2;
...@@ -1527,7 +1524,6 @@ int Ga2_ManPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars ) ...@@ -1527,7 +1524,6 @@ int Ga2_ManPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars )
goto finish; goto finish;
if ( p->pSat->nRuntimeLimit && clock() > p->pSat->nRuntimeLimit ) // timeout if ( p->pSat->nRuntimeLimit && clock() > p->pSat->nRuntimeLimit ) // timeout
goto finish; goto finish;
// assert( RetValue == l_False );
if ( c == 0 ) if ( c == 0 )
{ {
if ( p->pPars->nFramesNoChange >= 0 ) if ( p->pPars->nFramesNoChange >= 0 )
...@@ -1548,8 +1544,9 @@ int Ga2_ManPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars ) ...@@ -1548,8 +1544,9 @@ int Ga2_ManPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars )
// purify UNSAT core // purify UNSAT core
if ( fUseSecondCore ) if ( fUseSecondCore )
{ {
int nOldCore = Vec_IntSize(vCore); // int nOldCore = Vec_IntSize(vCore);
Vec_IntSort( vCore, 0 ); // reverse the order of objects in the core
// Vec_IntSort( vCore, 0 );
// Vec_IntPrint( vCore ); // Vec_IntPrint( vCore );
// create bookmark to be used for rollback // create bookmark to be used for rollback
assert( nVarsOld == p->pSat->size ); assert( nVarsOld == p->pSat->size );
...@@ -1565,8 +1562,6 @@ int Ga2_ManPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars ) ...@@ -1565,8 +1562,6 @@ int Ga2_ManPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars )
Ga2_ManAddToAbs( p, vCore ); Ga2_ManAddToAbs( p, vCore );
Vec_IntFree( vCore ); Vec_IntFree( vCore );
// if ( pPars->fVerbose )
// Ga2_ManAbsPrintFrame( p, f, sat_solver2_nconflicts(p->pSat)-nConflsBeg, c+1, clock() - clk, 0 );
} }
// run SAT solver // run SAT solver
clk2 = clock(); clk2 = clock();
...@@ -1587,18 +1582,23 @@ int Ga2_ManPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars ) ...@@ -1587,18 +1582,23 @@ int Ga2_ManPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars )
Ga2_ManAddToAbs( p, vCore ); Ga2_ManAddToAbs( p, vCore );
Vec_IntFree( vCore ); Vec_IntFree( vCore );
// verify
// if ( Vec_IntCheckUnique(p->vAbs) )
// Abc_Print( 1, "Vector has %d duplicated entries.\n", Vec_IntCheckUnique(p->vAbs) );
break; break;
} }
if ( pPars->fVerbose ) if ( pPars->fVerbose )
Ga2_ManAbsPrintFrame( p, f, sat_solver2_nconflicts(p->pSat)-nConflsBeg, c, clock() - clk, 1 ); Ga2_ManAbsPrintFrame( p, f, sat_solver2_nconflicts(p->pSat)-nConflsBeg, c, clock() - clk, 1 );
// set model
if ( c > 0 ) if ( c > 0 )
{ {
Vec_IntFreeP( &pAig->vGateClasses ); Vec_IntFreeP( &pAig->vGateClasses );
pAig->vGateClasses = Ga2_ManAbsTranslate( p ); pAig->vGateClasses = Ga2_ManAbsTranslate( p );
// check if the number of objects is below limit
if ( Vec_IntSize(p->vAbs) >= p->nMarked * (100 - pPars->nRatioMin) / 100 )
{
Status = l_Undef;
goto finish;
}
if ( Abc_FrameIsBridgeMode() ) if ( Abc_FrameIsBridgeMode() )
{ {
// cancel old one if it was sent // cancel old one if it was sent
...@@ -1634,13 +1634,6 @@ int Ga2_ManPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars ) ...@@ -1634,13 +1634,6 @@ int Ga2_ManPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars )
} }
} }
} }
// check if the number of objects is below limit
if ( Vec_IntSize(p->vAbs) >= p->nMarked * (100 - pPars->nRatioMin) / 100 )
{
Status = l_Undef;
break;
}
} }
finish: finish:
p->pPars->nFramesNoChange = Abc_MaxInt( p->pPars->nFramesNoChange, 0 ); p->pPars->nFramesNoChange = Abc_MaxInt( p->pPars->nFramesNoChange, 0 );
......
...@@ -157,7 +157,7 @@ void Gia_VtaSetDefaultParams( Gia_ParVta_t * p ) ...@@ -157,7 +157,7 @@ void Gia_VtaSetDefaultParams( Gia_ParVta_t * p )
p->nLearnedDelta = 200; // max number of learned clauses p->nLearnedDelta = 200; // max number of learned clauses
p->nLearnedPerce = 70; // max number of learned clauses p->nLearnedPerce = 70; // max number of learned clauses
p->nTimeOut = 0; // timeout in seconds p->nTimeOut = 0; // timeout in seconds
p->nRatioMin = 10; // stop when less than this % of object is abstracted p->nRatioMin = 20; // stop when less than this % of object is abstracted
p->nRatioMax = 30; // restart when more than this % of object is abstracted p->nRatioMax = 30; // restart when more than this % of object is abstracted
p->fUseTermVars = 0; // use terminal variables p->fUseTermVars = 0; // use terminal variables
p->fUseRollback = 0; // use rollback to the starting number of frames p->fUseRollback = 0; // use rollback to the starting number of frames
......
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