mirror of https://github.com/YosysHQ/yosys.git
Made MiniSat solver backend configurable in ezminisat.h
This commit is contained in:
parent
8b508dc90b
commit
1ec01d8c63
|
@ -29,6 +29,7 @@
|
||||||
#include <cinttypes>
|
#include <cinttypes>
|
||||||
|
|
||||||
#include <minisat/core/Solver.h>
|
#include <minisat/core/Solver.h>
|
||||||
|
#include <minisat/simp/SimpSolver.h>
|
||||||
|
|
||||||
ezMiniSAT::ezMiniSAT() : minisatSolver(NULL)
|
ezMiniSAT::ezMiniSAT() : minisatSolver(NULL)
|
||||||
{
|
{
|
||||||
|
@ -90,8 +91,10 @@ contradiction:
|
||||||
for (auto id : modelExpressions)
|
for (auto id : modelExpressions)
|
||||||
modelIdx.push_back(bind(id));
|
modelIdx.push_back(bind(id));
|
||||||
|
|
||||||
if (minisatSolver == NULL)
|
if (minisatSolver == NULL) {
|
||||||
minisatSolver = new Minisat::Solver;
|
minisatSolver = new EZMINISAT_SOLVER;
|
||||||
|
minisatSolver->verbosity = EZMINISAT_VERBOSITY;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<std::vector<int>> cnf;
|
std::vector<std::vector<int>> cnf;
|
||||||
consumeCnf(cnf);
|
consumeCnf(cnf);
|
||||||
|
|
|
@ -20,6 +20,9 @@
|
||||||
#ifndef EZMINISAT_H
|
#ifndef EZMINISAT_H
|
||||||
#define EZMINISAT_H
|
#define EZMINISAT_H
|
||||||
|
|
||||||
|
#define EZMINISAT_SOLVER Minisat::Solver
|
||||||
|
#define EZMINISAT_VERBOSITY 0
|
||||||
|
|
||||||
#include "ezsat.h"
|
#include "ezsat.h"
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
@ -28,12 +31,13 @@
|
||||||
// don't force ezSAT users to use minisat headers..
|
// don't force ezSAT users to use minisat headers..
|
||||||
namespace Minisat {
|
namespace Minisat {
|
||||||
class Solver;
|
class Solver;
|
||||||
|
class SimpSolver;
|
||||||
}
|
}
|
||||||
|
|
||||||
class ezMiniSAT : public ezSAT
|
class ezMiniSAT : public ezSAT
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
Minisat::Solver *minisatSolver;
|
EZMINISAT_SOLVER *minisatSolver;
|
||||||
std::vector<int> minisatVars;
|
std::vector<int> minisatVars;
|
||||||
bool foundContradiction;
|
bool foundContradiction;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue