mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-23 09:05:32 +00:00
hierarchy: Without a known top module, derive all deferred modules
This fixes hierarchy when used with cell libraries that were loaded with -defer and also makes more of the hierarchy visible to the auto-top heuristic.
This commit is contained in:
parent
2422dd6845
commit
0470cbb00d
2 changed files with 13 additions and 1 deletions
|
@ -1006,6 +1006,18 @@ struct HierarchyPass : public Pass {
|
|||
if (mod->get_bool_attribute(ID::top))
|
||||
top_mod = mod;
|
||||
|
||||
if (top_mod == nullptr)
|
||||
{
|
||||
std::vector<IdString> abstract_ids;
|
||||
for (auto module : design->modules())
|
||||
if (module->name.begins_with("$abstract"))
|
||||
abstract_ids.push_back(module->name);
|
||||
for (auto abstract_id : abstract_ids)
|
||||
design->module(abstract_id)->derive(design, {});
|
||||
for (auto abstract_id : abstract_ids)
|
||||
design->remove(design->module(abstract_id));
|
||||
}
|
||||
|
||||
if (top_mod == nullptr && auto_top_mode) {
|
||||
log_header(design, "Finding top of design hierarchy..\n");
|
||||
dict<Module*, int> db;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue