mirror of https://github.com/YosysHQ/yosys.git
kernel: Cell::getParam() to throw exception again if not found
As it did before #1945
This commit is contained in:
parent
fa9df06c9d
commit
86ab7d3a6e
|
@ -2619,16 +2619,15 @@ void RTLIL::Cell::setParam(RTLIL::IdString paramname, RTLIL::Const value)
|
|||
|
||||
const RTLIL::Const &RTLIL::Cell::getParam(RTLIL::IdString paramname) const
|
||||
{
|
||||
static const RTLIL::Const empty;
|
||||
const auto &it = parameters.find(paramname);
|
||||
if (it != parameters.end())
|
||||
return it->second;
|
||||
if (module && module->design) {
|
||||
RTLIL::Module *m = module->design->module(type);
|
||||
if (m)
|
||||
return m->parameter_default_values.at(paramname, empty);
|
||||
return m->parameter_default_values.at(paramname);
|
||||
}
|
||||
return empty;
|
||||
throw std::out_of_range("Cell::getParam()");
|
||||
}
|
||||
|
||||
void RTLIL::Cell::sort()
|
||||
|
|
Loading…
Reference in New Issue