diff options
author | clairexen <claire@symbioticeda.com> | 2020-09-29 17:21:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-29 17:21:08 +0200 |
commit | e8c9e541a735894a974aaebfb88dfaa9aa3e0f31 (patch) | |
tree | 11b699c864d36a573d369db7f437a7e95b08f935 | |
parent | dfc43c38f8f3498c04b86e48a22858b1dc6721db (diff) | |
parent | 412332fdb3697c48b5e9f575933f45704e82df3c (diff) | |
download | yosys-e8c9e541a735894a974aaebfb88dfaa9aa3e0f31.tar.gz yosys-e8c9e541a735894a974aaebfb88dfaa9aa3e0f31.tar.bz2 yosys-e8c9e541a735894a974aaebfb88dfaa9aa3e0f31.zip |
Merge pull request #2392 from YosysHQ/mmicko/hierarchy_fix
Validate parameters only when they are used
-rw-r--r-- | passes/hierarchy/hierarchy.cc | 12 |
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 ¶ : 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 ¶ : 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)) |