Skip to content

Track endpoint slack across flow steps - #4647

Merged
maliberty merged 2 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:endpoint-slack-tracking
Oct 8, 2026
Merged

maliberty merged 2 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:endpoint-slack-tracking

Conversation

@maliberty

Copy link
Copy Markdown
Member

Summary

Adds a way to see how the slack of every timing endpoint moves from one flow step to the next, not just WNS/TNS.

  • Recording: REPORT_ENDPOINT_SLACK=1 (default 0). Every step writes the setup and hold slack of every endpoint to $REPORTS_DIR/<step>_endpoint_slack.json, e.g. 3_3_place_gp_endpoint_slack.json.
    • The hook is in orfs_write_db / orfs_copy_db in flow/scripts/util.tcl, so it also runs in the single-process flow.tcl flow.
    • Steps that only copy their input reuse or recompute the previous snapshot.
    • Parasitics are chosen by step number, as in open.tcl: none for steps 1–2, -placement for 3–4, -global_routing for 5–6. The model used is stored in each snapshot.
    • Timing is updated before reading sta::endpoints. Otherwise the cached endpoint set misses gated-clock enable checks when the clock network hasn't been built yet. This was seen on nangate45/ibex _26153_/A1.
  • Analysis: flow/util/endpointSlack.py (stdlib only) with list, track, compare and export.
    • compare -o page.html and track --html DIR write self-contained interactive HTML: a canvas slack scatter (A vs B, y = x line, zoom, hover), WNS/TNS, and improved/degraded/newly failing/newly passing counts. Agreement metrics on the critical endpoints: Spearman, top agreement, bias/MAE/RMSE, violator recall/precision. track adds an index of every step transition.
    • Endpoints with positive slack in both steps are not considered. Changes below the displayed resolution count as unchanged (--tolerance).
  • Docs: docs/contrib/EndpointSlackTracking.md, linked from the Developer's Guide in docs/toc.yml. variables.yaml is updated and the generated variables.json and FlowVariables.md are regenerated.

Testing

  • python3 flow/test/test_endpointSlack.py: 8 tests covering loading, comparison, metrics, tolerance, index row classes and the CLI. The test runs in the existing util CI job.
  • nangate45/gcd full flow with REPORT_ENDPOINT_SLACK=1: 16 snapshots. WNS/TNS match the flow's own reports at detailed place, CTS and global route. 6_finish.rpt differs because it uses the extracted SPEF. Final QoR is identical to a run without the variable.
  • A floorplan + place run without the variable writes no snapshot files.
  • asap7/swerv_wrapper: about 30k endpoints, about 1 MB and about 10 s per snapshot (mostly the timing update).
  • Also exercised on nangate45/ibex and jpeg.
  • Not exercised: the single-process flow.tcl mode. By inspection the hooks only write .json files, which flow_source allows.

Add REPORT_ENDPOINT_SLACK: when set, every flow step writes the setup and
hold slack of every timing endpoint to
$REPORTS_DIR/<step>_endpoint_slack.json, timed with parasitics chosen by
step as in open.tcl. Timing is updated before reading the endpoint set,
which otherwise misses gated clock enable checks.

flow/util/endpointSlack.py lists, exports, tracks and compares snapshots.
Comparisons report endpoint movement and agreement metrics (Spearman, top
agreement, bias/MAE/RMSE, violator recall/precision) on the critical
endpoints, and write interactive HTML slack scatters; track --html writes
one per step transition plus an index whose rows are grey when nothing
changed and green when everything improved. Endpoints with positive slack
in both steps are not considered, and changes below the displayed
resolution (--tolerance) count as unchanged. Numbers use a fixed-width
font with a fixed number of decimals (--digits).

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
@maliberty maliberty self-assigned this Oct 8, 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 feature to track and analyze setup and hold slack of timing endpoints across flow steps by generating JSON snapshots when REPORT_ENDPOINT_SLACK is enabled. It includes a Python utility for comparing snapshots, comprehensive documentation, and unit tests. The review feedback highlights critical compatibility and robustness issues: using statistics.correlation in Python requires version 3.10 or newer, which may fail in older environments, and directly referencing $::env(REPORT_ENDPOINT_SLACK) in Tcl without verifying its existence first can crash the flow if the environment variable is undefined.

Comment thread flow/util/endpointSlack.py Resolved
Comment thread flow/scripts/util.tcl Resolved
Comment thread flow/scripts/util.tcl Resolved
The 6_final snapshot was written by orfs_write_db before parasitic
extraction, so it was timed with global routing estimates. Those
overestimate short nets and were about 0.25 ns pessimistic on
sky130hd/riscv32i compared with the extracted SPEF.

Write the 6_final snapshot in final_outputs.tcl after extraction instead,
using the loaded parasitics (rcx, or global_routing on platforms without
RCX_RULES) so it matches 6_finish.rpt. write_endpoint_slack takes an
optional parasitics name to skip its own estimation, and orfs_write_db
can skip the snapshot.

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
@maliberty
maliberty merged commit e54722b into The-OpenROAD-Project:master Oct 8, 2026
11 of 13 checks passed
@maliberty
maliberty deleted the endpoint-slack-tracking branch October 8, 2026 06:29
@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 e98c1b9 · Jenkins build #2 · Baseline: build · View build on dashboard

20 design(s) checked — 0 with regression(s), 7 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