3
0
Fork 0
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:
Gabriel Gouvine 2024-03-28 10:14:30 +00:00
parent c807ef44dc
commit 316ec3b0b4

View file

@ -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());
@ -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
}