Skip to content

open.tcl: WIRE_LOAD_MODEL, a wire-load model for timing before placement - #4619

Merged
maliberty merged 3 commits into
The-OpenROAD-Project:masterfrom
oharboe:wire-load-model
Oct 6, 2026
Merged

maliberty merged 3 commits into
The-OpenROAD-Project:masterfrom
oharboe:wire-load-model

Conversation

@oharboe

@oharboe oharboe commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

Proposal

When timing is read on a synth or floorplan result, it charges no wire delay. No net has parasitics yet, and read_timing estimates none before placement, so reports and GUI sessions there show optimistic paths that placement then contradicts. A Liberty wire-load model is the standard pre-placement estimate, and OpenSTA applies one only to nets that have no parasitics.

This PR adds two variables:

variable meaning
WIRE_LOAD_MODEL Name of a Liberty wire_load group. read_timing applies it with set_wire_load_model when the design stage is before placement. Empty (the default) applies none.
WIRE_LOAD_LIB Optional Liberty file to read first, for a platform whose libraries define no wire_load group of their own (asap7).

The new code is 13 lines in util.tcl and 4 in open.tcl. The rest is the variables (yaml, json, regenerated docs).

Measured on nangate45/gcd

result WIRE_LOAD_MODEL WNS (ns) TNS (ns)
1_synth.odb unset -0.18 -6.92
1_synth.odb 1K_hvratio_1_1 -0.20 -7.77
1_synth.odb 5K_hvratio_1_1 -0.20 -7.95
3_place.odb unset -0.18 -7.76
3_place.odb 5K_hvratio_1_1 -0.18 -7.76
  • With the 1K model, the synth result's TNS (-7.77 ns) is within 0.01 ns of what the placed design reports (-7.76 ns).
  • Placed timing is identical with and without the model.
  • The library's default_wire_load (5K_hvratio_1_1) is not applied by OpenSTA on its own: the unset row differs from the 5K row.

The failure cases stop the script rather than continuing:

  • an unknown model name stops with STA-0480;
  • a missing WIRE_LOAD_LIB stops with "cannot read file".

WIRE_LOAD_LIB was checked with a Liberty file that holds nothing but a wire_load group.

Design questions

  1. Declarative or a hook. bazel-orfs carries a hook today (WIRE_LOAD_TCL, a script sourced by open.tcl). This PR proposes the declarative pair instead: no arbitrary script to review, and the flow owns the command.
  2. Where it applies. Only read_timing in open.tcl, for synth and floorplan results. floorplan.tcl also times the design before placement (repair_timing_helper). Applying the model there would change floorplan QoR, and write_sdc could carry set_wire_load_model into 2_floorplan.sdc and so into every later stage. Left out of this PR; worth deciding separately.
  3. Platform defaults. Opt-in for now. nangate45, sky130hd and ihp-sg13g2 ship wire_load groups and could get a default in their config.mk later. asap7 would need a WIRE_LOAD_LIB.
  4. Stages. No stages: list. Only open.tcl reads the variables, and the model is inert once parasitics exist.

tclfmt, tclint 0.7.0 and yamlfix are clean, and variables.json/FlowVariables.md are regenerated.

🤖 Generated with Claude Code

Timing read on a synth or floorplan result charges no wire delay: no net
has parasitics yet and read_timing estimates none before placement, so
reports and GUI sessions there read optimistic paths that placement
then contradicts. On nangate45/gcd the synth result reads TNS -6.92 ns
where the placed design reads -7.76 ns; with the library's own
1K_hvratio_1_1 model the synth result reads -7.77 ns. OpenSTA does not
apply a library's default_wire_load by itself.

