Skip to content

generate_abstract: refuse a model whose max clock tree path is below its min - #4855

Open
oharboe wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
oharboe:abstract-clock-tree-order
Open

oharboe wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
oharboe:abstract-clock-tree-order

Conversation

@oharboe

@oharboe oharboe commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

generate_abstract stops when the timing model it just wrote has a clock pin whose max_clock_tree_path is below its min_clock_tree_path. A parent's CTS balances a hard macro by that max, so such a model clocks the block late in every parent that reads it, and nothing downstream says so: the parent's timing reads the same model and agrees with it. One block of XiangShan had max 216.3/227.4 ps against min 501.1/525.9, and its parent's CTS put the block's clock pin 245 ps late.

The cause of that case is fixed in The-OpenROAD-Project/OpenSTA#481. This is the check that would have stopped it where the model was made, hours before the parent's timing looked wrong.

The change

  • check_clock_tree_paths.tcl: reads a written .lib and stops with FLW-0030, naming the pin, the edge and both values, when a max is below its min.
  • A clock tree path written in a form the check does not read stops it too (FLW-0031), so a change in the writer cannot turn the check into a silent pass.
  • generate_abstract.tcl runs it on each model it writes.

The check is necessary, not sufficient: a bound that is wrong but on the right side of the other passes it.

Test

No new test in this PR. Run in OpenROAD on a model write_timing_model wrote (OpenSTA's write_timing_model8.ok) and on edits of it:

model result
as written (min = max = 0) passes
min 0.10/0.11, max 0.30/0.31 passes
min 0.5011/0.5259, max 0.2163/0.2274 FLW-0030, rise
max below min on fall only FLW-0030, fall
one clock tree path in another table form FLW-0031

🤖 Generated with Claude Code

…its min

A parent's CTS balances a hard macro by the max_clock_tree_path on its
clock pin: pin arrival plus that number against the parent's registers.
A model whose max lies below its min clocks the block late in every
parent that reads it, and nothing downstream says so: the parent's
timing reads the same model and agrees with it.

generate_abstract now reads each model it writes back and stops
(FLW-0030) on a clock pin whose max_clock_tree_path, rise or fall, is
below its min_clock_tree_path. One block of XiangShan had max
216.3/227.4 ps against min 501.1/525.9: write_timing_model wrote a
nested macro's pin arrival without the macro's own tree (fixed in
OpenSTA The-OpenROAD-Project#481), and the parent's CTS put the block's clock pin 245 ps
late. A clock tree path written in a form the check does not read stops
it too (FLW-0031), so a change in the writer cannot turn the check into
a silent pass.

The check is necessary, not sufficient: a bound that is wrong but on
the right side of the other passes it.

Co-Authored-By: Claude Fable 5.2 <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 introduces a new Tcl script, check_clock_tree_paths.tcl, which defines a procedure to verify that the maximum clock tree path is not below the minimum clock tree path in timing models, and integrates this check into the abstract generation process. The review feedback recommends making the regular expressions in the script more robust by allowing optional whitespace around colons and parentheses to prevent potential silent failures due to formatting variations in the timing model files.

Comment thread flow/scripts/check_clock_tree_paths.tcl Resolved
Comment thread flow/scripts/check_clock_tree_paths.tcl Resolved
Comment thread flow/scripts/check_clock_tree_paths.tcl Resolved
… path

The expressions read "timing_type : " and "pin(" with exactly the
spacing write_timing_model uses today. Written with other spacing, a
path was neither read nor counted, and the model passed unchecked.

The colon and the pin group's parentheses now take any spacing, the
count of what was written looks for the bare min/max_clock_tree_path
token so a form the reader misses still stops (FLW-0031), and a path
that sits in no pin group the reader can find stops too (FLW-0032).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@openroad-ci

openroad-ci commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

🔍 QoR check

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

Commit 91f89ab · Jenkins build #2 · Baseline: build · View build on dashboard

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

⚠️ 61 design(s) were compared against an approximate baseline, not the build at this PR's merge base, so changes already on the target branch can show up as regressions.

@oharboe
oharboe requested a review from maliberty November 19, 2026 13:03
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