Skip to content

rsz: Use data buffers only for hold repair - #12360

Merged
minjukim55 merged 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:secure-rsz-hold-data-buffers
Nov 18, 2026
Merged

minjukim55 merged 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:secure-rsz-hold-data-buffers

Conversation

@jhkim-pii

Copy link
Copy Markdown
Contributor

Summary

  • Hold repair now uses the same data buffer list as every other resizer operation, so it no longer overrides the resizer buffer state and no longer puts clock buffers on data paths.

Symptom

  • repairHold() overrides exclude_clock_buffers_ and buffer_cells_ with SetAndRestore, but only those two inputs are restored. Derived state (lib_data_, buffer_lowest_drive_, port_buffer_, buffer_fast_sizes_) keeps the clock-inclusive values, and the next command does not rebuild it because buffer_cells_ is non-empty.
  • Every new buffer-derived cache needs its own invalidation around hold repair: #12285 adds four swappable_cells_cache_.clear() calls and #12236 needs extra stale checks for VT library data.
  • Hold repair inserts clock buffers on data paths, which conflicts with keeping data and clock buffers disjoint (#12285).
  • report_buffers names a different hold buffer than the one repair_timing -hold inserts (nangate45, repair_hold1.def):
report_buffers -filtered : BUF_X1 is the buffer chosen for hold fixing
repair_timing -hold      : inserted 8 hold buffers, all CLKBUF_X1

Changes

flowchart LR
  subgraph Before
    A1[repairHold] -->|SetAndRestore exclude_clock_buffers_=false| B1[buffer_cells_ cleared]
    B1 --> C1[resizePreamble rebuilds data + clock list and lib_data_]
    C1 --> D1[restore list only, derived state stays clock-inclusive]
  end
  subgraph After
    A2[repairHold] --> C2[resizePreamble reuses the data buffer list]
  end
Loading
Item Before After
Hold buffer candidates Data and clock buffers (temporary override) Data buffers (shared list)
State override in repairHold() SetAndRestore of exclude_clock_buffers_ and buffer_cells_ None
exclude_clock_buffers_ Member flag, false only during hold repair Removed, clock buffers are always excluded
nangate45 hold buffer CLKBUF_X1 BUF_X1
  • Remove the two SetAndRestore pairs from both repairHold() entry points.
  • Drop exclude_clock_buffers_ and always skip clock buffers in getBufferList() and findBuffersNoPruning().
  • Update 15 hold-related goldens (all nangate45).

Impact

  • Only libraries where a clock buffer wins the hold delay/area metric change behavior. On PDKs with delay cells the selected hold buffer is identical (sky130hd dlygate4sd3_1, gf180 dlyc_2).
  • ORFS default configuration, CTS and GRT metrics are identical for 11 designs (nangate45 aes, dynamic_node, gcd, ibex, jpeg; sky130hd aes, gcd, ibex, jpeg; gf180 aes, ibex). None of them inserts hold buffers.
  • Hold stress test (CTS rerun from the same 3_place.odb with a large HOLD_SLACK_MARGIN); hold TNS is 0 in every run:
Design Hold buffers Before Hold buffers After Stdcell area
nangate45 gcd 103 113 +0.8%
nangate45 aes 322 364 +0.17%
nangate45 ibex 2097 2145 +0.12%
nangate45 jpeg 7476 8294 +0.67%
nangate45 dynamic_node 1989 1989 0%
sky130hd aes / ibex 6 / 1191 6 / 1191 0%
gf180 aes / ibex 58 / 63 58 / 63 0%

Related

  • Clock buffers were allowed for hold repair in #5752 as a temporary measure for nangate45 (tracking issue #5577).
  • Related: #12285, #12236.
Details

Background

  • Why the exception existed: nangate45 has no delay cells, and CLKBUF_X1 has a higher delay than BUF_X1 at the same area. When #5693 excluded clock buffers everywhere, gcd_resize ended with an error because of the hold buffer count, so #5752 kept clock buffers for hold repair "until we have a better approach".
  • Why it is no longer needed: hold buffer selection now filters by delay footprint, VT and site and ranks by delay/area. With data buffers only, gcd_resize inserts 98 instead of 84 hold buffers and repairs every hold violation.
  • Follow-ups this enables: after this change buffer_cells_ is overridden only by repairClkNets(), which runs resizePreamble() before the override, so the buffer-derived data always reflects the data buffer policy. If #12285 lands first, its exclude_clock_buffers_ && condition and the four hold-specific cache clears become unnecessary.

Golden changes

  • gcd_resize (tcl and py): 84 to 98 hold buffers, design area 751 to 762 um^2.
  • repair_hold2, repair_hold7, repair_hold8, repair_hold11, repair_hold_clock_as_data, repair_hold_clock_as_data_clk_tree, repair_timing_path_group5: more BUF_X1 hold buffers instead of CLKBUF_X1; hold WNS stays non-negative.
  • repair_hold1, repair_hold1_hier, repair_hold3, repair_hold12: same buffer count, BUF_X1 instead of CLKBUF_X1, small slack changes.
  • repair_timing_crpr: hold is not fully repairable in this test before or after; hold WNS -0.076 to -0.082.

Testing

  • bazel test //openroad/... //test/...: all tests pass (4965 executed, 4 skipped).
  • clang-format --dry-run --Werror on the changed sources passes.
  • ORFS A/B as described in Impact: BASE is master, TEST is this branch, both runs start from the same 3_place.odb.

What: Hold repair no longer temporarily switches the resizer to a buffer
list that includes clock buffers. Clock buffers are now always excluded
from the data buffer list, so the exclude_clock_buffers_ flag is removed.

Why: Hold repair overrode exclude_clock_buffers_ and buffer_cells_ with
SetAndRestore. Only the two inputs were restored afterwards; the derived
library data, lowest drive buffer, port buffer and fast buffer sizes kept
the values computed for the clock-inclusive list, and every new
buffer-derived cache needed its own invalidation around hold repair. It
also put clock buffers on data paths, which conflicts with keeping data
and clock buffers disjoint, and report_buffers named a different hold
buffer than the one repair_timing -hold actually inserted.

The exception was added because nangate45 has no delay cells. Current
hold buffer selection (delay/area metric with delay-footprint, VT and
site filtering) no longer needs it: on PDKs with delay cells the chosen
hold buffer is unchanged, and on nangate45 BUF_X1 replaces CLKBUF_X1 with
a few more hold buffers and every hold violation still repaired.

How: Remove the two SetAndRestore pairs from both repairHold() entry
points, drop exclude_clock_buffers_, and always skip clock buffers in
getBufferList() and findBuffersNoPruning(). Update the hold goldens.

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
@jhkim-pii jhkim-pii self-assigned this Nov 18, 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 removes the exclude_clock_buffers_ configuration option from the Resizer class, making the exclusion of clock buffers the default behavior. The temporary override of this option in repairHold has been removed. Consequently, standard buffers (BUF_X1) are now consistently used instead of clock buffers (CLKBUF_X1) for hold repairs, and the test golden files have been updated to reflect the updated buffer counts, area, and slack metrics. I have no feedback to provide as there are no review comments.

@jhkim-pii
jhkim-pii marked this pull request as ready for review November 18, 2026 22:06
@jhkim-pii
jhkim-pii requested a review from a team as a code owner November 18, 2026 22:06
@jhkim-pii
jhkim-pii requested a review from minjukim55 November 18, 2026 22:06
@minjukim55
minjukim55 merged commit c1306fa into The-OpenROAD-Project:master Nov 18, 2026
21 checks passed
@minjukim55
minjukim55 deleted the secure-rsz-hold-data-buffers branch November 18, 2026 23:44
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