Skip to content

rsz: repair_timing -path_group takes a group the SDC defines - #12376

Open
oharboe wants to merge 3 commits into
The-OpenROAD-Project:masterfrom
oharboe:rsz-sdc-path-group
Open

oharboe wants to merge 3 commits into
The-OpenROAD-Project:masterfrom
oharboe:rsz-sdc-path-group

Conversation

@oharboe

@oharboe oharboe commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

repair_timing -path_group <name> now repairs a group the SDC defines with group_path. Before, only reg2reg, in2reg, reg2out, in2out and gated_clock were known: any other name warned (RSZ-0227) and repaired every path, so a group could not scope repair.

The change

A name that is not one of the five but names a group the SDC defines is taken as is: an endpoint is repaired when it has a path in that group, and its group slack is the worst of those paths, as for the built-in groups, without their structural endpoint classification. A name that is neither still warns.

A use: a hierarchical design flattened at its top repairs only the paths through the nets between two blocks (group_path -through), so that repair never works on a block's own paths.

Test

repair_timing_path_group7:

  • a group -through one net is repaired, and its worst slack improves;
  • a net named in a group_path -through is destroyed through OpenDB, as a resizer move does, and write_sdc no longer names it;
  • CRIT_VT_SWAP under the group swaps only cells on the group's worst path to each violating endpoint: the test counts the VT swaps repair makes that lie on no path of the group, and expects none. (The fanin cone of the group's endpoints, which the built-in groups use, also feeds those endpoints' paths outside the group.)

rsz's regressions pass, 330 of 330 under //openroad/rsz/....

The integration that uses it: The-OpenROAD-Project/bazel-orfs#1541.

🤖 Generated with Claude Code

-path_group knew only reg2reg, in2reg, reg2out, in2out and gated_clock;
any other name warned (RSZ-0227) and repaired every path. A group made
with group_path, a path group through a set of nets for instance, could
not scope repair.

A name that is not one of the five but names a group the SDC defines is
taken as is: an endpoint is repaired when it has a path in that group,
and its group slack is the worst of those paths, as for the built-in
groups, without their structural endpoint classification.

A use: a hierarchical design flattened at its top repairs only the
paths through the nets between two blocks, so that repair never works
on a block's own paths. OpenSTA's Sdc::deleteNetBefore keeps such a
group sound when repair deletes one of its nets.

repair_timing_path_group7: a group -through one net is repaired, its
worst slack improving; a net named in a group_path -through is
destroyed through OpenDB, as a resizer move does, and write_sdc no
longer names it. CRIT_VT_SWAP still works on the fanin cone of the
group's endpoints that some startpoint reaches, as for the built-in
groups.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe
oharboe requested a review from a team as a code owner November 19, 2026 07:10

@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 support for SDC-defined path groups (via group_path) in the resizer's path group filtering mechanism. It adds a new PathGroupType::kUser enum value, updates PathGroupFilter to recognize and handle these user-defined path groups by their names, and bypasses standard endpoint kind checks for them. Additionally, a new regression test repair_timing_path_group7 is added to verify this functionality. I have no feedback to provide as there are no review comments.

clang-tidy's include cleaner flags the use in groupEndpointSlack, on a
line this pull request changes.

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

kvnloo commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

The same test fell back to unrestricted repair on base but scoped repair to the SDC group at this head.

bazelisk test //openroad/rsz/test:repair_timing_path_group7-tcl_test --test_output=all
4543b6b65b4285823b4f20953dd4a8999f6c3126 (test files only from head): FAIL (exit 3), RSZ-0227, 34 group violations left
e12446c4eb692217d119f442065293e641716cc1: PASS (exit 0), 27 group violations left

Beyond the gcd/ASAP7 test and linked XSTile run, has this been validated on another technology for paths that share an endpoint with the selected group but are outside it?

(AI-assisted review.)

@oharboe

oharboe commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator Author

A curious question. Tell me more about why you ask: is there something in the change that you expect to behave differently on another technology? It is in endpoint selection and in which slack repair judges an endpoint by (PathGroupFilter), and none of it reads the library, so I would not expect a difference.

Here are the measurements I made. ORFS designs after 3_place, every clock scaled so the main clock's period is 0.8 × (period − WNS) as placed, and three runs from the same database: no repair, repair_timing -setup -path_group sel, repair_timing -setup. sel is group_path -name sel -through <nets>: of the worst path of every third violating endpoint (worst first), the net its middle driver pin drives, up to 8 nets. In every row, every endpoint of the group also has paths outside it. Times in ps.

PDK / design endpoints in the group group WNS: before → scoped outside-path WNS at those endpoints: before → scoped (unrestricted) their outside paths under scoped: better / worse (largest loss)
asap7 / aes 44 -78 → -64 -75 → -73 (-65) 28 / 4 (-11)
gf180 / gcd 38 -638 → -296 -503 → -490 (-232) 36 / 1 (-38)
gf180 / ibex 1631 -6438 → -5632 -6350 → -5957 (-5685) 1146 / 399 (-155)
ihp-sg13g2 / aes 48 -531 → -119 -527 → -344 (-220) 32 / 7 (-424)
ihp-sg13g2 / gcd 44 -359 → -324 -235 → -218 (-218) 32 / 8 (-58)
nangate45 / gcd 41 -87 → -82 -82 → -97 (-80) 7 / 28 (-22)
nangate45 / ibex 1627 -1421 → -1259 -1416 → -1314 (-1239) 1627 / 0
sky130hd / gcd 46 -473 → -430 -361 → -411 (-395) 6 / 40 (-176)
sky130hd / ibex 875 -5904 → -5050 -5872 → -5359 (-5205) 867 / 1 (-8)

No RSZ-0227 in any of these runs, and the same picture on all nine. At an endpoint with paths both in the group and outside it, repair looks only at the group's worst path: it stops once that meets the margin and keeps a move that helps the group. The outside paths share cells with the group's, so they move too, in either direction; on nangate45/gcd the design WNS ended worse than before repair (-87 → -101). Closing those is left to a later unrestricted repair.

Not tested: post-CTS databases and CRIT_VT_SWAP (no multi-VT library loaded).

For a group the SDC defines, PathGroupFilter::startpointInGroup accepts
every startpoint, so CRIT_VT_SWAP's group fanout covered the whole
design and its walk took the full fanin cone of the group's violating
endpoints. That cone also feeds the endpoints' paths outside the group:
on gcd/ASAP7 with a group -through one net, 67 of the 125 cells the
phase swapped lay on no path of the group.

Under such a group the phase now takes the cells on the group's worst
path to each violating endpoint (PathGroupFilter::findWorstSlackPath),
nearest the endpoint first, under the same per-endpoint cap. The
built-in groups keep the fanin cone walk; their swaps already all lie
on a path of the group (reg2reg on the same design: 123 swapped, none
off the group).

repair_timing_path_group7 counts the VT swaps repair makes and those
on no path of the group: 69 before, 0 now. The group ends with 28
violating endpoints at -10.750 ps instead of 27 at -9.769 ps: only
each endpoint's worst group path is swapped now, not its whole cone.

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

oharboe commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator Author

While measuring this I found that a group_path -through exception goes stale when a pin on its net is reconnected in a hierarchical design, which pin swapping does. It exists without this change, and with it repair steers by the stale group: #12401.

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