Skip to content

rsz: skip ensureWireParasitic in repair_design hot path#10507

Merged
maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:secure-rsz-issue1676-v2
May 29, 2026
Merged

rsz: skip ensureWireParasitic in repair_design hot path#10507
maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:secure-rsz-issue1676-v2

Conversation

@minjukim55

Copy link
Copy Markdown
Contributor

Summary

  • Pass a local load_cap from BufferedNet wire RC to `resizeToTargetSlew` as a hint, skipping the expensive `ensureWireParasitic + STA loadCap` query on the `repair_design` buffer-insertion hot path.
  • `repairNetWire` hint reflects only the wire the buffer drives (`buf_dist × wire_cap + ref_cap`), not the full Steiner edge.
  • `repairNetJunc` passes `cap_left`/`cap_right` since the buffer is placed at the junction location.
  • Gate on `parasitics_src_ == kGlobalRouting` so the optimization applies only where the FastRoute incremental setup is the cost. Placement-mode `repair_design` (the bulk of OR's own test suite) keeps the existing path.

Type

  • Performance optimization (no functional change at the API level; existing callers without a hint take the same code path)

Impact

Profiled on a large customer design (497k inst) where `ensureWireParasitic` accounted for 96% of `repair_design` wall time (5,860 calls × ~390ms FastRoute setup each).

Measured on the same design (same cts.odb, same OR commit, 5_1_grt step only re-run):

Metric Baseline Fix Δ
`repair_design` wall 1,570s 312s -79% (5× faster)
Total GRT step (5_1_grt) 3,996s 2,842s -29%
Buffers inserted in RD 6,360 6,360 exact match
Final Setup TNS -343.7 -341.7 better
Final Hold TNS -0.0599 -0.0323 better (-46%)
Final Hold viol count 32 23 better (-9)
Final Setup WS -0.1444 -0.1470 -1.8%

Verification

  • All 7 existing `rsz.repair_design*` and 11 `rsz.repair_wire*` regression tests pass.
  • clang-format applied. Diff: 4 files in `src/rsz/`, +34 / -15.

Related Issues

See private issue The-OpenROAD-Project-private/OpenROAD-flow-scripts#1676.

(Note: supersedes #3433 which had its head branch renamed.)

@minjukim55 minjukim55 requested a review from a team as a code owner May 26, 2026 04:08
@minjukim55 minjukim55 requested a review from povik May 26, 2026 04:08
@minjukim55 minjukim55 self-assigned this May 26, 2026

@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 optional load_cap_hint parameter to resizeToTargetSlew and makeRepeater to optimize performance by skipping incremental FastRoute calls during global routing. A review comment suggests addressing implicit type conversions and truncation issues when calculating buffer_load_cap in RepairDesign.cc by using explicit casting and direct double arithmetic.

Comment thread src/rsz/src/RepairDesign.cc Outdated

@github-actions github-actions 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.

Welcome to OpenROAD! Thanks for opening your first PR.
Before we review:

Please ensure:

  • CI passes
  • Code is properly formatted
  • Tests are included where applicable
    A maintainer will review shortly!

@minjukim55

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@github-actions

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@minjukim55 minjukim55 force-pushed the secure-rsz-issue1676-v2 branch 2 times, most recently from 217bf3b to dbdd58f Compare May 26, 2026 05:42
@minjukim55

Copy link
Copy Markdown
Contributor Author

@minjukim55 minjukim55 requested a review from maliberty May 26, 2026 09:24
@maliberty

Copy link
Copy Markdown
Member

@codex review

@maliberty maliberty left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The code looks fine. Does this need a metrics PR?

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Pass a local load_cap computed from BufferedNet wire RC to
resizeToTargetSlew as a hint. When supplied, the hint skips the
expensive ensureWireParasitic + STA loadCap query that triggers an
incremental FastRoute setup per buffer in the repair_design driver
loop.

For repairNetWire, the hint reflects the wire that the buffer actually
drives (buf_dist x wire_cap + ref_cap), not the full Steiner edge.
repairNetJunc passes cap_left / cap_right since the buffer is placed
at the junction location.

Profiling on a large customer design (497k inst) showed
ensureWireParasitic accounting for 96% of repair_design wall time
(5,860 calls x ~390ms FastRoute setup each).

See private issue The-OpenROAD-Project-private/OpenROAD-flow-scripts#1676.

Signed-off-by: Minju Kim <mkim@precisioninno.com>
@minjukim55 minjukim55 force-pushed the secure-rsz-issue1676-v2 branch from dbdd58f to cf5a8f3 Compare May 28, 2026 01:45
@maliberty maliberty merged commit 8ff372b into The-OpenROAD-Project:master May 29, 2026
16 checks passed
@maliberty maliberty deleted the secure-rsz-issue1676-v2 branch May 29, 2026 01:36
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.

2 participants