Skip to content

Commit 7616966

Browse files
authored
Merge pull request #7939 from The-OpenROAD-Project-staging/gui-cts-view-flat-net
gui: get the flat net for the clock tree viewer
2 parents 06fe3d9 + 725ce51 commit 7616966

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

src/dbSta/include/db_sta/dbNetwork.hh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ class dbNetwork : public ConcreteNetwork
291291
const Net* highestConnectedNet(Net* net) const override;
292292
bool isSpecial(Net* net);
293293
dbNet* flatNet(const Net* net) const;
294+
Net* getFlatNet(Net* net) const;
294295

295296
////////////////////////////////////////////////////////////////
296297
// Edit functions

src/dbSta/src/dbNetwork.cc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4171,4 +4171,19 @@ void dbNetwork::AxiomCheck()
41714171
}
41724172
}
41734173

4174+
Net* dbNetwork::getFlatNet(Net* net) const
4175+
{
4176+
if (!net) {
4177+
return nullptr;
4178+
}
4179+
// Convert net to a flat net, if not already
4180+
dbNet* db_net;
4181+
dbModNet* db_mod_net;
4182+
staToDb(net, db_net, db_mod_net);
4183+
if (db_mod_net) {
4184+
db_net = findRelatedDbNet(db_mod_net);
4185+
}
4186+
return dbToSta(db_net);
4187+
}
4188+
41744189
} // namespace sta

src/gui/src/staGuiInterface.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -723,10 +723,8 @@ void ClockTree::addPath(sta::PathExpanded& path, const sta::StaState* sta)
723723
sta::Net* ClockTree::getNet(const sta::Pin* pin) const
724724
{
725725
sta::Term* term = network_->term(pin);
726-
if (term != nullptr) {
727-
return network_->net(term);
728-
}
729-
return network_->net(pin);
726+
sta::Net* net = term ? network_->net(term) : network_->net(pin);
727+
return network_->getFlatNet(net);
730728
}
731729

732730
bool ClockTree::isLeaf(const sta::Pin* pin) const

0 commit comments

Comments
 (0)