diff --git a/kernel/satgen.cc b/kernel/satgen.cc index b8b850bb3..7fbcba1b2 100644 --- a/kernel/satgen.cc +++ b/kernel/satgen.cc @@ -19,6 +19,7 @@ #include "kernel/satgen.h" #include "kernel/ff.h" +#include "kernel/yosys_common.h" USING_YOSYS_NAMESPACE @@ -1387,3 +1388,22 @@ bool SatGen::importCell(RTLIL::Cell *cell, int timestep) // .. and all sequential cells with asynchronous inputs return false; } + +namespace Yosys { + +void report_missing_model(bool warn_only, RTLIL::Cell* cell) +{ + std::string s; + if (cell->is_builtin_ff()) + s = stringf("No SAT model available for async FF cell %s (%s). Consider running `async2sync` or `clk2fflogic` first.\n", log_id(cell), log_id(cell->type)); + else + s = stringf("No SAT model available for cell %s (%s).\n", log_id(cell), log_id(cell->type)); + + if (warn_only) { + log_formatted_warning_noprefix(s); + } else { + log_formatted_error(s); + } +} + +} diff --git a/kernel/satgen.h b/kernel/satgen.h index 7815847b3..9ad940585 100644 --- a/kernel/satgen.h +++ b/kernel/satgen.h @@ -292,6 +292,8 @@ struct SatGen bool importCell(RTLIL::Cell *cell, int timestep = -1); }; +void report_missing_model(bool warn_only, RTLIL::Cell* cell); + YOSYS_NAMESPACE_END #endif diff --git a/passes/equiv/equiv.h b/passes/equiv/equiv.h index 9641e65a7..95d4b25e9 100644 --- a/passes/equiv/equiv.h +++ b/passes/equiv/equiv.h @@ -8,21 +8,6 @@ YOSYS_NAMESPACE_BEGIN -static void report_missing_model(bool warn_only, RTLIL::Cell* cell) -{ - std::string s; - if (cell->is_builtin_ff()) - s = stringf("No SAT model available for async FF cell %s (%s). Consider running `async2sync` or `clk2fflogic` first.\n", log_id(cell), log_id(cell->type)); - else - s = stringf("No SAT model available for cell %s (%s).\n", log_id(cell), log_id(cell->type)); - - if (warn_only) { - log_formatted_warning_noprefix(s); - } else { - log_formatted_error(s); - } -} - struct EquivBasicConfig { bool model_undef = false; int max_seq = 1; diff --git a/passes/sat/sat.cc b/passes/sat/sat.cc index c143e938e..203147172 100644 --- a/passes/sat/sat.cc +++ b/passes/sat/sat.cc @@ -27,7 +27,6 @@ #include "kernel/satgen.h" #include "kernel/yosys.h" #include "kernel/log_help.h" -#include "passes/equiv/equiv.h" USING_YOSYS_NAMESPACE PRIVATE_NAMESPACE_BEGIN