Skip to content

Commit

Permalink
ezsat: Fix build for emscripten/wasi
Browse files Browse the repository at this point in the history
  • Loading branch information
Coloquinte committed Mar 28, 2024
1 parent 933a8d6 commit 0fe82c5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libs/ezsat/ezcommand.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ezSATCommand::~ezSATCommand() {}

bool ezSATCommand::solver(const std::vector<int> &modelExpressions, std::vector<bool> &modelValues, const std::vector<int> &assumptions)
{
#if !defined(YOSYS_DISABLE_SPAWN)
const std::string tempdir_name = Yosys::make_temp_dir(Yosys::get_base_tmpdir() + "/yosys-sat-XXXXXX");
const std::string cnf_filename = Yosys::stringf("%s/problem.cnf", tempdir_name.c_str());
const std::string sat_command = Yosys::stringf("%s %s", command.c_str(), cnf_filename.c_str());
Expand Down Expand Up @@ -81,4 +82,7 @@ bool ezSATCommand::solver(const std::vector<int> &modelExpressions, std::vector<
modelValues[i] = (values.at(idx - 1) == refvalue);
}
return true;
#else
Yosys::log_error("SAT solver command not available in this build!\n");
#endif
}

0 comments on commit 0fe82c5

Please sign in to comment.