Skip to content

Commit

Permalink
Fix for geting name in presence of modinsts but non-hierarchical mode
Browse files Browse the repository at this point in the history
Signed-off-by: andyfox-rushc <[email protected]>
  • Loading branch information
andyfox-rushc committed Oct 23, 2024
1 parent ea63b9a commit b874b10
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/dbSta/src/dbNetwork.cc
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,13 @@ const char* dbNetwork::name(const Instance* instance) const
name = mod_inst->getName();
}

if (hierarchy_) {
bool has_mod_insts = false;
dbModule* module = block_->getTopModule();
if (module && module->getModInstCount() > 0) {
has_mod_insts = true;
}

if (hierarchy_ || has_mod_insts) {
size_t last_idx = name.find_last_of('/');
if (last_idx != string::npos) {
name = name.substr(last_idx + 1);
Expand Down Expand Up @@ -843,9 +849,7 @@ Instance* dbNetwork::parent(const Instance* instance) const
if (instance == top_instance_) {
return nullptr;
}
if (!hasHierarchy()) {
return top_instance_;
}

dbInst* db_inst;
dbModInst* mod_inst;
staToDb(instance, db_inst, mod_inst);
Expand Down

0 comments on commit b874b10

Please sign in to comment.