mirror of
https://github.com/YosysHQ/yosys
synced 2025-10-01 13:39:30 +00:00
verific: New -sva-continue-on-error
import option
This option allows you to process a design that includes unsupported SVA. Unsupported SVA gets imported as formal cells using 'x inputs and with the `unsupported_sva` attribute set. This allows you to get a complete list of defined properties or to check only a supported subset of properties. To ensure no properties are unintentionally skipped for actual verification, even in cases where `-sva-continue-on-error` is used by default to read and inspect a design, `hierarchy -simcheck` and `hierarchy -smtcheck` (run by SBY) now ensure that no `unsupported_sva` property cells remain in the design.
This commit is contained in:
parent
99a23c777c
commit
83dd99efb7
6 changed files with 124 additions and 25 deletions
|
@ -200,8 +200,8 @@ YosysStreamCallBackHandler verific_read_cb;
|
|||
|
||||
// ==================================================================
|
||||
|
||||
VerificImporter::VerificImporter(bool mode_gates, bool mode_keep, bool mode_nosva, bool mode_names, bool mode_verific, bool mode_autocover, bool mode_fullinit) :
|
||||
mode_gates(mode_gates), mode_keep(mode_keep), mode_nosva(mode_nosva),
|
||||
VerificImporter::VerificImporter(bool mode_gates, bool mode_keep, bool mode_nosva, bool mode_sva_continue, bool mode_names, bool mode_verific, bool mode_autocover, bool mode_fullinit) :
|
||||
mode_gates(mode_gates), mode_keep(mode_keep), mode_nosva(mode_nosva), mode_sva_continue(mode_sva_continue),
|
||||
mode_names(mode_names), mode_verific(mode_verific), mode_autocover(mode_autocover),
|
||||
mode_fullinit(mode_fullinit)
|
||||
{
|
||||
|
@ -2316,6 +2316,12 @@ void VerificImporter::import_netlist(RTLIL::Design *design, Netlist *nl, std::ma
|
|||
wire->attributes.erase(ID::init);
|
||||
}
|
||||
}
|
||||
|
||||
if (num_sva_continue) {
|
||||
log_warning("Encountered %d items containing unsupported SVA!\n", num_sva_continue);
|
||||
log_warning("Unsupported SVA imported as 'x and marked using the `unsupported_sva' attribute due to -sva-continue-on-err.\n");
|
||||
}
|
||||
num_sva_continue = 0;
|
||||
}
|
||||
|
||||
// ==================================================================
|
||||
|
@ -3051,7 +3057,7 @@ std::string verific_import(Design *design, const std::map<std::string,std::strin
|
|||
auto it = nl_todo.begin();
|
||||
Netlist *nl = it->second;
|
||||
if (nl_done.count(it->first) == 0) {
|
||||
VerificImporter importer(false, false, false, false, false, false, false);
|
||||
VerificImporter importer(false, false, false, false, false, false, false, false);
|
||||
nl_done[it->first] = it->second;
|
||||
importer.import_netlist(design, nl, nl_todo, top_mod_names.count(nl->CellBaseName()));
|
||||
}
|
||||
|
@ -3288,6 +3294,11 @@ struct VerificPass : public Pass {
|
|||
log(" -nosva\n");
|
||||
log(" Ignore SVA properties, do not infer checker logic.\n");
|
||||
log("\n");
|
||||
log(" -sva-continue-on-err\n");
|
||||
log(" Turns unsupported SVA from an error into a warning. Properties are imported\n");
|
||||
log(" with their trigger condition replaced with 'x and with an `unsupported_sva'\n");
|
||||
log(" attribute to produce a later error in SBY if they remain in the design.\n");
|
||||
log("\n");
|
||||
log(" -L <int>\n");
|
||||
log(" Maximum number of ctrl bits for SVA checker FSMs (default=16).\n");
|
||||
log("\n");
|
||||
|
@ -4033,7 +4044,8 @@ struct VerificPass : public Pass {
|
|||
{
|
||||
std::map<std::string,Netlist*> nl_todo, nl_done;
|
||||
bool mode_all = false, mode_gates = false, mode_keep = false;
|
||||
bool mode_nosva = false, mode_names = false, mode_verific = false;
|
||||
bool mode_nosva = false, mode_sva_continue = false;
|
||||
bool mode_names = false, mode_verific = false;
|
||||
bool mode_autocover = false, mode_fullinit = false;
|
||||
bool flatten = false, extnets = false, mode_cells = false;
|
||||
bool split_complex_ports = true;
|
||||
|
@ -4071,6 +4083,10 @@ struct VerificPass : public Pass {
|
|||
mode_nosva = true;
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-sva-continue-on-err") {
|
||||
mode_sva_continue = true;
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-L" && argidx+1 < GetSize(args)) {
|
||||
verific_sva_fsm_limit = atoi(args[++argidx].c_str());
|
||||
continue;
|
||||
|
@ -4201,7 +4217,7 @@ struct VerificPass : public Pass {
|
|||
auto it = nl_todo.begin();
|
||||
Netlist *nl = it->second;
|
||||
if (nl_done.count(it->first) == 0) {
|
||||
VerificImporter importer(mode_gates, mode_keep, mode_nosva,
|
||||
VerificImporter importer(mode_gates, mode_keep, mode_nosva, mode_sva_continue,
|
||||
mode_names, mode_verific, mode_autocover, mode_fullinit);
|
||||
nl_done[it->first] = it->second;
|
||||
importer.import_netlist(design, nl, nl_todo, top_mod_names.count(nl->CellBaseName()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue