diff options
author | Jim Lawson <ucbjrl@berkeley.edu> | 2019-02-19 14:35:15 -0800 |
---|---|---|
committer | Jim Lawson <ucbjrl@berkeley.edu> | 2019-02-19 14:35:15 -0800 |
commit | 5c4a72c43ef61420b4b099d87949b0fdba0f4b55 (patch) | |
tree | 91a718281febfe383312d7598fa0c58f0065ab6f /passes | |
parent | 5c504c5ae676488f7e0b53f827f189fa7cacb2c8 (diff) | |
download | yosys-5c4a72c43ef61420b4b099d87949b0fdba0f4b55.tar.gz yosys-5c4a72c43ef61420b4b099d87949b0fdba0f4b55.tar.bz2 yosys-5c4a72c43ef61420b4b099d87949b0fdba0f4b55.zip |
Fix normal (non-array) hierarchy -auto-top.
Add simple test.
Diffstat (limited to 'passes')
-rw-r--r-- | passes/hierarchy/hierarchy.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/passes/hierarchy/hierarchy.cc b/passes/hierarchy/hierarchy.cc index 332ebdfbb..f112e969e 100644 --- a/passes/hierarchy/hierarchy.cc +++ b/passes/hierarchy/hierarchy.cc @@ -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); } } } |