Skip to content

Commit 409c814

Browse files
committed
flow: move repair_tie_fanout into synth_odb.tcl before remove_buffers
PR #4187 moved remove_buffers, replace_arith_modules and repair_timing_helper out of floorplan.tcl into synth_odb.tcl, but left repair_tie_fanout behind in floorplan.tcl. That flipped the relative order: in master repair_tie_fanout had run *before* remove_buffers (a load-bearing invariant the dropped ordering comment was guarding); in the new flow it ran against the already-unbuffered netlist. The behavior difference is small but real. On asap7/ibex it produced 14 TIELOx1 instances instead of 15, propagated through global placement, and the design entered CTS in a state that converged to ~5x worse setup TNS: cts setup TNS master -961 ps PR (pre-fix) -5584 ps Move repair_tie_fanout into synth_odb.tcl ahead of replace_arith_modules and the remove_buffers / repair_timing_helper branch so the original ordering is preserved. Re-running asap7/ibex with this fix gets the TIELO count back to 15. TIE_SEPARATION and SKIP_REPAIR_TIE_FANOUT now live in the synth stage in variables.yaml/json so they survive the synth-stage erase_non_stage_variables call. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent 975e5cf commit 409c814

5 files changed

Lines changed: 30 additions & 25 deletions

File tree

‎docs/user/FlowVariables.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ configuration file.
282282
| <a name="SKIP_INCREMENTAL_REPAIR"></a>SKIP_INCREMENTAL_REPAIR| Skip incremental repair in global route.| 0|
283283
| <a name="SKIP_LAST_GASP"></a>SKIP_LAST_GASP| Do not use last gasp optimization to fix timing violations (default: use gate last gasp).| |
284284
| <a name="SKIP_PIN_SWAP"></a>SKIP_PIN_SWAP| Do not use pin swapping as a transform to fix timing violations (default: use pin swapping).| |
285-
| <a name="SKIP_REPAIR_TIE_FANOUT"></a>SKIP_REPAIR_TIE_FANOUT| Skip repair_tie_fanout at floorplan step.| 0|
285+
| <a name="SKIP_REPAIR_TIE_FANOUT"></a>SKIP_REPAIR_TIE_FANOUT| Skip repair_tie_fanout at synth step.| 0|
286286
| <a name="SKIP_REPORT_METRICS"></a>SKIP_REPORT_METRICS| If set to 1, then metrics, report_metrics does nothing. Useful to speed up builds.| 0|
287287
| <a name="SKIP_VT_SWAP"></a>SKIP_VT_SWAP| Do not perform VT swap to improve QoR (default: do VT swap).| |
288288
| <a name="SLANG_PLUGIN_PATH"></a>SLANG_PLUGIN_PATH| Path to the slang plugin for Yosys. This can be a full path to a custom-built plugin (e.g. for Bazel builds) or just the plugin name.| slang|
@@ -348,6 +348,7 @@ configuration file.
348348
- [REMOVE_ABC_BUFFERS](#REMOVE_ABC_BUFFERS)
349349
- [SDC_FILE](#SDC_FILE)
350350
- [SDC_GUT](#SDC_GUT)
351+
- [SKIP_REPAIR_TIE_FANOUT](#SKIP_REPAIR_TIE_FANOUT)
351352
- [SLANG_PLUGIN_PATH](#SLANG_PLUGIN_PATH)
352353
- [SYNTH_ARGS](#SYNTH_ARGS)
353354
- [SYNTH_BLACKBOXES](#SYNTH_BLACKBOXES)
@@ -374,6 +375,7 @@ configuration file.
374375
- [SYNTH_WRAPPED_MULTIPLIERS](#SYNTH_WRAPPED_MULTIPLIERS)
375376
- [TIEHI_CELL_AND_PORT](#TIEHI_CELL_AND_PORT)
376377
- [TIELO_CELL_AND_PORT](#TIELO_CELL_AND_PORT)
378+
- [TIE_SEPARATION](#TIE_SEPARATION)
377379
- [UNSET_ABC9_BOX_CELLS](#UNSET_ABC9_BOX_CELLS)
378380
- [VERILOG_DEFINES](#VERILOG_DEFINES)
379381
- [VERILOG_FILES](#VERILOG_FILES)
@@ -443,13 +445,11 @@ configuration file.
443445
- [SKIP_GATE_CLONING](#SKIP_GATE_CLONING)
444446
- [SKIP_LAST_GASP](#SKIP_LAST_GASP)
445447
- [SKIP_PIN_SWAP](#SKIP_PIN_SWAP)
446-
- [SKIP_REPAIR_TIE_FANOUT](#SKIP_REPAIR_TIE_FANOUT)
447448
- [SKIP_REPORT_METRICS](#SKIP_REPORT_METRICS)
448449
- [SKIP_VT_SWAP](#SKIP_VT_SWAP)
449450
- [TAPCELL_TCL](#TAPCELL_TCL)
450451
- [TIEHI_CELL_AND_PORT](#TIEHI_CELL_AND_PORT)
451452
- [TIELO_CELL_AND_PORT](#TIELO_CELL_AND_PORT)
452-
- [TIE_SEPARATION](#TIE_SEPARATION)
453453
- [TNS_END_PERCENT](#TNS_END_PERCENT)
454454

455455
## place variables

‎flow/scripts/floorplan.tcl‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,22 +75,6 @@ if { [env_var_exists_and_non_empty FASTROUTE_TCL] } {
7575

7676
source_env_var_if_exists FOOTPRINT_TCL
7777

78-
if { !$::env(SKIP_REPAIR_TIE_FANOUT) } {
79-
# Repair tie lo fanout
80-
puts "Repair tie lo fanout..."
81-
set tielo_cell_name [lindex $::env(TIELO_CELL_AND_PORT) 0]
82-
set tielo_lib_name [get_name [get_property [lindex [get_lib_cell $tielo_cell_name] 0] library]]
83-
set tielo_pin $tielo_lib_name/$tielo_cell_name/[lindex $::env(TIELO_CELL_AND_PORT) 1]
84-
repair_tie_fanout -separation $::env(TIE_SEPARATION) $tielo_pin
85-
86-
# Repair tie hi fanout
87-
puts "Repair tie hi fanout..."
88-
set tiehi_cell_name [lindex $::env(TIEHI_CELL_AND_PORT) 0]
89-
set tiehi_lib_name [get_name [get_property [lindex [get_lib_cell $tiehi_cell_name] 0] library]]
90-
set tiehi_pin $tiehi_lib_name/$tiehi_cell_name/[lindex $::env(TIEHI_CELL_AND_PORT) 1]
91-
repair_tie_fanout -separation $::env(TIE_SEPARATION) $tiehi_pin
92-
}
93-
9478
puts "Default units for flow"
9579
report_units
9680
report_units_metric

‎flow/scripts/synth_odb.tcl‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,27 @@ check_setup
5151
set num_instances [llength [get_cells -hier *]]
5252
puts "number instances in verilog is $num_instances"
5353

54+
# repair_tie_fanout must run before remove_buffers and the timing-driven
55+
# transforms below: a single tie that drives multiple buffers (each driving
56+
# multiple loads) needs the fanout split per-buffer-load before remove_buffers
57+
# collapses the buffers, otherwise the resulting tie fanout is a different
58+
# netlist and cascades into worse setup TNS at CTS (~5x on asap7/ibex).
59+
if { !$::env(SKIP_REPAIR_TIE_FANOUT) } {
60+
# Repair tie lo fanout
61+
puts "Repair tie lo fanout..."
62+
set tielo_cell_name [lindex $::env(TIELO_CELL_AND_PORT) 0]
63+
set tielo_lib_name [get_name [get_property [lindex [get_lib_cell $tielo_cell_name] 0] library]]
64+
set tielo_pin $tielo_lib_name/$tielo_cell_name/[lindex $::env(TIELO_CELL_AND_PORT) 1]
65+
repair_tie_fanout -separation $::env(TIE_SEPARATION) $tielo_pin
66+
67+
# Repair tie hi fanout
68+
puts "Repair tie hi fanout..."
69+
set tiehi_cell_name [lindex $::env(TIEHI_CELL_AND_PORT) 0]
70+
set tiehi_lib_name [get_name [get_property [lindex [get_lib_cell $tiehi_cell_name] 0] library]]
71+
set tiehi_pin $tiehi_lib_name/$tiehi_cell_name/[lindex $::env(TIEHI_CELL_AND_PORT) 1]
72+
repair_tie_fanout -separation $::env(TIE_SEPARATION) $tiehi_pin
73+
}
74+
5475
if { [env_var_exists_and_non_empty SWAP_ARITH_OPERATORS] } {
5576
# Enable sanity checker until replace_arith_modules becomes stable
5677
set_debug_level ODB replace_design_check_sanity 1

‎flow/scripts/variables.json‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎flow/scripts/variables.yaml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ TIE_SEPARATION:
365365
description: |
366366
Distance separating tie high/low instances from the load.
367367
stages:
368-
- floorplan
368+
- synth
369369
default: 0
370370
UNSET_ABC9_BOX_CELLS:
371371
description: |
@@ -810,9 +810,9 @@ SKIP_CTS_REPAIR_TIMING:
810810
default: 0
811811
SKIP_REPAIR_TIE_FANOUT:
812812
description: >
813-
Skip repair_tie_fanout at floorplan step.
813+
Skip repair_tie_fanout at synth step.
814814
stages:
815-
- floorplan
815+
- synth
816816
default: 0
817817
MIN_ROUTING_LAYER:
818818
description: |

0 commit comments

Comments
 (0)