WIRE_LOAD_MODEL names a Liberty wire_load group, applied with
set_wire_load_model by read_timing when the design stage is before
placement. WIRE_LOAD_LIB optionally names a Liberty file to read first,
for a platform whose libraries define no wire_load group (asap7).
OpenSTA applies a wire-load model only to nets without parasitics, so
placed and routed timing is unchanged (nangate45/gcd place: TNS -7.76
ns with and without). An unknown model name or a missing WIRE_LOAD_LIB
stops the script.

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 introduces support for statistical wire-load models before placement by adding two new configuration variables, WIRE_LOAD_LIB and WIRE_LOAD_MODEL, along with their documentation and integration into the flow scripts. Feedback on the changes suggests adding validation to ensure that the file specified by WIRE_LOAD_LIB exists and is readable before attempting to load it, which would prevent potential runtime errors.

Comment thread flow/scripts/util.tcl Resolved
@oharboe
oharboe requested a review from maliberty October 4, 2026 08:27
@openroad-ci

openroad-ci commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

🔍 QoR check

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

Commit 3ffec13 · Jenkins build #3 · Baseline: build · View build on dashboard

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

@maliberty

Copy link
Copy Markdown
Member

I find your example odd as the Liberty has

default_wire_load : "5K_hvratio_1_1" ;

So why is default not the same as 5K_hvratio_1_1?

@oharboe

oharboe commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Good question. I looked it up: OpenSTA stopped honouring the Liberty default_wire_load on purpose, in 2.3.2:

parallaxsw/OpenSTA@b697aa1 ("remove support for liberty default_wire_load", James Cherry, 2022-07-03)

That commit removed the fallback in Sdc.cc and changed DmpDelayCalc, LumpedCapDelayCalc and ArnoldiDelayCalc to use only the wire load set by SDC. The ChangeLog entry reads: "The liberty default_wire_load is now ignored. You must explicitly set the wire load model with the set_wire_load_model command to apply wire load model based parasitics." The commit message doesn't say why.

The Liberty reader still parses the attribute, but no delay calculator reads it. So in the table, "unset" means no wire load at all, not the library's 5K default.

Please advise.

@maliberty

Copy link
Copy Markdown
Member

I'll pursue why that is separately.

Comment thread flow/scripts/variables.yaml Outdated
parasitics, so placed and routed timing is unaffected. An unknown name
is an error. Empty, the default, applies none.
type: string
WIRE_LOAD_LIB:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why make a special variable for this when we already have ADDITIONAL_LIBS?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed, dropped in 1125964. A Liberty file holding only a wire_load group goes in ADDITIONAL_LIBS: on asap7/gcd that leaves the synth and floorplan results bit-identical, and set_wire_load_model finds the model.

… file

WIRE_LOAD_LIB read one extra Liberty file before set_wire_load_model,
for a platform whose libraries define no wire_load group (asap7).
ADDITIONAL_LIBS already does that: it is part of LIB_FILES, which every
stage reads, and set_wire_load_model -name searches all loaded
libraries.

On asap7/gcd with a Liberty file holding only a wire_load group in
ADDITIONAL_LIBS, ABC receives it as one more -liberty, and
1_2_yosys.v, 1_synth.odb and 2_floorplan.odb are bit-identical with
and without it. set_wire_load_model then finds the model on the synth
result, and an unknown name still stops with STA-0480.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe
oharboe requested a review from maliberty October 5, 2026 18:23
Comment thread flow/scripts/open.tcl Outdated
Comment on lines +53 to +56
if { $design_stage < 3 } {
# Before placement: no net has parasitics to estimate.
apply_wire_load_model
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No need for the guard. If we have parasitics its a no-op and if we don't we want the right model.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done in 46c0b5c: guard dropped, and apply_wire_load_model inlined into read_timing.

OpenSTA applies a wire-load model only to nets without parasitics, so
the design_stage guard is redundant: with parasitics the model is a
no-op, without them it is the model we want. With the guard gone,
apply_wire_load_model has a single two-line body and is inlined into
read_timing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe
oharboe requested a review from maliberty October 5, 2026 20:59
@maliberty
maliberty merged commit 330211e into The-OpenROAD-Project:master Oct 6, 2026
6 of 12 checks passed
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.

3 participants