Skip to content

rsz: remove buffer insertion limit during parasitics estimation - #11151

Open
oharboe wants to merge 3 commits into
The-OpenROAD-Project:masterfrom
oharboe:rsz-gpl-buffer-limit
Open

rsz: remove buffer insertion limit during parasitics estimation#11151
oharboe wants to merge 3 commits into
The-OpenROAD-Project:masterfrom
oharboe:rsz-gpl-buffer-limit

Conversation

@oharboe

@oharboe oharboe commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Global placement can generate topologies with exceptionally high fanout (e.g., synchronous reset networks in MegaBoom or CoralNPU), causing OpenSTA to stall computing delay on massive unbuffered RC nets. repair_design is invoked as a pre-processing step to linearize delay computation. The default hard limit of 5,000 buffers causes it to silently bail out on large networks, defeating the estimation pass and resulting in severely pessimistic and inaccurate timing-driven placement.

This bypasses the buffer limit when repairDesign is called in estimation mode, enabling complete linearization and significantly faster, more accurate timing estimation for large designs.

Alternatives considered

  • Raising or scaling the cap instead of bypassing it: any finite cap re-introduces the silent bail-out on sufficiently large designs; the estimation pass needs complete linearization to produce meaningful delays.
  • Removing the cap in the normal repair_design flow as well: out of scope here; the cap remains as a zero-config futility guard for user-invoked repair.
  • A user-facing option to control the limit: the limit is an internal guard rather than a tuning knob; no new Tcl surface is added.
  • An enum class mode instead of a bool: a single internal caller sets it and there is no third mode to express; an enum adds API surface without distinguishing anything.
  • Carrying the mode as member state (SetAndRestore) on RepairDesign instead of threading a parameter: the parameter keeps the mode visible at each call site through the overload chain.
  • Default argument values for the new parameter: dropped after review feedback; defaulted bools ahead of verbose can silently remap positional arguments of existing callers. All call sites now pass both flags explicitly, so a stale caller fails to compile instead of changing behavior.
  • A regression test that triggers the limit: exercising the cap requires a design that inserts more than 5,000 buffers, which is beyond regression-suite scale; the change is exercised by large-design flow runs (MegaBoom, CoralNPU).

@oharboe
oharboe requested a review from a team as a code owner August 15, 2026 16:34
@oharboe
oharboe requested a review from jhkim-pii August 15, 2026 16:34

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

Copy link
Copy Markdown
Contributor

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 introduces an is_estimation flag to the repairDesign methods in Resizer and RepairDesign to bypass the buffer insertion limit during estimation phases. The review feedback highlights a critical issue where buffer_gain (a double) is implicitly cast to initial_sizing (a bool) in an overloaded method call, which is highly error-prone. Additionally, it is suggested to simplify the bypass logic in the buffer insertion loop by checking !is_estimation directly instead of using std::numeric_limits<int>::max().

Comment thread src/rsz/src/RepairDesign.cc Outdated
Comment thread src/rsz/src/RepairDesign.cc Outdated
@oharboe
oharboe force-pushed the rsz-gpl-buffer-limit branch from 4a93957 to 73b1ef4 Compare August 15, 2026 16:36
Global placement can generate topologies with exceptionally high fanout (e.g., synchronous reset networks in MegaBoom or CoralNPU), causing OpenSTA to stall computing delay on massive unbuffered RC nets. repair_design is invoked as a pre-processing step to linearize delay computation. The default hard limit of 5,000 buffers causes it to silently bail out on large networks, defeating the estimation pass and resulting in severely pessimistic and inaccurate timing-driven placement.

This bypasses the buffer limit when repairDesign is called in estimation mode, enabling complete linearization and significantly faster, more accurate timing estimation for large designs.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe
oharboe force-pushed the rsz-gpl-buffer-limit branch from 73b1ef4 to 80b2ae6 Compare August 15, 2026 16:38
@oharboe

oharboe commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator Author

/gemini review

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

Copy link
Copy Markdown
Contributor

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 introduces an is_estimation flag to the repairDesign methods in Resizer and RepairDesign to bypass the maximum allowed buffer check during estimation phases. The reviewer feedback highlights a critical backward-compatibility issue: adding is_estimation before verbose (which has a default value) in the parameter list can cause existing callers passing five arguments to silently map their verbose argument to is_estimation. To prevent this, the reviewer recommends reordering the parameters so that is_estimation is placed after verbose across all declarations, definitions, and call sites.

Comment thread src/rsz/include/rsz/Resizer.hh Outdated
Comment thread src/rsz/src/Resizer.cc Outdated
Comment thread src/rsz/src/Resizer.cc Outdated
Comment thread src/rsz/src/Resizer.i Outdated
Comment thread src/rsz/src/RepairDesign.hh Outdated
Comment thread src/rsz/src/RepairDesign.hh Outdated
Comment thread src/rsz/src/RepairDesign.cc Outdated
Comment thread src/rsz/src/RepairDesign.cc Outdated
Comment thread src/rsz/src/RepairDesign.cc Outdated
Comment thread src/rsz/src/Resizer.cc Outdated
Defaulted is_estimation ahead of verbose could silently remap the
positional verbose argument of existing callers onto is_estimation.
Place is_estimation last and require both flags explicitly so any
stale call site fails to compile instead of changing behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe

oharboe commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator Author

/gemini review

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

Copy link
Copy Markdown
Contributor

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 introduces a new is_estimation boolean parameter to the repairDesign methods in both the Resizer and RepairDesign classes, allowing the buffer limit check to be bypassed during estimation runs. The reviewer suggests providing a default value of false for this new parameter in both class definitions to maintain backward compatibility and prevent compilation failures for existing callers.

Comment thread src/rsz/include/rsz/Resizer.hh
Comment thread src/rsz/src/RepairDesign.hh
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe
oharboe requested a review from maliberty August 16, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant