mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-08 04:01:25 +00:00
ezsat: Fix build for emscripten/wasi
This commit is contained in:
parent
c807ef44dc
commit
316ec3b0b4
1 changed files with 4 additions and 0 deletions
|
@ -9,6 +9,7 @@ ezSATCommand::~ezSATCommand() {}
|
||||||
|
|
||||||
bool ezSATCommand::solver(const std::vector<int> &modelExpressions, std::vector<bool> &modelValues, const std::vector<int> &assumptions)
|
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 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 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());
|
const std::string sat_command = Yosys::stringf("%s %s", command.c_str(), cnf_filename.c_str());
|
||||||
|
@ -81,4 +82,7 @@ bool ezSATCommand::solver(const std::vector<int> &modelExpressions, std::vector<
|
||||||
modelValues[i] = (values.at(idx - 1) == refvalue);
|
modelValues[i] = (values.at(idx - 1) == refvalue);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
#else
|
||||||
|
Yosys::log_error("SAT solver command not available in this build!\n");
|
||||||
|
#endif
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue