Repository navigation
Conversation
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>
There was a problem hiding this comment.
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.
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>
🔍 QoR checkMetrics reflect the PR merge build — i.e. what will land on the target branch. Commit 20 design(s) checked — 0 with regression(s), 7 without a comparable baseline. |
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.
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.orfs_write_db/orfs_copy_dbinflow/scripts/util.tcl, so it also runs in the single-processflow.tclflow.open.tcl: none for steps 1–2,-placementfor 3–4,-global_routingfor 5–6. The model used is stored in each snapshot.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.flow/util/endpointSlack.py(stdlib only) withlist,track,compareandexport.compare -o page.htmlandtrack --html DIRwrite 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.trackadds an index of every step transition.--tolerance).docs/contrib/EndpointSlackTracking.md, linked from the Developer's Guide indocs/toc.yml.variables.yamlis updated and the generatedvariables.jsonandFlowVariables.mdare 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.REPORT_ENDPOINT_SLACK=1: 16 snapshots. WNS/TNS match the flow's own reports at detailed place, CTS and global route.6_finish.rptdiffers because it uses the extracted SPEF. Final QoR is identical to a run without the variable.flow.tclmode. By inspection the hooks only write.jsonfiles, whichflow_sourceallows.