-
Notifications
You must be signed in to change notification settings - Fork 790
Pdn secondary ground #9521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Pdn secondary ground #9521
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,19 +18,37 @@ | |
|
|
||
| namespace pdn { | ||
|
|
||
| namespace { | ||
| void reportSecondaryNets(utl::Logger* logger, | ||
| const char* label, | ||
| const std::vector<odb::dbNet*>& nets) | ||
| { | ||
| if (nets.empty()) { | ||
| return; | ||
| } | ||
| std::string names; | ||
| for (auto* net : nets) { | ||
| names += net->getName() + " "; | ||
| } | ||
| logger->report(" Secondary {} nets: {}", label, names); | ||
| } | ||
| } // namespace | ||
|
Comment on lines
+22
to
+35
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you can just make a loop in the reporting function to avoid needing to add this function. |
||
|
|
||
| VoltageDomain::VoltageDomain(PdnGen* pdngen, | ||
| odb::dbBlock* block, | ||
| odb::dbNet* power, | ||
| odb::dbNet* ground, | ||
| const std::vector<odb::dbNet*>& secondary_nets, | ||
| const std::vector<odb::dbNet*>& secondary_power, | ||
| const std::vector<odb::dbNet*>& secondary_ground, | ||
| utl::Logger* logger) | ||
| : name_("Core"), | ||
| pdngen_(pdngen), | ||
| block_(block), | ||
| power_(power), | ||
| switched_power_(nullptr), | ||
| ground_(ground), | ||
| secondary_(secondary_nets), | ||
| secondary_power_(secondary_power), | ||
| secondary_ground_(secondary_ground), | ||
| region_(nullptr), | ||
| logger_(logger) | ||
| { | ||
|
|
@@ -42,7 +60,8 @@ VoltageDomain::VoltageDomain(PdnGen* pdngen, | |
| odb::dbBlock* block, | ||
| odb::dbNet* power, | ||
| odb::dbNet* ground, | ||
| const std::vector<odb::dbNet*>& secondary_nets, | ||
| const std::vector<odb::dbNet*>& secondary_power, | ||
| const std::vector<odb::dbNet*>& secondary_ground, | ||
| odb::dbRegion* region, | ||
| utl::Logger* logger) | ||
| : name_(name), | ||
|
|
@@ -51,7 +70,8 @@ VoltageDomain::VoltageDomain(PdnGen* pdngen, | |
| power_(power), | ||
| switched_power_(nullptr), | ||
| ground_(ground), | ||
| secondary_(secondary_nets), | ||
| secondary_power_(secondary_power), | ||
| secondary_ground_(secondary_ground), | ||
| region_(region), | ||
| logger_(logger) | ||
| { | ||
|
|
@@ -75,21 +95,31 @@ std::vector<odb::dbNet*> VoltageDomain::getNets(bool start_with_power) const | |
| std::vector<odb::dbNet*> nets; | ||
|
|
||
| if (start_with_power) { | ||
| // Order: primary power, switched power, secondary power nets, | ||
| // secondary ground nets, primary ground. | ||
| // This groups all supply rails together before the ground rails, | ||
| // fixing the ordering issue for multi-rail designs (e.g., VDDA, VDD, VSS). | ||
| nets.push_back(power_); | ||
| if (switched_power_ != nullptr) { | ||
| nets.push_back(switched_power_); | ||
| } | ||
| nets.insert(nets.end(), secondary_power_.begin(), secondary_power_.end()); | ||
| nets.insert( | ||
| nets.end(), secondary_ground_.begin(), secondary_ground_.end()); | ||
| nets.push_back(ground_); | ||
| } else { | ||
| // Reverse order: primary ground, secondary ground nets, | ||
| // secondary power nets, switched power, primary power. | ||
| nets.push_back(ground_); | ||
| nets.push_back(power_); | ||
| nets.insert( | ||
| nets.end(), secondary_ground_.begin(), secondary_ground_.end()); | ||
| nets.insert(nets.end(), secondary_power_.begin(), secondary_power_.end()); | ||
| if (switched_power_ != nullptr) { | ||
| nets.push_back(switched_power_); | ||
| } | ||
| nets.push_back(power_); | ||
| } | ||
|
|
||
| nets.insert(nets.end(), secondary_.begin(), secondary_.end()); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it will be okay, but I'm a little worried about reordering of the nets for folks who are currently expecting the current order. |
||
|
|
||
| return nets; | ||
| } | ||
|
|
||
|
|
@@ -210,13 +240,8 @@ void VoltageDomain::report() const | |
| logger_->report(" Switched power net: {}", switched_power_->getName()); | ||
| } | ||
|
|
||
| if (!secondary_.empty()) { | ||
| std::string nets; | ||
| for (auto* net : secondary_) { | ||
| nets += net->getName() + " "; | ||
| } | ||
| logger_->report(" Secondary nets: {}", nets); | ||
| } | ||
| reportSecondaryNets(logger_, "power", secondary_power_); | ||
| reportSecondaryNets(logger_, "ground", secondary_ground_); | ||
|
|
||
| for (const auto& grid : grids_) { | ||
| grid->report(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this function, but I think we need to resolve the formatting question before adding the timer code here.