From 70f4147686d858b35cd867facfddcff937a3de8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Sun, 4 Oct 2026 10:24:14 +0200 Subject: [PATCH 1/3] open.tcl: WIRE_LOAD_MODEL, a wire-load model for timing before placement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Øyvind Harboe --- docs/user/FlowVariables.md | 4 ++++ flow/scripts/open.tcl | 4 ++++ flow/scripts/util.tcl | 13 +++++++++++++ flow/scripts/variables.json | 8 ++++++++ flow/scripts/variables.yaml | 14 ++++++++++++++ 5 files changed, 43 insertions(+) diff --git a/docs/user/FlowVariables.md b/docs/user/FlowVariables.md index 47dcd08162..3674906ba7 100644 --- a/docs/user/FlowVariables.md +++ b/docs/user/FlowVariables.md @@ -336,6 +336,8 @@ configuration file. | VERILOG_TOP_PARAMS| Apply toplevel params (if exist). Passed in as a list of key value pairs in tcl syntax; separated by spaces: PARAM1 VALUE1 PARAM2 VALUE2| | | VIA_IN_PIN_MAX_LAYER| Passed as -via_in_pin_top_layer to pin_access and detailed_route.| | | VIA_IN_PIN_MIN_LAYER| Passed as -via_in_pin_bottom_layer to pin_access and detailed_route.| | +| WIRE_LOAD_LIB| Liberty file read before applying WIRE_LOAD_MODEL, for a platform whose libraries define no wire_load group of their own. Optional.| | +| WIRE_LOAD_MODEL| Name of a Liberty wire_load group applied with set_wire_load_model when timing is read before placement (open.tcl on a synth or floorplan result), where no net has parasitics yet and paths otherwise carry no wire delay. OpenSTA applies a wire-load model only to nets without parasitics, so placed and routed timing is unaffected. An unknown name is an error. Empty, the default, applies none.| | | WRITE_ODB_AND_SDC_EACH_STAGE| Save out .sdc and .odb file after each stage, useful to disable when using a single OpenROAD instance to run all stages of the flow.| 1| | YOSYS_FLAGS| Flags to pass to yosys.| -v 3| ## synth variables @@ -679,4 +681,6 @@ configuration file. - [TAP_CELL_NAME](#TAP_CELL_NAME) - [TECH_LEF](#TECH_LEF) - [USE_FILL](#USE_FILL) +- [WIRE_LOAD_LIB](#WIRE_LOAD_LIB) +- [WIRE_LOAD_MODEL](#WIRE_LOAD_MODEL) diff --git a/flow/scripts/open.tcl b/flow/scripts/open.tcl index c9241ca506..830850bf6b 100644 --- a/flow/scripts/open.tcl +++ b/flow/scripts/open.tcl @@ -50,6 +50,10 @@ proc read_timing { input_file } { } else { log_cmd source $::env(PLATFORM_DIR)/setRC.tcl } + if { $design_stage < 3 } { + # Before placement: no net has parasitics to estimate. + apply_wire_load_model + } if { $design_stage >= 4 } { # CTS has run, so propagate clocks set_propagated_clock [all_clocks] diff --git a/flow/scripts/util.tcl b/flow/scripts/util.tcl index 912762199a..a6c9406ef9 100644 --- a/flow/scripts/util.tcl +++ b/flow/scripts/util.tcl @@ -168,6 +168,19 @@ proc find_macros { } { return $macros } +# A statistical wire-load model for timing read before placement, when no +# net has parasitics yet. OpenSTA applies it only to nets without +# parasitics. set_wire_load_model stops on an unknown name. +proc apply_wire_load_model { } { + if { ![env_var_exists_and_non_empty WIRE_LOAD_MODEL] } { + return + } + if { [env_var_exists_and_non_empty WIRE_LOAD_LIB] } { + log_cmd read_liberty $::env(WIRE_LOAD_LIB) + } + log_cmd set_wire_load_model -name $::env(WIRE_LOAD_MODEL) +} + proc erase_non_stage_variables { stage_name } { if { $::env(KEEP_VARS) } { return diff --git a/flow/scripts/variables.json b/flow/scripts/variables.json index b73bc809b7..9bf92acdfa 100644 --- a/flow/scripts/variables.json +++ b/flow/scripts/variables.json @@ -1538,6 +1538,14 @@ "route" ] }, + "WIRE_LOAD_LIB": { + "description": "Liberty file read before applying WIRE_LOAD_MODEL, for a platform whose\nlibraries define no wire_load group of their own. Optional.\n", + "type": "string" + }, + "WIRE_LOAD_MODEL": { + "description": "Name of a Liberty wire_load group applied with set_wire_load_model when\ntiming is read before placement (open.tcl on a synth or floorplan\nresult), where no net has parasitics yet and paths otherwise carry no\nwire delay. OpenSTA applies a wire-load model only to nets without\nparasitics, so placed and routed timing is unaffected. An unknown name\nis an error. Empty, the default, applies none.\n", + "type": "string" + }, "WRITE_ODB_AND_SDC_EACH_STAGE": { "default": 1, "description": "Save out .sdc and .odb file after each stage, useful to disable when using a single OpenROAD instance to run all stages of the flow.\n", diff --git a/flow/scripts/variables.yaml b/flow/scripts/variables.yaml index 9f4b15500e..b0aa02966d 100644 --- a/flow/scripts/variables.yaml +++ b/flow/scripts/variables.yaml @@ -533,6 +533,20 @@ LAYER_PARASITICS_FILE: description: | Path to per layer parasitics file. Defaults to $(PLATFORM_DIR)/setRC.tcl. type: string +WIRE_LOAD_MODEL: + description: | + Name of a Liberty wire_load group applied with set_wire_load_model when + timing is read before placement (open.tcl on a synth or floorplan + result), where no net has parasitics yet and paths otherwise carry no + wire delay. OpenSTA applies a wire-load model only to nets without + parasitics, so placed and routed timing is unaffected. An unknown name + is an error. Empty, the default, applies none. + type: string +WIRE_LOAD_LIB: + description: | + Liberty file read before applying WIRE_LOAD_MODEL, for a platform whose + libraries define no wire_load group of their own. Optional. + type: string TAPCELL_TCL: description: | Path to Endcap and Welltie cells file. From 112596490d793f407cf88d0f51fc57d32337eccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Mon, 5 Oct 2026 20:21:34 +0200 Subject: [PATCH 2/3] open.tcl: drop WIRE_LOAD_LIB, ADDITIONAL_LIBS already reads a Liberty file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Øyvind Harboe --- docs/user/FlowVariables.md | 4 +--- flow/scripts/util.tcl | 3 --- flow/scripts/variables.json | 6 +----- flow/scripts/variables.yaml | 9 +++------ 4 files changed, 5 insertions(+), 17 deletions(-) diff --git a/docs/user/FlowVariables.md b/docs/user/FlowVariables.md index 3674906ba7..13cb129301 100644 --- a/docs/user/FlowVariables.md +++ b/docs/user/FlowVariables.md @@ -336,8 +336,7 @@ configuration file. | VERILOG_TOP_PARAMS| Apply toplevel params (if exist). Passed in as a list of key value pairs in tcl syntax; separated by spaces: PARAM1 VALUE1 PARAM2 VALUE2| | | VIA_IN_PIN_MAX_LAYER| Passed as -via_in_pin_top_layer to pin_access and detailed_route.| | | VIA_IN_PIN_MIN_LAYER| Passed as -via_in_pin_bottom_layer to pin_access and detailed_route.| | -| WIRE_LOAD_LIB| Liberty file read before applying WIRE_LOAD_MODEL, for a platform whose libraries define no wire_load group of their own. Optional.| | -| WIRE_LOAD_MODEL| Name of a Liberty wire_load group applied with set_wire_load_model when timing is read before placement (open.tcl on a synth or floorplan result), where no net has parasitics yet and paths otherwise carry no wire delay. OpenSTA applies a wire-load model only to nets without parasitics, so placed and routed timing is unaffected. An unknown name is an error. Empty, the default, applies none.| | +| WIRE_LOAD_MODEL| Name of a Liberty wire_load group applied with set_wire_load_model when timing is read before placement (open.tcl on a synth or floorplan result), where no net has parasitics yet and paths otherwise carry no wire delay. OpenSTA applies a wire-load model only to nets without parasitics, so placed and routed timing is unaffected. An unknown name is an error. Empty, the default, applies none. A platform whose libraries define no wire_load group can supply one in a Liberty file listed in ADDITIONAL_LIBS.| | | WRITE_ODB_AND_SDC_EACH_STAGE| Save out .sdc and .odb file after each stage, useful to disable when using a single OpenROAD instance to run all stages of the flow.| 1| | YOSYS_FLAGS| Flags to pass to yosys.| -v 3| ## synth variables @@ -681,6 +680,5 @@ configuration file. - [TAP_CELL_NAME](#TAP_CELL_NAME) - [TECH_LEF](#TECH_LEF) - [USE_FILL](#USE_FILL) -- [WIRE_LOAD_LIB](#WIRE_LOAD_LIB) - [WIRE_LOAD_MODEL](#WIRE_LOAD_MODEL) diff --git a/flow/scripts/util.tcl b/flow/scripts/util.tcl index a6c9406ef9..bdaaba172e 100644 --- a/flow/scripts/util.tcl +++ b/flow/scripts/util.tcl @@ -175,9 +175,6 @@ proc apply_wire_load_model { } { if { ![env_var_exists_and_non_empty WIRE_LOAD_MODEL] } { return } - if { [env_var_exists_and_non_empty WIRE_LOAD_LIB] } { - log_cmd read_liberty $::env(WIRE_LOAD_LIB) - } log_cmd set_wire_load_model -name $::env(WIRE_LOAD_MODEL) } diff --git a/flow/scripts/variables.json b/flow/scripts/variables.json index 9bf92acdfa..e7ca688b21 100644 --- a/flow/scripts/variables.json +++ b/flow/scripts/variables.json @@ -1538,12 +1538,8 @@ "route" ] }, - "WIRE_LOAD_LIB": { - "description": "Liberty file read before applying WIRE_LOAD_MODEL, for a platform whose\nlibraries define no wire_load group of their own. Optional.\n", - "type": "string" - }, "WIRE_LOAD_MODEL": { - "description": "Name of a Liberty wire_load group applied with set_wire_load_model when\ntiming is read before placement (open.tcl on a synth or floorplan\nresult), where no net has parasitics yet and paths otherwise carry no\nwire delay. OpenSTA applies a wire-load model only to nets without\nparasitics, so placed and routed timing is unaffected. An unknown name\nis an error. Empty, the default, applies none.\n", + "description": "Name of a Liberty wire_load group applied with set_wire_load_model when\ntiming is read before placement (open.tcl on a synth or floorplan\nresult), where no net has parasitics yet and paths otherwise carry no\nwire delay. OpenSTA applies a wire-load model only to nets without\nparasitics, so placed and routed timing is unaffected. An unknown name\nis an error. Empty, the default, applies none. A platform whose\nlibraries define no wire_load group can supply one in a Liberty file\nlisted in ADDITIONAL_LIBS.\n", "type": "string" }, "WRITE_ODB_AND_SDC_EACH_STAGE": { diff --git a/flow/scripts/variables.yaml b/flow/scripts/variables.yaml index b0aa02966d..8c16ae664f 100644 --- a/flow/scripts/variables.yaml +++ b/flow/scripts/variables.yaml @@ -540,12 +540,9 @@ WIRE_LOAD_MODEL: result), where no net has parasitics yet and paths otherwise carry no wire delay. OpenSTA applies a wire-load model only to nets without parasitics, so placed and routed timing is unaffected. An unknown name - is an error. Empty, the default, applies none. - type: string -WIRE_LOAD_LIB: - description: | - Liberty file read before applying WIRE_LOAD_MODEL, for a platform whose - libraries define no wire_load group of their own. Optional. + is an error. Empty, the default, applies none. A platform whose + libraries define no wire_load group can supply one in a Liberty file + listed in ADDITIONAL_LIBS. type: string TAPCELL_TCL: description: | From 46c0b5cedd1f83a28436e0d6b56d811a69925761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Mon, 5 Oct 2026 22:59:18 +0200 Subject: [PATCH 3/3] open.tcl: apply WIRE_LOAD_MODEL unconditionally MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Øyvind Harboe --- docs/user/FlowVariables.md | 2 +- flow/scripts/open.tcl | 6 +++--- flow/scripts/util.tcl | 10 ---------- flow/scripts/variables.json | 2 +- flow/scripts/variables.yaml | 15 +++++++-------- 5 files changed, 12 insertions(+), 23 deletions(-) diff --git a/docs/user/FlowVariables.md b/docs/user/FlowVariables.md index 13cb129301..c365c7240c 100644 --- a/docs/user/FlowVariables.md +++ b/docs/user/FlowVariables.md @@ -336,7 +336,7 @@ configuration file. | VERILOG_TOP_PARAMS| Apply toplevel params (if exist). Passed in as a list of key value pairs in tcl syntax; separated by spaces: PARAM1 VALUE1 PARAM2 VALUE2| | | VIA_IN_PIN_MAX_LAYER| Passed as -via_in_pin_top_layer to pin_access and detailed_route.| | | VIA_IN_PIN_MIN_LAYER| Passed as -via_in_pin_bottom_layer to pin_access and detailed_route.| | -| WIRE_LOAD_MODEL| Name of a Liberty wire_load group applied with set_wire_load_model when timing is read before placement (open.tcl on a synth or floorplan result), where no net has parasitics yet and paths otherwise carry no wire delay. OpenSTA applies a wire-load model only to nets without parasitics, so placed and routed timing is unaffected. An unknown name is an error. Empty, the default, applies none. A platform whose libraries define no wire_load group can supply one in a Liberty file listed in ADDITIONAL_LIBS.| | +| WIRE_LOAD_MODEL| Name of a Liberty wire_load group applied with set_wire_load_model whenever open.tcl reads timing. OpenSTA applies a wire-load model only to nets without parasitics, so it gives wire delay to timing read before placement and leaves placed and routed timing unaffected. An unknown name is an error. Empty, the default, applies none. A platform whose libraries define no wire_load group can supply one in a Liberty file listed in ADDITIONAL_LIBS.| | | WRITE_ODB_AND_SDC_EACH_STAGE| Save out .sdc and .odb file after each stage, useful to disable when using a single OpenROAD instance to run all stages of the flow.| 1| | YOSYS_FLAGS| Flags to pass to yosys.| -v 3| ## synth variables diff --git a/flow/scripts/open.tcl b/flow/scripts/open.tcl index 830850bf6b..c8061687ab 100644 --- a/flow/scripts/open.tcl +++ b/flow/scripts/open.tcl @@ -50,9 +50,9 @@ proc read_timing { input_file } { } else { log_cmd source $::env(PLATFORM_DIR)/setRC.tcl } - if { $design_stage < 3 } { - # Before placement: no net has parasitics to estimate. - apply_wire_load_model + if { [env_var_exists_and_non_empty WIRE_LOAD_MODEL] } { + # OpenSTA applies a wire-load model only to nets without parasitics. + log_cmd set_wire_load_model -name $::env(WIRE_LOAD_MODEL) } if { $design_stage >= 4 } { # CTS has run, so propagate clocks diff --git a/flow/scripts/util.tcl b/flow/scripts/util.tcl index bdaaba172e..912762199a 100644 --- a/flow/scripts/util.tcl +++ b/flow/scripts/util.tcl @@ -168,16 +168,6 @@ proc find_macros { } { return $macros } -# A statistical wire-load model for timing read before placement, when no -# net has parasitics yet. OpenSTA applies it only to nets without -# parasitics. set_wire_load_model stops on an unknown name. -proc apply_wire_load_model { } { - if { ![env_var_exists_and_non_empty WIRE_LOAD_MODEL] } { - return - } - log_cmd set_wire_load_model -name $::env(WIRE_LOAD_MODEL) -} - proc erase_non_stage_variables { stage_name } { if { $::env(KEEP_VARS) } { return diff --git a/flow/scripts/variables.json b/flow/scripts/variables.json index e7ca688b21..a9044c2ca4 100644 --- a/flow/scripts/variables.json +++ b/flow/scripts/variables.json @@ -1539,7 +1539,7 @@ ] }, "WIRE_LOAD_MODEL": { - "description": "Name of a Liberty wire_load group applied with set_wire_load_model when\ntiming is read before placement (open.tcl on a synth or floorplan\nresult), where no net has parasitics yet and paths otherwise carry no\nwire delay. OpenSTA applies a wire-load model only to nets without\nparasitics, so placed and routed timing is unaffected. An unknown name\nis an error. Empty, the default, applies none. A platform whose\nlibraries define no wire_load group can supply one in a Liberty file\nlisted in ADDITIONAL_LIBS.\n", + "description": "Name of a Liberty wire_load group applied with set_wire_load_model\nwhenever open.tcl reads timing. OpenSTA applies a wire-load model only\nto nets without parasitics, so it gives wire delay to timing read\nbefore placement and leaves placed and routed timing unaffected. An\nunknown name is an error. Empty, the default, applies none. A platform\nwhose libraries define no wire_load group can supply one in a Liberty\nfile listed in ADDITIONAL_LIBS.\n", "type": "string" }, "WRITE_ODB_AND_SDC_EACH_STAGE": { diff --git a/flow/scripts/variables.yaml b/flow/scripts/variables.yaml index 8c16ae664f..fb88d87e1f 100644 --- a/flow/scripts/variables.yaml +++ b/flow/scripts/variables.yaml @@ -535,14 +535,13 @@ LAYER_PARASITICS_FILE: type: string WIRE_LOAD_MODEL: description: | - Name of a Liberty wire_load group applied with set_wire_load_model when - timing is read before placement (open.tcl on a synth or floorplan - result), where no net has parasitics yet and paths otherwise carry no - wire delay. OpenSTA applies a wire-load model only to nets without - parasitics, so placed and routed timing is unaffected. An unknown name - is an error. Empty, the default, applies none. A platform whose - libraries define no wire_load group can supply one in a Liberty file - listed in ADDITIONAL_LIBS. + Name of a Liberty wire_load group applied with set_wire_load_model + whenever open.tcl reads timing. OpenSTA applies a wire-load model only + to nets without parasitics, so it gives wire delay to timing read + before placement and leaves placed and routed timing unaffected. An + unknown name is an error. Empty, the default, applies none. A platform + whose libraries define no wire_load group can supply one in a Liberty + file listed in ADDITIONAL_LIBS. type: string TAPCELL_TCL: description: |