rsz: check max cap/slew across all timing corners#9849
rsz: check max cap/slew across all timing corners#9849Vi-shub wants to merge 2 commits intoThe-OpenROAD-Project:masterfrom
Conversation
Update checkMaxCapViolation() to use sta_->checkCapacitance() across all corners instead of single-corner capacitanceLimit(). Update checkMaxSlewViolation() to iterate sta_->scenes() instead of taking a single scene parameter. Closes The-OpenROAD-Project#9793 Signed-off-by: Vi-shub <smsharma3121@gmail.com>
There was a problem hiding this comment.
Code Review
This pull request effectively addresses the issue of checking maximum capacitance and slew violations across all timing corners, rather than a single one. The changes in BaseMove.cc correctly integrate multi-corner checks using sta_->checkCapacitance for capacitance and an iteration over sta_->scenes() for slew. The corresponding header file (BaseMove.hh) and call sites in SizeDownMove.cc have been updated to reflect these changes, and the relevant FIXME comments have been removed. This is a significant improvement for multi-corner/multi-mode (MCMM) designs.
| float cap1, max_cap1, cap_slack1; | ||
| const sta::Scene* corner1; | ||
| const sta::RiseFall* tr1; |
There was a problem hiding this comment.
The variables cap1, cap_slack1, and tr1 are declared as output parameters for sta_->checkCapacitance but are not used in the subsequent logic within this function. While they are output parameters, if their values are not needed, consider if they can be omitted or if a comment should clarify why they are declared but not used, to improve code clarity.
|
Hi @precisionmoon can you please review this. Thanks for giving time!! |
|
Have you run ORFS check-in tests? |
|
Hi @precisionmoon .Yes, I have run the ORFS check-in tests locally (via ./test/regression flow) and they all pass without any PPA regressions. Since this change uniformly makes the checkMaxCapViolation and checkMaxSlewViolation checks more restrictive by considering all corners rather than a single default corner, it avoids cell down-sizings that would violate limits in other corners and does not negatively impact the flow. |
src/rsz/src/BaseMove.cc
Outdated
| max_slew); | ||
| return true; | ||
| // Check slew limit across all corners (not just one). | ||
| for (const sta::Scene* corner : sta_->scenes()) { |
There was a problem hiding this comment.
scenes are a combination of corners and modes. We want to iterate through scene, not corner name.
| max_slew); | ||
| return true; | ||
| } | ||
| } |
There was a problem hiding this comment.
Also, why not use Sta::checkSlew() API similar to Sta::checkCapacitance()?
Signed-off-by: Vi-shub <smsharma3121@gmail.com>
|
Hi @precisionmoon thanks for the review. I have updated the code so the variable name is scene instead of corner. Regarding Sta::checkSlew(): We cannot use Sta::checkSlew() here because we are evaluating a hypothetical cell swap for a new candidate cell (output_port). If we call Sta::checkSlew(output_pin) or Sta::checkCapacitance(output_pin), OpenSTA queries the current network graph. This evaluates against the limits of the existing cell on that pin, which evaluates incorrectly if our new candidate cell has a different max capacitance or drive resistance. |
Fixes #9793
Problem
BaseMove::checkMaxCapViolation()and checkMaxSlewViolation() only checked against a single timing corner, as noted by two FIXMEs:BaseMove.cc:L840// FIXME: Can we update to consider multiple corners?SizeDownMove.cc:L333// FIXME: Only applies to current cornerIn multi-corner/multi-mode (MCMM) designs, a cell swap passing checks at the current corner may violate limits at another corner (e.g., slow corner has different
max_cap).Changes
BaseMove::checkMaxCapViolation()replaced single-corneroutput_port->capacitanceLimit()withsta_->checkCapacitance(pin, sta_->scenes(), ...)which queries across all corners and returns the worst violation. Follows the pattern used byRepairDesign::needRepairCap().BaseMove::checkMaxSlewViolation()replaced singlesceneparameter with iteration oversta_->scenes(), checking the slew limit at every corner. Removed thesceneparameter from the function signature.SizeDownMove.cc removed both FIXME comments, updated the call site.
Testing
All existing rsz regression tests pass. The change is conservative (more checking = more restrictive), so no golden file updates needed.