diff options
Diffstat (limited to 'kernel/rtlil.cc')
-rw-r--r-- | kernel/rtlil.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 0e9347267..2aefe30b1 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -2619,7 +2619,16 @@ void RTLIL::Cell::setParam(RTLIL::IdString paramname, RTLIL::Const value) const RTLIL::Const &RTLIL::Cell::getParam(RTLIL::IdString paramname) const { - return parameters.at(paramname); + 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 empty; } void RTLIL::Cell::sort() |