Skip to content

cts.tcl: drop the CTS_SNAPSHOTS debug checkpoint; the script says what CTS does - #4804

Open
oharboe wants to merge 3 commits into
The-OpenROAD-Project:masterfrom
oharboe:cts-tcl-flow-only
Open

oharboe wants to merge 3 commits into
The-OpenROAD-Project:masterfrom
oharboe:cts-tcl-flow-only

Conversation

@oharboe

@oharboe oharboe commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Before, cts.tcl carried a debug checkpoint, CTS_SNAPSHOTS, and a save_progress helper that printed which make target to type to open it.
Now cts.tcl says only what the CTS step does.

I added the CTS snapshots in #1285. I haven't used them in ages, and I don't think anyone else does at this point. In the three years since, they have cost a string of papercuts and added no function:

That is nine commits by four authors to keep a debug knob in step with the flow it watches.

I left 4_1_error.odb/.sdc alone on purpose (the error path changed in #3697). It is an open question whether they should go too, or whether the other stages not saving an .sdc with their -failed.odb is the omission. That is for a separate pull request.

Why now

  • Less need for debug code in the script. Debugging is now ad-hoc edits in a fast loop, often by an AI: a checkpoint is one orfs_write_db line, added for the session and removed again. Keeping it in the script to save typing no longer pays.
  • Fewer merge conflicts. Lines that are not part of the flow still collide with changes that are.
  • Less confusion for an AI reading the script. When cts.tcl holds only flow concerns, a reader, human or AI, does not have to work out which lines run in the flow and which only serve debugging.

docs/contrib/MakefileContract.md also rules out a default-off toggle that no CI design sets, and no design sets CTS_SNAPSHOTS. The state it wrote (CTS, detailed placement, parasitics, before repair_timing) is what 4_1_cts.odb holds when the flow runs with SKIP_CTS_REPAIR_TIMING=1.

What changes

  • cts.tcl: CTS_SNAPSHOTS and save_progress are removed, along with a doubled blank line.
  • When detailed placement fails, the step still writes 4_1_error.odb and 4_1_error.sdc and calls error, now through orfs_write_db/orfs_write_sdc directly. The file names are the same.
  • CTS_SNAPSHOTS is removed from variables.yaml, and FlowVariables.md is regenerated. variables.json is no longer read and is deleted in flow: delete variables.json #4805.
  • EndpointSlackTracking.md: its example of an intermediate .odb is now 4_1_error.odb.
  • The estimate_parasitics before detailed placement moves inside if { $::env(DETAILED_METRICS) }, along with the metrics stage it is reported under. It was added in 2020 for a repair_clock_nets call the script then made itself. clock_tree_synthesis -repair_clock_nets does that repair now, and the estimate after detailed placement replaces this one before anything is timed, so all it still feeds is the detailed report.

With the default CTS_SNAPSHOTS=0, the flow runs the same commands and writes the same results as before. The only difference is that the hint line save_progress printed before the failure error no longer appears in the log.

Tested

On asap7 gcd, CTS was run with the old and the new cts.tcl, with DETAILED_METRICS=0 and =1. 4_1_cts.odb is byte-identical in all four runs, and 4_1_cts.json has the same keys and values apart from runtimes. With DETAILED_METRICS=0 the log shows two estimate_parasitics calls instead of three.

tclint and tclfmt --check 0.7.0 pass on cts.tcl, and generate-variables-docs.py regenerates FlowVariables.md cleanly. The flow runs are left to CI.

🤖 Generated with Claude Code

CTS_SNAPSHOTS wrote the design before repair_timing so it could be
opened in the GUI, and save_progress printed the make target to type to
open it. Debugging today is ad-hoc edits in a fast loop, where a
checkpoint is one orfs_write_db line added and removed again, so the
script need not carry it. No CI design sets the variable, which the
Makefile contract rules out for a default-off toggle, and with
SKIP_CTS_REPAIR_TIMING=1 4_1_cts.odb is the same pre-repair state.

The failure path still writes 4_1_error.odb and .sdc, now with
orfs_write_db and orfs_write_sdc directly. Nothing else changes.

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

@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 removes the CTS_SNAPSHOTS flow variable and the save_progress helper procedure from the CTS stage. Instead of saving intermediate progress snapshots, the flow now directly writes the 4_1_error.odb and 4_1_error.sdc files upon detailed placement failure. Documentation and variable definitions in variables.json and variables.yaml have been updated accordingly to reflect these removals. I have no feedback to provide as there are no review comments.

oharboe and others added 2 commits November 8, 2026 08:04
variables.json is no longer read since The-OpenROAD-Project#4800, so it is deleted in a pull
request of its own rather than kept in step here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
The estimate before detailed placement was added in 2020 for a
repair_clock_nets call that the script then made itself.
clock_tree_synthesis -repair_clock_nets does that repair now, and the
estimate after detailed placement replaces this one before anything is
timed, so it only feeds the DETAILED_METRICS report. It moves inside
that if, with the metrics stage it is reported under.

On asap7 gcd, 4_1_cts.odb is byte-identical before and after, with
DETAILED_METRICS=0 and =1, and so are the 4_1_cts.json metrics apart
from runtimes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe
oharboe requested review from arthurjolo and jhkim-pii and removed request for jhkim-pii November 8, 2026 07:14
@oharboe

oharboe commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator Author

@jhkim-pii FYI

@openroad-ci

openroad-ci commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

🔍 QoR check

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

Commit 189b73d · Jenkins build #3 · 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