mirror of https://github.com/YosysHQ/abc.git
User-controlable SAT sweeper.
This commit is contained in:
parent
b1c0b338a0
commit
6e65cd1431
|
|
@ -68,12 +68,12 @@ struct Swp_Man_t_
|
||||||
Vec_Int_t * vCondProbes; // conditions as probes
|
Vec_Int_t * vCondProbes; // conditions as probes
|
||||||
Vec_Int_t * vCondLits; // conditions as literals
|
Vec_Int_t * vCondLits; // conditions as literals
|
||||||
// equivalence checking
|
// equivalence checking
|
||||||
|
sat_solver * pSat; // SAT solver
|
||||||
Vec_Int_t * vId2Lit; // mapping of Obj IDs into SAT literal
|
Vec_Int_t * vId2Lit; // mapping of Obj IDs into SAT literal
|
||||||
Vec_Int_t * vFront; // temporary frontier
|
Vec_Int_t * vFront; // temporary frontier
|
||||||
Vec_Int_t * vFanins; // temporary fanins
|
Vec_Int_t * vFanins; // temporary fanins
|
||||||
Vec_Int_t * vCexSwp; // sweeper counter-example
|
Vec_Int_t * vCexSwp; // sweeper counter-example
|
||||||
Vec_Int_t * vCexUser; // user-visible counter-example
|
Vec_Int_t * vCexUser; // user-visible counter-example
|
||||||
sat_solver * pSat; // SAT solver
|
|
||||||
int nSatVars; // counter of SAT variables
|
int nSatVars; // counter of SAT variables
|
||||||
// statistics
|
// statistics
|
||||||
int nSatCalls;
|
int nSatCalls;
|
||||||
|
|
@ -124,7 +124,8 @@ static inline Swp_Man_t * Swp_ManStart( Gia_Man_t * pGia )
|
||||||
p->vCexSwp = Vec_IntAlloc( 100 );
|
p->vCexSwp = Vec_IntAlloc( 100 );
|
||||||
p->pSat = sat_solver_new();
|
p->pSat = sat_solver_new();
|
||||||
p->nSatVars = 1;
|
p->nSatVars = 1;
|
||||||
Swp_ManSetObj2Lit( p, 0, (Lit = Abc_Var2Lit(p->nSatVars++, 1)) );
|
Swp_ManSetObj2Lit( p, 0, (Lit = Abc_Var2Lit(p->nSatVars++, 0)) );
|
||||||
|
Lit = Abc_LitNot(Lit);
|
||||||
sat_solver_addclause( p->pSat, &Lit, &Lit + 1 );
|
sat_solver_addclause( p->pSat, &Lit, &Lit + 1 );
|
||||||
pGia->pData = p;
|
pGia->pData = p;
|
||||||
return p;
|
return p;
|
||||||
|
|
@ -310,9 +311,13 @@ Gia_Man_t * Gia_SweeperExtractUserLogic( Gia_Man_t * p, Vec_Int_t * vProbeIds, V
|
||||||
Gia_ManConst0(p)->Value = 0;
|
Gia_ManConst0(p)->Value = 0;
|
||||||
Gia_ManForEachPi( p, pObj, i )
|
Gia_ManForEachPi( p, pObj, i )
|
||||||
pObj->Value = Gia_ManAppendCi(pNew);
|
pObj->Value = Gia_ManAppendCi(pNew);
|
||||||
|
// create internal nodes
|
||||||
|
Gia_ManHashStart( pNew );
|
||||||
Gia_ManForEachObjVec( vObjIds, p, pObj, i )
|
Gia_ManForEachObjVec( vObjIds, p, pObj, i )
|
||||||
pObj->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
|
pObj->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
|
||||||
|
Gia_ManHashStop( pNew );
|
||||||
Vec_IntFree( vObjIds );
|
Vec_IntFree( vObjIds );
|
||||||
|
// create outputs
|
||||||
Vec_IntForEachEntry( vProbeIds, ProbeId, i )
|
Vec_IntForEachEntry( vProbeIds, ProbeId, i )
|
||||||
{
|
{
|
||||||
pObj = Gia_Lit2Obj( p, Gia_SweeperProbeLit(p, ProbeId) );
|
pObj = Gia_Lit2Obj( p, Gia_SweeperProbeLit(p, ProbeId) );
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue