aboutsummaryrefslogtreecommitdiffstats
path: root/passes
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2020-09-25 11:40:37 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2020-09-25 11:40:37 +0200
commit412332fdb3697c48b5e9f575933f45704e82df3c (patch)
tree4761395f9e1c51d86e87ca0ff140a7ac90ae4f19 /passes
parentcd8b2ed4e6f9447c94d801de7db7ae6ce0976d57 (diff)
downloadyosys-412332fdb3697c48b5e9f575933f45704e82df3c.tar.gz
yosys-412332fdb3697c48b5e9f575933f45704e82df3c.tar.bz2
yosys-412332fdb3697c48b5e9f575933f45704e82df3c.zip
Validate parameters only when they are used
Diffstat (limited to 'passes')
-rw-r--r--passes/hierarchy/hierarchy.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/passes/hierarchy/hierarchy.cc b/passes/hierarchy/hierarchy.cc
index 90b25949d..225e1feae 100644
--- a/passes/hierarchy/hierarchy.cc
+++ b/passes/hierarchy/hierarchy.cc
@@ -765,11 +765,13 @@ struct HierarchyPass : public Pass {
top_mod = design->module(top_name);
dict<RTLIL::IdString, RTLIL::Const> top_parameters;
- for (auto &para : parameters) {
- SigSpec sig_value;
- if (!RTLIL::SigSpec::parse(sig_value, NULL, para.second))
- log_cmd_error("Can't decode value '%s'!\n", para.second.c_str());
- top_parameters[RTLIL::escape_id(para.first)] = sig_value.as_const();
+ if ((top_mod == nullptr && design->module(abstract_id)) || top_mod != nullptr) {
+ for (auto &para : parameters) {
+ SigSpec sig_value;
+ if (!RTLIL::SigSpec::parse(sig_value, NULL, para.second))
+ log_cmd_error("Can't decode value '%s'!\n", para.second.c_str());
+ top_parameters[RTLIL::escape_id(para.first)] = sig_value.as_const();
+ }
}
if (top_mod == nullptr && design->module(abstract_id))