From f199affa233a64cb84751d404bd892e40e07ee1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Wed, 7 Jan 2026 22:00:10 +0100 Subject: [PATCH 1/2] synth: fix operator swapping check that hierarchical is enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Separation of concerns: require OPENROAD_HIERARCHICAL to be set, but don't set it implicitly. This fixes suprising potential w.r.t. e.g SYNTH_ variables not being set outside of the synthesis stage Signed-off-by: Øyvind Harboe --- flow/scripts/util.tcl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/flow/scripts/util.tcl b/flow/scripts/util.tcl index c06e942d6d..04b4d3727e 100644 --- a/flow/scripts/util.tcl +++ b/flow/scripts/util.tcl @@ -196,10 +196,13 @@ proc source_env_var_if_exists { env_var } { # will be default and this code will be deleted. proc hier_options { } { if { - [env_var_exists_and_non_empty SYNTH_WRAPPED_OPERATORS] || - [env_var_exists_and_non_empty SWAP_ARITH_OPERATORS] || - $::env(OPENROAD_HIERARCHICAL) + ([env_var_exists_and_non_empty SYNTH_WRAPPED_OPERATORS] || + [env_var_exists_and_non_empty SWAP_ARITH_OPERATORS]) && + !$::env(OPENROAD_HIERARCHICAL) } { + error "SYNTH_WRAPPED_OPERATORS or SWAP_ARITH_OPERATORS require OPENROAD_HIERARCHICAL to be set." + } + if { $::env(OPENROAD_HIERARCHICAL) } { return "-hier" } else { return "" From 683764c7de60120bce5e4466cc0ab4f735b64355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Mon, 12 Jan 2026 10:05:36 +0100 Subject: [PATCH 2/2] synth: set OPENROAD_HIERARCHICAL=1 as needed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Øyvind Harboe --- flow/designs/asap7/ibex/config.mk | 1 + flow/designs/asap7/mock-alu/config.mk | 1 + flow/designs/asap7/riscv32i/config.mk | 1 + flow/designs/asap7/swerv_wrapper/config.mk | 1 + flow/designs/gf180/ibex/config.mk | 1 + flow/designs/gf180/jpeg/config.mk | 1 + flow/designs/gf180/riscv32i/config.mk | 1 + flow/designs/ihp-sg13g2/gcd/config.mk | 1 + flow/designs/ihp-sg13g2/ibex/config.mk | 1 + flow/designs/ihp-sg13g2/riscv32i/config.mk | 1 + flow/designs/ihp-sg13g2/spi/config.mk | 1 + flow/designs/nangate45/aes/config.mk | 1 + flow/designs/nangate45/bp_multi_top/config.mk | 1 + flow/designs/nangate45/dynamic_node/config.mk | 1 + flow/designs/nangate45/swerv_wrapper/config.mk | 1 + flow/designs/sky130hd/aes/config.mk | 1 + flow/designs/sky130hd/ibex/config.mk | 1 + flow/designs/sky130hd/microwatt/config.mk | 1 + flow/designs/sky130hd/riscv32i/config.mk | 1 + flow/designs/sky130hs/aes/config.mk | 1 + flow/designs/sky130hs/jpeg/config.mk | 1 + flow/designs/sky130hs/riscv32i/config.mk | 1 + 22 files changed, 22 insertions(+) diff --git a/flow/designs/asap7/ibex/config.mk b/flow/designs/asap7/ibex/config.mk index 222314c1f0..8a1c644f23 100644 --- a/flow/designs/asap7/ibex/config.mk +++ b/flow/designs/asap7/ibex/config.mk @@ -29,3 +29,4 @@ export ENABLE_DPO = 0 export TNS_END_PERCENT = 100 export SWAP_ARITH_OPERATORS = 1 +export OPENROAD_HIERARCHICAL = 1 diff --git a/flow/designs/asap7/mock-alu/config.mk b/flow/designs/asap7/mock-alu/config.mk index 49dce08ed3..8dedca1632 100644 --- a/flow/designs/asap7/mock-alu/config.mk +++ b/flow/designs/asap7/mock-alu/config.mk @@ -9,3 +9,4 @@ export CORNER = BC export ROUTING_LAYER_ADJUSTMENT = 0.45 export SWAP_ARITH_OPERATORS = 1 +export OPENROAD_HIERARCHICAL = 1 diff --git a/flow/designs/asap7/riscv32i/config.mk b/flow/designs/asap7/riscv32i/config.mk index c3ea3c045e..693473f65e 100644 --- a/flow/designs/asap7/riscv32i/config.mk +++ b/flow/designs/asap7/riscv32i/config.mk @@ -28,3 +28,4 @@ export CTS_CLUSTER_SIZE = 10 export CTS_CLUSTER_DIAMETER = 50 export SWAP_ARITH_OPERATORS = 1 +export OPENROAD_HIERARCHICAL = 1 diff --git a/flow/designs/asap7/swerv_wrapper/config.mk b/flow/designs/asap7/swerv_wrapper/config.mk index ce39ca601d..1356b5d586 100644 --- a/flow/designs/asap7/swerv_wrapper/config.mk +++ b/flow/designs/asap7/swerv_wrapper/config.mk @@ -60,3 +60,4 @@ export PLACE_DENSITY_LB_ADDON = 0.20 export ROUTING_LAYER_ADJUSTMENT = 0.2 export SWAP_ARITH_OPERATORS = 1 +export OPENROAD_HIERARCHICAL = 1 diff --git a/flow/designs/gf180/ibex/config.mk b/flow/designs/gf180/ibex/config.mk index f8b12b6bf4..50ac1389fa 100644 --- a/flow/designs/gf180/ibex/config.mk +++ b/flow/designs/gf180/ibex/config.mk @@ -16,3 +16,4 @@ export CORE_UTILIZATION = 45 export PLACE_DENSITY_LB_ADDON = 0.1 export SWAP_ARITH_OPERATORS = 1 +export OPENROAD_HIERARCHICAL = 1 diff --git a/flow/designs/gf180/jpeg/config.mk b/flow/designs/gf180/jpeg/config.mk index 8a26f534a9..799d1aaad6 100644 --- a/flow/designs/gf180/jpeg/config.mk +++ b/flow/designs/gf180/jpeg/config.mk @@ -11,3 +11,4 @@ export PLACE_DENSITY_LB_ADDON = 0.20 export IO_CONSTRAINTS = $(DESIGN_HOME)/$(PLATFORM)/$(DESIGN_NICKNAME)/io.tcl export SWAP_ARITH_OPERATORS = 1 +export OPENROAD_HIERARCHICAL = 1 diff --git a/flow/designs/gf180/riscv32i/config.mk b/flow/designs/gf180/riscv32i/config.mk index b7a79c990b..fedb328e2d 100644 --- a/flow/designs/gf180/riscv32i/config.mk +++ b/flow/designs/gf180/riscv32i/config.mk @@ -13,3 +13,4 @@ export PLACE_PINS_ARGS = -min_distance 5 export IO_CONSTRAINTS = $(DESIGN_HOME)/$(PLATFORM)/$(DESIGN_NICKNAME)/io.tcl export SWAP_ARITH_OPERATORS = 1 +export OPENROAD_HIERARCHICAL = 1 diff --git a/flow/designs/ihp-sg13g2/gcd/config.mk b/flow/designs/ihp-sg13g2/gcd/config.mk index d582cd2bb6..fc554fb8f8 100644 --- a/flow/designs/ihp-sg13g2/gcd/config.mk +++ b/flow/designs/ihp-sg13g2/gcd/config.mk @@ -11,3 +11,4 @@ export CORE_UTILIZATION = 20 export TNS_END_PERCENT = 100 export SWAP_ARITH_OPERATORS = 1 +export OPENROAD_HIERARCHICAL = 1 diff --git a/flow/designs/ihp-sg13g2/ibex/config.mk b/flow/designs/ihp-sg13g2/ibex/config.mk index ff11fd6c05..6f71860ef2 100644 --- a/flow/designs/ihp-sg13g2/ibex/config.mk +++ b/flow/designs/ihp-sg13g2/ibex/config.mk @@ -21,3 +21,4 @@ export TNS_END_PERCENT = 100 export CTS_BUF_DISTANCE = 60 export SWAP_ARITH_OPERATORS = 1 +export OPENROAD_HIERARCHICAL = 1 diff --git a/flow/designs/ihp-sg13g2/riscv32i/config.mk b/flow/designs/ihp-sg13g2/riscv32i/config.mk index 790da5d94d..e2bbb90b2d 100644 --- a/flow/designs/ihp-sg13g2/riscv32i/config.mk +++ b/flow/designs/ihp-sg13g2/riscv32i/config.mk @@ -13,3 +13,4 @@ export TNS_END_PERCENT = 100 export CTS_BUF_DISTANCE = 60 export SWAP_ARITH_OPERATORS = 1 +export OPENROAD_HIERARCHICAL = 1 diff --git a/flow/designs/ihp-sg13g2/spi/config.mk b/flow/designs/ihp-sg13g2/spi/config.mk index 797d5e3cd5..a424342b62 100644 --- a/flow/designs/ihp-sg13g2/spi/config.mk +++ b/flow/designs/ihp-sg13g2/spi/config.mk @@ -11,3 +11,4 @@ export CORE_UTILIZATION = 20 export TNS_END_PERCENT = 100 export SWAP_ARITH_OPERATORS = 1 +export OPENROAD_HIERARCHICAL = 1 diff --git a/flow/designs/nangate45/aes/config.mk b/flow/designs/nangate45/aes/config.mk index befacb6e6a..e859d0d4a2 100644 --- a/flow/designs/nangate45/aes/config.mk +++ b/flow/designs/nangate45/aes/config.mk @@ -15,3 +15,4 @@ export REMOVE_CELLS_FOR_EQY = TAPCELL* export SKIP_INCREMENTAL_REPAIR = 1 export SWAP_ARITH_OPERATORS = 1 +export OPENROAD_HIERARCHICAL = 1 diff --git a/flow/designs/nangate45/bp_multi_top/config.mk b/flow/designs/nangate45/bp_multi_top/config.mk index 0ba11145f9..8fd92869a9 100644 --- a/flow/designs/nangate45/bp_multi_top/config.mk +++ b/flow/designs/nangate45/bp_multi_top/config.mk @@ -34,3 +34,4 @@ export PLACE_DENSITY_LB_ADDON = 0.05 export SKIP_GATE_CLONING = 1 export SWAP_ARITH_OPERATORS = 1 +export OPENROAD_HIERARCHICAL = 1 diff --git a/flow/designs/nangate45/dynamic_node/config.mk b/flow/designs/nangate45/dynamic_node/config.mk index 4cfd2d59c7..3e514eccf8 100644 --- a/flow/designs/nangate45/dynamic_node/config.mk +++ b/flow/designs/nangate45/dynamic_node/config.mk @@ -14,3 +14,4 @@ export PLACE_DENSITY_LB_ADDON = 0.20 export TNS_END_PERCENT = 100 export SWAP_ARITH_OPERATORS = 1 +export OPENROAD_HIERARCHICAL = 1 diff --git a/flow/designs/nangate45/swerv_wrapper/config.mk b/flow/designs/nangate45/swerv_wrapper/config.mk index 960972da5a..7cfe56aca9 100644 --- a/flow/designs/nangate45/swerv_wrapper/config.mk +++ b/flow/designs/nangate45/swerv_wrapper/config.mk @@ -25,3 +25,4 @@ export TNS_END_PERCENT = 100 export FASTROUTE_TCL = $(DESIGN_HOME)/$(PLATFORM)/$(DESIGN_NAME)/fastroute.tcl export SWAP_ARITH_OPERATORS = 1 +export OPENROAD_HIERARCHICAL = 1 diff --git a/flow/designs/sky130hd/aes/config.mk b/flow/designs/sky130hd/aes/config.mk index 769047576a..c82a295d40 100644 --- a/flow/designs/sky130hd/aes/config.mk +++ b/flow/designs/sky130hd/aes/config.mk @@ -22,3 +22,4 @@ export CTS_CLUSTER_SIZE = 20 export CTS_CLUSTER_DIAMETER = 50 export SWAP_ARITH_OPERATORS = 1 +export OPENROAD_HIERARCHICAL = 1 diff --git a/flow/designs/sky130hd/ibex/config.mk b/flow/designs/sky130hd/ibex/config.mk index 251c5b2860..e05fdfbbaf 100644 --- a/flow/designs/sky130hd/ibex/config.mk +++ b/flow/designs/sky130hd/ibex/config.mk @@ -27,3 +27,4 @@ export CTS_CLUSTER_SIZE = 20 export CTS_CLUSTER_DIAMETER = 50 export SWAP_ARITH_OPERATORS = 1 +export OPENROAD_HIERARCHICAL = 1 diff --git a/flow/designs/sky130hd/microwatt/config.mk b/flow/designs/sky130hd/microwatt/config.mk index 5fcd12816d..6a2021c3f5 100644 --- a/flow/designs/sky130hd/microwatt/config.mk +++ b/flow/designs/sky130hd/microwatt/config.mk @@ -50,3 +50,4 @@ else endif export SWAP_ARITH_OPERATORS = 1 +export OPENROAD_HIERARCHICAL = 1 diff --git a/flow/designs/sky130hd/riscv32i/config.mk b/flow/designs/sky130hd/riscv32i/config.mk index 68db818f0c..c13fa5886c 100644 --- a/flow/designs/sky130hd/riscv32i/config.mk +++ b/flow/designs/sky130hd/riscv32i/config.mk @@ -11,3 +11,4 @@ export PLACE_DENSITY_LB_ADDON = 0.2 export REMOVE_ABC_BUFFERS = 1 export SWAP_ARITH_OPERATORS = 1 +export OPENROAD_HIERARCHICAL = 1 diff --git a/flow/designs/sky130hs/aes/config.mk b/flow/designs/sky130hs/aes/config.mk index 1dd1c6335e..49bdcc926d 100644 --- a/flow/designs/sky130hs/aes/config.mk +++ b/flow/designs/sky130hs/aes/config.mk @@ -18,3 +18,4 @@ export CTS_CLUSTER_SIZE = 10 export CTS_CLUSTER_DIAMETER = 50 export SWAP_ARITH_OPERATORS = 1 +export OPENROAD_HIERARCHICAL = 1 diff --git a/flow/designs/sky130hs/jpeg/config.mk b/flow/designs/sky130hs/jpeg/config.mk index 434f086632..867415edb2 100644 --- a/flow/designs/sky130hs/jpeg/config.mk +++ b/flow/designs/sky130hs/jpeg/config.mk @@ -18,3 +18,4 @@ export CTS_CLUSTER_SIZE = 30 export CTS_CLUSTER_DIAMETER = 50 export SWAP_ARITH_OPERATORS = 1 +export OPENROAD_HIERARCHICAL = 1 diff --git a/flow/designs/sky130hs/riscv32i/config.mk b/flow/designs/sky130hs/riscv32i/config.mk index faa88123e5..cfe34db7a9 100644 --- a/flow/designs/sky130hs/riscv32i/config.mk +++ b/flow/designs/sky130hs/riscv32i/config.mk @@ -16,3 +16,4 @@ export FASTROUTE_TCL = $(DESIGN_HOME)/$(PLATFORM)/$(DESIGN_NICKNAME)/fastroute.t export REMOVE_ABC_BUFFERS = 1 export SWAP_ARITH_OPERATORS = 1 +export OPENROAD_HIERARCHICAL = 1