Skip to content

rsz: Add presizing mode for global sizing (Not for merge)#10669

Draft
jhkim-pii wants to merge 6 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:secure-gs-lvt-presize
Draft

rsz: Add presizing mode for global sizing (Not for merge)#10669
jhkim-pii wants to merge 6 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:secure-gs-lvt-presize

Conversation

@jhkim-pii

@jhkim-pii jhkim-pii commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

This PR is not for merge, but for sharing a code implementation.

Summary

Add presizing feature for global sizing.

  • Global sizing depends on the initial sizing state. As per my experiments, presizing instances with strongest cells (max-size & lowest-Vt) showed a better QoR.

UI

Add a new envar RSZ_GLOBAL_SIZING_PRESIZE_MODE for test.

RSZ_GLOBAL_SIZING_PRESIZE_MODE = 0: Disable presizing
RSZ_GLOBAL_SIZING_PRESIZE_MODE = 1: Presizing instances with min-size & highest-Vt cells
RSZ_GLOBAL_SIZING_PRESIZE_MODE = 2: Presizing instances with max-size & lowest-Vt cells

Related

Import the global sizing flow from PR The-OpenROAD-Project#10599 as a single local commit.

Add the LR subproblem implementation, global sizing policy, Tcl entry points, and regression coverage needed to drive the global sizing optimization mode.

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
Presize editable logic cells before global sizing when requested by the global sizing presize mode.

Cache swappable-cell selections by source Liberty cell, include presize changes in the resizer journal rollback point, and add regression coverage for the presize flow.

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
Refresh the global sizing Verilog golden to match the corrected PR The-OpenROAD-Project#10599 behavior on the current OpenROAD base.

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
…ate/OpenROAD into secure-gs-lvt-presize

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
@jhkim-pii jhkim-pii self-assigned this Jun 16, 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 a Lagrangian-Relaxation-driven global sizing and Vt assignment optimization phase (GLOBAL_SIZING) to the resizer, including the LRSubproblem and GlobalSizingPolicy classes, as well as concurrent-safe overloads in Resizer. The code review feedback highlights a potential null pointer dereference in applyPresize when an instance lacks a valid liberty cell, redundant calls to worstSlack and journalBegin in the optimization loop, and a recommendation to explicitly check for missing input ports using findLibertyPort rather than relying on zero capacitance.

Comment thread src/rsz/src/policy/GlobalSizingPolicy.cc
Comment thread src/rsz/src/policy/GlobalSizingPolicy.cc
Comment thread src/rsz/src/LRSubproblem.cc
@jhkim-pii jhkim-pii changed the title rsz: Add global sizing LVT presize rsz: Add presizing mode for global sizing Jun 16, 2026
@jhkim-pii jhkim-pii changed the title rsz: Add presizing mode for global sizing rsz: Add presizing mode for global sizing (Not for merge) Jun 16, 2026
@jhkim-pii

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ddfb98c6ff

ℹ️ 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".

const float wns_eps = 1e-12f;
LRParams iter_params = lr_params_;

float best_wns = wns_pre;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Checkpoint presize before early exit

When RSZ_GLOBAL_SIZING_PRESIZE_MODE is enabled and presizing alone raises WNS to setup_slack_margin, the loop exits at the first top-of-loop check before any journalEnd() checkpoint is taken; the unconditional journalRestore() at the end then rolls the presize changes back because best_wns is still seeded from the pre-presize WNS. This makes presize mode silently leave the netlist unchanged in the fast-success case, so checkpoint after applyPresize() or seed best_wns from the post-presize WNS before the early-exit check.

Useful? React with 👍 / 👎.

Add direct includes for size_t and LibertyCellSeq in GlobalSizingPolicy.cc so include-cleaner does not rely on transitive headers.

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
Record the presize replacement count in the global sizing policy and checkpoint the presize ECO before the LR loop can terminate early. This prevents the final journal restore from rolling back a successful presize-only pass while keeping subsequent LR sweeps journaled independently.

Update the global sizing presize golden output to reflect the preserved lower-area checkpoint selected by the corrected journal flow.

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.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