mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-24 01:25:33 +00:00
Fix normal (non-array) hierarchy -auto-top.
Add simple test.
This commit is contained in:
parent
5c504c5ae6
commit
5c4a72c43e
3 changed files with 74 additions and 10 deletions
|
@ -523,15 +523,15 @@ int find_top_mod_score(Design *design, Module *module, dict<Module*, int> &db)
|
|||
// Is this an array instance
|
||||
if (celltype.substr(0, 7) == "$array:") {
|
||||
celltype = basic_cell_type(celltype);
|
||||
// Is this cell is a module instance?
|
||||
if (celltype[0] != '$') {
|
||||
auto instModule = design->module(celltype);
|
||||
// If there is no instance for this, issue a warning.
|
||||
if (instModule == NULL) {
|
||||
log_warning("find_top_mod_score: no instance for %s.%s\n", celltype.c_str(), cell->name.c_str());
|
||||
}
|
||||
if (instModule != NULL)
|
||||
score = max(score, find_top_mod_score(design, instModule, db) + 1);
|
||||
}
|
||||
// Is this cell a module instance?
|
||||
if (celltype[0] != '$') {
|
||||
auto instModule = design->module(celltype);
|
||||
// If there is no instance for this, issue a warning.
|
||||
if (instModule == NULL) {
|
||||
log_warning("find_top_mod_score: no instance for %s.%s\n", celltype.c_str(), cell->name.c_str());
|
||||
} else {
|
||||
score = max(score, find_top_mod_score(design, instModule, db) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue