Skip to content

Commit

Permalink
Detect if has modinsts during name search -- if so truncate name so p…
Browse files Browse the repository at this point in the history
…athName with parent works ok

Signed-off-by: andyfox-rushc <[email protected]>
  • Loading branch information
andyfox-rushc committed Oct 22, 2024
1 parent f8d126f commit 66ecdc9
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 66ecdc9

Please sign in to comment.