verific: Handle crash when using empty box option

This commit is contained in:
Miodrag Milanovic 2024-12-02 15:45:12 +01:00
parent 3c67d9f779
commit 912b38eedb
1 changed files with 4 additions and 2 deletions

View File

@ -1471,7 +1471,8 @@ void VerificImporter::import_netlist(RTLIL::Design *design, Netlist *nl, std::ma
FOREACH_PARAMETER_OF_NETLIST(nl, mi, param_name, param_value) {
module->avail_parameters(RTLIL::escape_id(param_name));
const TypeRange *tr = nl->GetTypeRange(param_name) ;
module->parameter_default_values[RTLIL::escape_id(param_name)] = verific_const(tr->GetTypeName(), param_value, nl);
const char* type_name = (tr) ? tr->GetTypeName() : nullptr;
module->parameter_default_values[RTLIL::escape_id(param_name)] = verific_const(type_name, param_value, nl);
}
SetIter si;
@ -2171,7 +2172,8 @@ void VerificImporter::import_netlist(RTLIL::Design *design, Netlist *nl, std::ma
if (is_blackbox(inst->View())) {
FOREACH_PARAMETER_OF_INST(inst, mi2, param_name, param_value) {
const TypeRange *tr = inst->View()->GetTypeRange(param_name) ;
cell->setParam(RTLIL::escape_id(param_name), verific_const(tr->GetTypeName(), param_value, inst->View()));
const char* type_name = (tr) ? tr->GetTypeName() : nullptr;
cell->setParam(RTLIL::escape_id(param_name), verific_const(type_name, param_value, inst->View()));
}
}