diff options
author | Catherine <whitequark@whitequark.org> | 2022-04-07 22:40:35 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-07 22:40:35 +0000 |
commit | 8a1d531b2551ccf00eb1df38ba65a1443390e72f (patch) | |
tree | 2cd3938a86cec904ec3e84b330e1d40481fe2182 | |
parent | 376d8cb26fcaa37a8627134dee3796315950885a (diff) | |
parent | 977002b1d2677b0bb82e3e0decec5c03c6eb69a9 (diff) | |
download | yosys-8a1d531b2551ccf00eb1df38ba65a1443390e72f.tar.gz yosys-8a1d531b2551ccf00eb1df38ba65a1443390e72f.tar.bz2 yosys-8a1d531b2551ccf00eb1df38ba65a1443390e72f.zip |
Merge pull request #3269 from YosysHQ/micko/fix_autotop
Reorder steps in -auto-top to fix synth command, fixes #3261
-rw-r--r-- | passes/hierarchy/hierarchy.cc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/passes/hierarchy/hierarchy.cc b/passes/hierarchy/hierarchy.cc index 440881f19..d40d6e59f 100644 --- a/passes/hierarchy/hierarchy.cc +++ b/passes/hierarchy/hierarchy.cc @@ -976,6 +976,19 @@ struct HierarchyPass : public Pass { if (mod->get_bool_attribute(ID::top)) top_mod = mod; + if (top_mod == nullptr && auto_top_mode) { + log_header(design, "Finding top of design hierarchy..\n"); + dict<Module*, int> db; + for (Module *mod : design->selected_modules()) { + int score = find_top_mod_score(design, mod, db); + log("root of %3d design levels: %-20s\n", score, log_id(mod)); + if (!top_mod || score > db[top_mod]) + top_mod = mod; + } + if (top_mod != nullptr) + log("Automatically selected %s as design top module.\n", log_id(top_mod)); + } + if (top_mod != nullptr && top_mod->name.begins_with("$abstract")) { IdString top_name = top_mod->name.substr(strlen("$abstract")); @@ -1000,19 +1013,6 @@ struct HierarchyPass : public Pass { } } - if (top_mod == nullptr && auto_top_mode) { - log_header(design, "Finding top of design hierarchy..\n"); - dict<Module*, int> db; - for (Module *mod : design->selected_modules()) { - int score = find_top_mod_score(design, mod, db); - log("root of %3d design levels: %-20s\n", score, log_id(mod)); - if (!top_mod || score > db[top_mod]) - top_mod = mod; - } - if (top_mod != nullptr) - log("Automatically selected %s as design top module.\n", log_id(top_mod)); - } - if (flag_simcheck && top_mod == nullptr) log_error("Design has no top module.\n"); |