Repository navigation
est: Filter ideal clock net invalidation #10571
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
Changes from all commits
e3ed520
1f7bc1d
43c9651
b3b05e9
34afd4a
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 |
|---|---|---|
|
|
@@ -435,6 +435,9 @@ void EstimateParasitics::updateParasitics() | |
| switch (parasitics_src_) { | ||
| case ParasiticsSrc::kPlacement: | ||
| for (const sta::Net* net : parasitics_invalid_) { | ||
| if (isIdealClockNet(net)) { | ||
| continue; | ||
| } | ||
| // | ||
| // TODO: remove this check (we expect all to be flat net) | ||
| // | ||
|
|
@@ -461,6 +464,9 @@ void EstimateParasitics::updateParasitics() | |
| // TODO: update detailed route for modified nets | ||
| incr_groute_->updateRoutes(); | ||
| for (const sta::Net* net : parasitics_invalid_) { | ||
| if (isIdealClockNet(net)) { | ||
| continue; | ||
| } | ||
| debugPrint(logger_, | ||
| EST, | ||
| "estimate_parasitics", | ||
|
|
@@ -482,6 +488,9 @@ void EstimateParasitics::updateParasitics() | |
| // groute call. | ||
| if (parasitics_src_ != ParasiticsSrc::kNone) { | ||
| for (const sta::Net* net : parasitics_invalid_) { | ||
| if (isIdealClockNet(net)) { | ||
| continue; | ||
| } | ||
| debugPrint(logger_, | ||
| EST, | ||
| "estimate_parasitics", | ||
|
|
@@ -732,15 +741,7 @@ void EstimateParasitics::estimateWireParasiticSteiner( | |
| const sta::Net* net, | ||
| sta::SpefWriter* spef_writer) | ||
| { | ||
| bool all_modes_ideal_clock = true; | ||
| for (sta::Mode* mode : sta_->modes()) { | ||
| if (!sta_->isIdealClock(drvr_pin, mode)) { | ||
| all_modes_ideal_clock = false; | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| if (!all_modes_ideal_clock) { | ||
| if (!isIdealClockPin(drvr_pin)) { | ||
| SteinerTree* tree = makeSteinerTree(drvr_pin); | ||
| if (tree) { | ||
| debugPrint(logger_, | ||
|
|
@@ -1145,6 +1146,42 @@ bool EstimateParasitics::isPad(const sta::Instance* inst) const | |
| return false; | ||
| } | ||
|
|
||
| bool EstimateParasitics::isIdealClockPin(const sta::Pin* pin) const | ||
| { | ||
| // An ideal clock pin carries fixed arrivals that do not depend on | ||
| // parasitics, so its parasitics never need re-estimation. | ||
| bool is_clock = false; | ||
| for (sta::Mode* mode : sta_->modes()) { | ||
| // In multi-mode designs, a pin may be an ideal clock only in a subset of | ||
| // modes. Ignore modes where the pin is not a clock at all. | ||
| // e.g., scan clock pin may not be defined as clock in function mode. | ||
| if (!sta_->isClock(pin, mode)) { | ||
| continue; | ||
|
Contributor
Author
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. @eder-matheus |
||
| } | ||
| is_clock = true; | ||
| if (!sta_->isIdealClock(pin, mode)) { | ||
| return false; | ||
| } | ||
| } | ||
| return is_clock; | ||
| } | ||
|
|
||
| bool EstimateParasitics::isIdealClockNet(const sta::Net* net) const | ||
| { | ||
| odb::dbNet* db_net = db_network_->staToDb(net); | ||
| if (db_net == nullptr) { | ||
| return false; | ||
| } | ||
|
|
||
| PinSet* drivers = network_->drivers(net); | ||
| if (drivers == nullptr || drivers->empty()) { | ||
| return false; | ||
| } | ||
|
|
||
| const Pin* drvr_pin = *drivers->begin(); | ||
|
Contributor
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. Is there a check somewhere upfront that clock nets cannot be multidriven nets? Maybe just add a comment here about that. Even an assert might work!
Contributor
Author
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 let Codex & Claude search the detector for multiple drivers in clock network, but they couldn't find it. Typically, clock network does not have multiple drivers except for clock mesh design. If there are multiple clock drivers, this API retrieves only the first driver and check if it is an ideal clock.
Member
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. There has been some discussion of adding clock mesh support but it hasn't gone anywhere so far. |
||
| return isIdealClockPin(drvr_pin); | ||
|
jhkim-pii marked this conversation as resolved.
Resolved
|
||
| } | ||
|
|
||
| void EstimateParasitics::parasiticsInvalid(const sta::Net* net) | ||
| { | ||
| odb::dbNet* db_net = db_network_->findFlatDbNet(net); | ||
|
|
||
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.
This is the main performance fix.
It does not retrigger the redundant update of all DFFs connected to an ideal clock net.