From 412332fdb3697c48b5e9f575933f45704e82df3c Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 25 Sep 2020 11:40:37 +0200 Subject: [PATCH] Validate parameters only when they are used --- passes/hierarchy/hierarchy.cc | 12 +++++++----- 1 file 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 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)) -- 2.30.2