Skip to content

Commit

Permalink
api for finding instance parent of pin. Signed-off-by:Andy Fox <andy@…
Browse files Browse the repository at this point in the history
…rushc.com>

Signed-off-by: andyfox-rushc <[email protected]>
  • Loading branch information
andyfox-rushc committed Sep 13, 2024
1 parent 7c8bc71 commit 49143da
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
5 changes: 3 additions & 2 deletions src/dbSta/include/db_sta/dbNetwork.hh
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,10 @@ class dbNetwork : public ConcreteNetwork
void setTopPortDirection(dbBTerm* bterm, const dbIoType& io_type);
ObjectId id(const Port* port) const override;

// hierarchical wiring support.
dbModNet* getDbModNetFromDbNet(dbNet* db_net);
// hierarchical support functions
dbModule* getNetDriverParentModule(Net* net);
Instance* getOwningInstanceParent(Pin* pin);

void hierarchicalConnect(dbITerm* source_pin,
dbITerm* dest_pin,
const char* connection_name);
Expand Down
19 changes: 18 additions & 1 deletion src/dbSta/src/dbNetwork.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2593,8 +2593,25 @@ dbNetworkObserver::~dbNetworkObserver()
}

/*
Hierarchical network api connections
Hierarchical support api
*/
Instance* dbNetwork::getOwningInstanceParent(Pin* pin)
{
Instance* inst = instance(drvr_pin);
dbInst* db_inst = nullptr;
odb::dbModInst* mod_inst = nullptr;
db_network_->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()))
? db_network_->topInstance()
: db_network_->dbToSta(module->getModInst());
return parent;
}

dbModule* dbNetwork::getNetDriverParentModule(Net* net)
{
Expand Down
17 changes: 3 additions & 14 deletions src/rsz/src/RepairHold.cc
Original file line number Diff line number Diff line change
Expand Up @@ -537,20 +537,9 @@ void RepairHold::makeHoldDelay(Vertex* drvr,

db_network_->net(drvr_pin, db_drvr_net, mod_drvr_net);

// Get the parent of the driver pin and put the new buffer there
Instance* inst = db_network_->instance(drvr_pin);
dbInst* db_inst;
odb::dbModInst* mod_inst;
db_network_->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 == (db_network_->block()->getTopModule()))
? db_network_->topInstance()
: db_network_->dbToSta(module->getModInst());
// Get the parent instance (owning the instance of the driver pin)
// and put the new buffer there
Instance* parent = db_network_->getOwningInstanceParent(drvr_pin);

Net *in_net = nullptr, *out_net = nullptr;

Expand Down

0 comments on commit 49143da

Please sign in to comment.