Skip to content

rsz: check max cap/slew across all timing corners#9849

Open
Vi-shub wants to merge 1 commit intoThe-OpenROAD-Project:masterfrom
Vi-shub:rsz-multi-corner-checks
Open

rsz: check max cap/slew across all timing corners#9849
Vi-shub wants to merge 1 commit intoThe-OpenROAD-Project:masterfrom
Vi-shub:rsz-multi-corner-checks

Conversation

@Vi-shub
Copy link

@Vi-shub Vi-shub commented Mar 19, 2026

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 corner
    In 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-corner output_port->capacitanceLimit() with sta_->checkCapacitance(pin, sta_->scenes(), ...) which queries across all corners and returns the worst violation. Follows the pattern used by RepairDesign::needRepairCap().
BaseMove::checkMaxSlewViolation() replaced single scene parameter with iteration over sta_->scenes(), checking the slew limit at every corner. Removed the scene parameter 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.

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>
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +838 to +840
float cap1, max_cap1, cap_slack1;
const sta::Scene* corner1;
const sta::RiseFall* tr1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

@maliberty maliberty requested a review from precisionmoon March 20, 2026 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant