Repository navigation
open.tcl: WIRE_LOAD_MODEL, a wire-load model for timing before placement - #4619
Conversation
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>
There was a problem hiding this comment.
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.
🔍 QoR checkMetrics reflect the PR merge build — i.e. what will land on the target branch. Commit 62 design(s) checked — 0 with regression(s), 0 without a comparable baseline. |
|
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? |
|
Good question. I looked it up: OpenSTA stopped honouring the Liberty parallaxsw/OpenSTA@b697aa1 ("remove support for liberty default_wire_load", James Cherry, 2022-07-03) That commit removed the fallback in 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. |
|
I'll pursue why that is separately. |
| parasitics, so placed and routed timing is unaffected. An unknown name | ||
| is an error. Empty, the default, applies none. | ||
| type: string | ||
| WIRE_LOAD_LIB: |
There was a problem hiding this comment.
Why make a special variable for this when we already have ADDITIONAL_LIBS?
There was a problem hiding this comment.
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>
| if { $design_stage < 3 } { | ||
| # Before placement: no net has parasitics to estimate. | ||
| apply_wire_load_model | ||
| } |
There was a problem hiding this comment.
No need for the guard. If we have parasitics its a no-op and if we don't we want the right model.
There was a problem hiding this comment.
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>
Proposal
When timing is read on a synth or floorplan result, it charges no wire delay. No net has parasitics yet, and
read_timingestimates 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:
WIRE_LOAD_MODELwire_loadgroup.read_timingapplies it withset_wire_load_modelwhen the design stage is before placement. Empty (the default) applies none.WIRE_LOAD_LIBwire_loadgroup of their own (asap7).The new code is 13 lines in
util.tcland 4 inopen.tcl. The rest is the variables (yaml, json, regenerated docs).Measured on nangate45/gcd
WIRE_LOAD_MODEL1_synth.odb1_synth.odb1K_hvratio_1_11_synth.odb5K_hvratio_1_13_place.odb3_place.odb5K_hvratio_1_1default_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:
WIRE_LOAD_LIBstops with "cannot read file".WIRE_LOAD_LIBwas checked with a Liberty file that holds nothing but awire_loadgroup.Design questions
WIRE_LOAD_TCL, a script sourced byopen.tcl). This PR proposes the declarative pair instead: no arbitrary script to review, and the flow owns the command.read_timinginopen.tcl, for synth and floorplan results.floorplan.tclalso times the design before placement (repair_timing_helper). Applying the model there would change floorplan QoR, andwrite_sdccould carryset_wire_load_modelinto2_floorplan.sdcand so into every later stage. Left out of this PR; worth deciding separately.wire_loadgroups and could get a default in theirconfig.mklater. asap7 would need aWIRE_LOAD_LIB.stages:list. Onlyopen.tclreads the variables, and the model is inert once parasitics exist.tclfmt,tclint0.7.0 andyamlfixare clean, andvariables.json/FlowVariables.mdare regenerated.🤖 Generated with Claude Code