Skip to content

Commit

Permalink
add hashierarchy() filter to getOwningInstanceParent
Browse files Browse the repository at this point in the history
Signed-off-by: andyfox-rushc <[email protected]>
  • Loading branch information
andyfox-rushc committed Sep 13, 2024
1 parent 2a03fe1 commit bfd7421
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions src/dbSta/src/dbNetwork.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2597,20 +2597,23 @@ dbNetworkObserver::~dbNetworkObserver()
*/
Instance* dbNetwork::getOwningInstanceParent(Pin* drvr_pin)
{
Instance* inst = instance(drvr_pin);
dbInst* db_inst = nullptr;
odb::dbModInst* mod_inst = nullptr;
staToDb(inst, db_inst, mod_inst);
odb::dbModule* module = nullptr;
if (db_inst) {
module = db_inst->getModule();
} else if (mod_inst) {
module = mod_inst->getParent();
}
Instance* parent = (module == (block_->getTopModule()))
? topInstance()
: dbToSta(module->getModInst());
return parent;
if (hasHierarchy()) {
Instance* inst = instance(drvr_pin);
dbInst* db_inst = nullptr;
odb::dbModInst* mod_inst = nullptr;
staToDb(inst, db_inst, mod_inst);
odb::dbModule* module = nullptr;
if (db_inst) {
module = db_inst->getModule();
} else if (mod_inst) {
module = mod_inst->getParent();
}
Instance* parent = (module == (block_->getTopModule()))
? topInstance()
: dbToSta(module->getModInst());
return parent;
}
return topInstance();
}

dbModule* dbNetwork::getNetDriverParentModule(Net* net)
Expand Down

0 comments on commit bfd7421

Please sign in to comment.