Skip to content

rsz: repair_timing -effort policy (tapeout|explore)#10942

Open
oharboe wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
oharboe:repair-timing-effort
Open

rsz: repair_timing -effort policy (tapeout|explore)#10942
oharboe wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
oharboe:repair-timing-effort

Conversation

@oharboe

@oharboe oharboe commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

repair_timing has one built-in policy: work toward tape-out closure. During design space exploration that is the wrong policy — on WNS-dominated designs setup repair grinds for hours toward targets it cannot reach, and hold repair spends hours inserting buffers that carry no exploration information (hold closes at any clock period). Users end up hand-rolling workarounds out of slack margins and skip flags, per stage, per design.

This PR adds repair_timing -effort <directives>: a policy interface analogous to the compiler driver -O flags (POLA). The caller states intent; the tool owns the mapping to its internal heuristics. Directives compose left to right and a later directive overrides an earlier one, like -O0 -O2. Two directives are defined:

  • tapeout (default) — the exact historical behavior.
  • explore — setup repair may stop when its marginal progress plateaus; hold repair is not run. An explicit -hold to the right of -effort explore re-enables it.

The plateau heuristic behind explore is a strawman. The ask of this PR is not the heuristic: it is that we agree OpenROAD accepts the policy interface and the responsibility for the mapping behind it. Graded levels between the two (-O1/-O2/-Os analogues) are intentionally not introduced; that is left for people who understand those use cases.

Resolution is implemented in rsz::EffortPolicy with a gtest unit test; tapeout reproduces the previous hardcoded values bit-for-bit, so behavior without -effort is unchanged.

Measured on the nightly CI of an industrial RISC-V design at three sizes of the same microarchitecture (S/M/L), route stage (global route + repair_timing). Before = the hand-rolled bounding workarounds that design carried (per-stage slack margins, skip flags); after = those replaced by the explore semantics of this PR. Detailed routing downstream is unchanged between the two runs (~100 min at S in both), the delta is repair:

design global route + repair, before after WNS before after
S 140 min 52 min −284 ps −358 ps
M 226 min 104 min −470 ps −560 ps
L 317 min not measured −479 ps not measured

The two runs are one night apart on actively developed RTL, so the WNS deltas include design churn (S's TNS improved while its WNS regressed); the runtime deltas are the policy.

An optimization-policy dial in the spirit of the compiler driver -O
flags (POLA): the caller states intent, the tool owns the mapping to
its internal heuristics. Directives compose left to right, a later
directive overrides an earlier one, as in "gcc -O0 -O2". Two are
defined: tapeout (default, the exact historical behavior) and explore,
which lets setup repair stop when its marginal progress plateaus and
does not run hold repair. An explicit -hold to the right of "-effort
explore" re-enables hold repair. Graded levels in between are
intentionally left undefined.

Fixes The-OpenROAD-Project#10900

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe
oharboe requested a review from a team as a code owner July 17, 2026 15:01
@oharboe
oharboe requested a review from povik July 17, 2026 15:01

@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 -effort option to the repair_timing command, providing a coarse optimization policy with directives like tapeout and explore to control setup and hold repair heuristics. Feedback on these changes highlights a few critical issues: the use of a C++20 defaulted comparison operator in EffortPolicy.hh which is incompatible with the project's C++17 standard, a potential glob-matching vulnerability in the Tcl argument parsing, and an uninitialized repaired_hold variable in Resizer.tcl that could trigger Tcl runtime errors when the explore directive is used.

Comment thread src/rsz/include/rsz/EffortPolicy.hh
Comment thread src/rsz/src/Resizer.tcl Outdated
Comment thread src/rsz/src/Resizer.tcl
string equal -length instead of string match: an argument carrying glob
characters must not confuse the prefix comparison.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
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