diff options
author | Eddie Hung <eddie@fpgeh.com> | 2019-09-03 12:18:50 -0700 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2019-09-03 12:18:50 -0700 |
commit | d2306d7b1d9725fef2d1db4e205c1b0cb6c84715 (patch) | |
tree | 0d7524842086e84cb266b6a6e8dac54afe349d2c /passes/hierarchy | |
parent | 0ca070663091ec0eecd089801f37339feb7813c8 (diff) | |
download | yosys-d2306d7b1d9725fef2d1db4e205c1b0cb6c84715.tar.gz yosys-d2306d7b1d9725fef2d1db4e205c1b0cb6c84715.tar.bz2 yosys-d2306d7b1d9725fef2d1db4e205c1b0cb6c84715.zip |
Adopt @cliffordwolf's suggestion
Diffstat (limited to 'passes/hierarchy')
-rw-r--r-- | passes/hierarchy/hierarchy.cc | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/passes/hierarchy/hierarchy.cc b/passes/hierarchy/hierarchy.cc index ad795c69f..d8a628448 100644 --- a/passes/hierarchy/hierarchy.cc +++ b/passes/hierarchy/hierarchy.cc @@ -808,12 +808,8 @@ struct HierarchyPass : public Pass { if (mod_it.second->get_bool_attribute("\\top")) top_mod = mod_it.second; - if (top_mod != nullptr && auto_top_mode) { - IdString abstract_id = top_mod->name; - IdString top_name = abstract_id; - if (top_name.begins_with("$abstract")) - top_name = top_name.substr(strlen("$abstract")); - top_mod = design->module(top_name); + if (top_mod != nullptr && top_mod->name.begins_with("$abstract")) { + IdString top_name = top_mod->name.substr(strlen("$abstract")); dict<RTLIL::IdString, RTLIL::Const> top_parameters; for (auto ¶ : parameters) { @@ -823,10 +819,7 @@ struct HierarchyPass : public Pass { top_parameters[RTLIL::escape_id(para.first)] = sig_value.as_const(); } - if (top_mod == nullptr && design->module(abstract_id)) - top_mod = design->module(design->module(abstract_id)->derive(design, top_parameters)); - else if (top_mod != nullptr && !top_parameters.empty()) - top_mod = design->module(top_mod->derive(design, top_parameters)); + top_mod = design->module(top_mod->derive(design, top_parameters)); if (top_mod != nullptr && top_mod->name != top_name) { Module *m = top_mod->clone(); |