Commit ca9803fc by Alan Mishchenko

Scalable gate-level abstraction.

parent 94949287
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "gia.h" #include "gia.h"
#include "giaAbsRef.h" #include "giaAbsRef.h"
#include "giaAbsRef2.h"
#include "sat/cnf/cnf.h" #include "sat/cnf/cnf.h"
#include "sat/bsat/satSolver2.h" #include "sat/bsat/satSolver2.h"
#include "base/main/main.h" #include "base/main/main.h"
...@@ -51,6 +52,7 @@ struct Ga2_Man_t_ ...@@ -51,6 +52,7 @@ struct Ga2_Man_t_
int nMarked; // total number of marked nodes and flops int nMarked; // total number of marked nodes and flops
// refinement // refinement
Rnm_Man_t * pRnm; // refinement manager Rnm_Man_t * pRnm; // refinement manager
Rf2_Man_t * pRf2; // refinement manager
// SAT solver and variables // SAT solver and variables
Vec_Ptr_t * vId2Lit; // mapping, for each timeframe, of object ID into SAT literal Vec_Ptr_t * vId2Lit; // mapping, for each timeframe, of object ID into SAT literal
sat_solver2 * pSat; // incremental SAT solver sat_solver2 * pSat; // incremental SAT solver
...@@ -333,6 +335,7 @@ int Ga2_ManMarkup( Gia_Man_t * p, int N, int fSimple ) ...@@ -333,6 +335,7 @@ int Ga2_ManMarkup( Gia_Man_t * p, int N, int fSimple )
} }
// Abc_PrintTime( 1, "Time", clock() - clk ); // Abc_PrintTime( 1, "Time", clock() - clk );
Vec_IntFree( vLeaves ); Vec_IntFree( vLeaves );
Gia_ManCleanValue( p );
return CountMarks; return CountMarks;
} }
void Ga2_ManComputeTest( Gia_Man_t * p ) void Ga2_ManComputeTest( Gia_Man_t * p )
...@@ -393,6 +396,7 @@ Ga2_Man_t * Ga2_ManStart( Gia_Man_t * pGia, Gia_ParVta_t * pPars ) ...@@ -393,6 +396,7 @@ Ga2_Man_t * Ga2_ManStart( Gia_Man_t * pGia, Gia_ParVta_t * pPars )
Vec_IntPush( p->vAbs, 0 ); Vec_IntPush( p->vAbs, 0 );
// refinement // refinement
p->pRnm = Rnm_ManStart( pGia ); p->pRnm = Rnm_ManStart( pGia );
// p->pRf2 = Rf2_ManStart( pGia );
// SAT solver and variables // SAT solver and variables
p->vId2Lit = Vec_PtrAlloc( 1000 ); p->vId2Lit = Vec_PtrAlloc( 1000 );
// temporaries // temporaries
...@@ -455,6 +459,7 @@ void Ga2_ManStop( Ga2_Man_t * p ) ...@@ -455,6 +459,7 @@ void Ga2_ManStop( Ga2_Man_t * p )
Vec_IntFree( p->vLits ); Vec_IntFree( p->vLits );
Vec_IntFree( p->vIsopMem ); Vec_IntFree( p->vIsopMem );
Rnm_ManStop( p->pRnm, p->pPars->fVerbose ); Rnm_ManStop( p->pRnm, p->pPars->fVerbose );
// Rf2_ManStop( p->pRf2, p->pPars->fVerbose );
ABC_FREE( p->pTable ); ABC_FREE( p->pTable );
ABC_FREE( p->pSopSizes ); ABC_FREE( p->pSopSizes );
ABC_FREE( p->pSops[1] ); ABC_FREE( p->pSops[1] );
...@@ -1222,6 +1227,7 @@ Vec_Int_t * Ga2_ManRefine( Ga2_Man_t * p ) ...@@ -1222,6 +1227,7 @@ Vec_Int_t * Ga2_ManRefine( Ga2_Man_t * p )
int i; int i;
Ga2_GlaPrepareCexAndMap( p, &pCex, &vMap ); Ga2_GlaPrepareCexAndMap( p, &pCex, &vMap );
vVec = Rnm_ManRefine( p->pRnm, pCex, vMap, p->pPars->fPropFanout, 1 ); vVec = Rnm_ManRefine( p->pRnm, pCex, vMap, p->pPars->fPropFanout, 1 );
// Rf2_ManRefine( p->pRf2, pCex, vMap, p->pPars->fPropFanout, 1 );
Abc_CexFree( pCex ); Abc_CexFree( pCex );
if ( Vec_IntSize(vVec) == 0 ) if ( Vec_IntSize(vVec) == 0 )
{ {
...@@ -1351,6 +1357,7 @@ void Gia_Ga2SendAbsracted( Ga2_Man_t * p, int fVerbose ) ...@@ -1351,6 +1357,7 @@ void Gia_Ga2SendAbsracted( Ga2_Man_t * p, int fVerbose )
vGateClasses = Ga2_ManAbsTranslate( p ); vGateClasses = Ga2_ManAbsTranslate( p );
pAbs = Gia_ManDupAbsGates( p->pGia, vGateClasses ); pAbs = Gia_ManDupAbsGates( p->pGia, vGateClasses );
Vec_IntFreeP( &vGateClasses ); Vec_IntFreeP( &vGateClasses );
Gia_ManCleanValue( p->pGia );
// send it out // send it out
Gia_ManToBridgeAbsNetlist( stdout, pAbs ); Gia_ManToBridgeAbsNetlist( stdout, pAbs );
Gia_ManStop( pAbs ); Gia_ManStop( pAbs );
......
...@@ -497,6 +497,8 @@ void Rnm_ManVerifyUsingTerSim( Gia_Man_t * p, Abc_Cex_t * pCex, Vec_Int_t * vMap ...@@ -497,6 +497,8 @@ void Rnm_ManVerifyUsingTerSim( Gia_Man_t * p, Abc_Cex_t * pCex, Vec_Int_t * vMap
Gia_ObjTerSimRo( p, pObj ); Gia_ObjTerSimRo( p, pObj );
} }
} }
Gia_ManForEachObjVec( vMap, p, pObj, i )
pObj->Value = 0;
pObj = Gia_ManPo( p, 0 ); pObj = Gia_ManPo( p, 0 );
if ( !Gia_ObjTerSimGet1(pObj) ) if ( !Gia_ObjTerSimGet1(pObj) )
Abc_Print( 1, "\nRefinement verification has failed!!!\n" ); Abc_Print( 1, "\nRefinement verification has failed!!!\n" );
......
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