Skip to content

grt: prefix incremental global route metrics with their step - #4828

Merged
maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:grt-incremental-metrics-stage
Nov 12, 2026
Merged

maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:grt-incremental-metrics-stage

Conversation

@maliberty

@maliberty maliberty commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Summary

Each global_route -end_incremental in global_route.tcl reports the same global_route__* and dpl__* metrics as the initial route, so 5_1_grt.json held up to four copies of each key, and only the last survived a JSON parse.

Each incremental block (after repair_design, repair_timing and recover_power) now runs under its own nested metrics stage via utl::push_metrics_stage, as cts.tcl already does. That gives keys such as:

  • globalroute__repair_design__global_route__vias, globalroute__repair_design__dpl__total__moves
  • globalroute__repair_timing__global_route__wirelength
  • globalroute__recover_power__global_route__detour__ratio

The unprefixed globalroute__global_route__* keys now describe the initial route only. No design rules/metrics_limits file or flow/util script reads these keys.

Companion to The-OpenROAD-Project/OpenROAD#12263, which stops the per-reroute FastRoute metrics that otherwise repeat inside the repair_timing block.

Each global_route -end_incremental reports the same global_route__*
and dpl__* metrics as the initial route, so 5_1_grt.json held up to
four copies of each key and only the last survived a JSON parse.

Scope the incremental block after repair_design, repair_timing and
recover_power with a nested metrics stage, giving keys such as
globalroute__repair_timing__global_route__vias. The unprefixed
globalroute__global_route__* keys now describe the initial route.

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
@maliberty maliberty self-assigned this Nov 12, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T14:57:44.282426Z 3c7c5a4 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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 adds metrics stage tracking using utl::push_metrics_stage and utl::pop_metrics_stage around the repair design, repair timing, and recover power steps in flow/scripts/global_route.tcl. The feedback correctly identifies that since the parent metrics stage is already set to globalroute__{}, prefixing the new stages with globalroute__ results in redundant double-prefixing. It is recommended to simplify the stage names to repair_design__{}, repair_timing__{}, and recover_power__{} respectively.

Comment thread flow/scripts/global_route.tcl Resolved
Comment thread flow/scripts/global_route.tcl Resolved
Comment thread flow/scripts/global_route.tcl Resolved

@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: 3c7c5a48a4

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

report_metrics 5 "global route post repair timing"
}

utl::push_metrics_stage "globalroute__repair_timing__{}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Extract the repeated metrics-stage idiom into util.tcl

The new push/body/pop metrics-scoping pattern is repeated around all three incremental-routing blocks. The mandatory docs/contrib/TclContract.md explicitly requires that “An idiom a change needs in two places becomes a proc in util.tcl.” Introduce a shared scope-management helper there and reuse it for the three blocks instead of adding independently maintained push/pop pairs.

AGENTS.md reference: AGENTS.md:L5-L5

Useful? React with 👍 / 👎.


# Running DPL to fix overlapped instances
# Run to get modified net by DPL
utl::push_metrics_stage "globalroute__repair_design__{}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove the redundant quotes from the new stage formats

The mandatory docs/contrib/TclContract.md prohibits “quotes or braces it does not need.” Each newly added stage format is already a single literal Tcl word: the embedded {} remains literal without surrounding quotes. Verification with tclsh confirms that the quoted and bare forms produce identical arguments, so remove the unnecessary double quotes from all three additions to satisfy the stage-script contract.

AGENTS.md reference: AGENTS.md:L5-L5

Useful? React with 👍 / 👎.

@maliberty
maliberty merged commit 158a667 into The-OpenROAD-Project:master Nov 12, 2026
11 of 12 checks passed
@maliberty
maliberty deleted the grt-incremental-metrics-stage branch November 12, 2026 16:57
@openroad-ci

Copy link
Copy Markdown
Member

🔍 QoR check

Metrics reflect the PR merge build — i.e. what will land on the target branch.

Commit 4dcb507 · Jenkins build #1 · Baseline: build · View build on dashboard

62 design(s) checked — 0 with regression(s), 0 without a comparable baseline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants