Merge pull request #2392 from YosysHQ/mmicko/hierarchy_fix

Validate parameters only when they are used
This commit is contained in:
clairexen 2020-09-29 17:21:08 +02:00 committed by GitHub
commit e8c9e541a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -765,11 +765,13 @@ struct HierarchyPass : public Pass {
top_mod = design->module(top_name); top_mod = design->module(top_name);
dict<RTLIL::IdString, RTLIL::Const> top_parameters; dict<RTLIL::IdString, RTLIL::Const> top_parameters;
for (auto &para : parameters) { if ((top_mod == nullptr && design->module(abstract_id)) || top_mod != nullptr) {
SigSpec sig_value; for (auto &para : parameters) {
if (!RTLIL::SigSpec::parse(sig_value, NULL, para.second)) SigSpec sig_value;
log_cmd_error("Can't decode value '%s'!\n", para.second.c_str()); if (!RTLIL::SigSpec::parse(sig_value, NULL, para.second))
top_parameters[RTLIL::escape_id(para.first)] = sig_value.as_const(); 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)) if (top_mod == nullptr && design->module(abstract_id))