From cafcb2dbfc62335579ab4668d4e1f2e501157761 Mon Sep 17 00:00:00 2001 From: Augusto Berndt Date: Tue, 14 Apr 2026 18:10:20 +0000 Subject: [PATCH 1/7] dpl: easier setting for using negotiation legalizer Signed-off-by: Augusto Berndt --- flow/scripts/cts.tcl | 10 +++++++++- flow/scripts/detail_place.tcl | 6 +++++- flow/scripts/global_route.tcl | 12 ++++++++++-- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/flow/scripts/cts.tcl b/flow/scripts/cts.tcl index fd544a332e..8bf33a8c14 100644 --- a/flow/scripts/cts.tcl +++ b/flow/scripts/cts.tcl @@ -46,7 +46,11 @@ set_placement_padding -global \ -left $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT) \ -right $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT) -set result [catch { log_cmd detailed_placement } msg] +if { [env_var_exists_and_non_empty USE_NEGOTIATION] && $::env(USE_NEGOTIATION) } { + set result [catch { log_cmd detailed_placement -use_negotiation } msg] +} else { + set result [catch { log_cmd detailed_placement } msg] +} if { $result != 0 } { save_progress 4_1_error error "Detailed placement failed in CTS: $msg" @@ -70,7 +74,11 @@ if { !$::env(SKIP_CTS_REPAIR_TIMING) } { run_lec_test 4_rsz 4_before_rsz_lec.v 4_after_rsz_lec.v } +if { [env_var_exists_and_non_empty USE_NEGOTIATION] && $::env(USE_NEGOTIATION) } { + set result [catch { log_cmd detailed_placement -use_negotiation } msg] +} else { set result [catch { log_cmd detailed_placement } msg] +} if { $result != 0 } { save_progress 4_1_error error "Detailed placement failed in CTS: $msg" diff --git a/flow/scripts/detail_place.tcl b/flow/scripts/detail_place.tcl index 17c4285ea8..746789e6e8 100644 --- a/flow/scripts/detail_place.tcl +++ b/flow/scripts/detail_place.tcl @@ -15,7 +15,11 @@ proc do_dpl { } { set_placement_padding -global \ -left $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT) \ -right $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT) - log_cmd detailed_placement {*}[env_var_or_empty DETAIL_PLACEMENT_ARGS] + if { [env_var_exists_and_non_empty USE_NEGOTIATION] && $::env(USE_NEGOTIATION) } { + log_cmd detailed_placement -use_negotiation {*}[env_var_or_empty DETAIL_PLACEMENT_ARGS] + } else { + log_cmd detailed_placement {*}[env_var_or_empty DETAIL_PLACEMENT_ARGS] + } if { $::env(ENABLE_DPO) } { if { [env_var_exists_and_non_empty DPO_MAX_DISPLACEMENT] } { diff --git a/flow/scripts/global_route.tcl b/flow/scripts/global_route.tcl index 5be588d088..253b8fe04a 100644 --- a/flow/scripts/global_route.tcl +++ b/flow/scripts/global_route.tcl @@ -62,7 +62,11 @@ proc global_route_helper { } { # Running DPL to fix overlapped instances # Run to get modified net by DPL log_cmd global_route -start_incremental - log_cmd detailed_placement + if { [env_var_exists_and_non_empty USE_NEGOTIATION] && $::env(USE_NEGOTIATION) } { + log_cmd detailed_placement -use_negotiation + } else { + log_cmd detailed_placement + } # Route only the modified net by DPL log_cmd global_route -end_incremental {*}$res_aware \ -congestion_report_file $::env(REPORTS_DIR)/congestion_post_repair_design.rpt @@ -80,7 +84,11 @@ proc global_route_helper { } { # Running DPL to fix overlapped instances # Run to get modified net by DPL log_cmd global_route -start_incremental - log_cmd detailed_placement + if { [env_var_exists_and_non_empty USE_NEGOTIATION] && $::env(USE_NEGOTIATION) } { + log_cmd detailed_placement -use_negotiation + } else { + log_cmd detailed_placement + } check_placement -verbose # Route only the modified net by DPL log_cmd global_route -end_incremental {*}$res_aware \ From 47eb196126d9d6993c706b79957168f5be5fc0d5 Mon Sep 17 00:00:00 2001 From: Augusto Berndt Date: Tue, 14 Apr 2026 18:23:18 +0000 Subject: [PATCH 2/7] fix lint Signed-off-by: Augusto Berndt --- flow/scripts/cts.tcl | 12 ++++++------ flow/scripts/global_route.tcl | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/flow/scripts/cts.tcl b/flow/scripts/cts.tcl index 8bf33a8c14..3737f93bdb 100644 --- a/flow/scripts/cts.tcl +++ b/flow/scripts/cts.tcl @@ -50,7 +50,7 @@ if { [env_var_exists_and_non_empty USE_NEGOTIATION] && $::env(USE_NEGOTIATION) } set result [catch { log_cmd detailed_placement -use_negotiation } msg] } else { set result [catch { log_cmd detailed_placement } msg] -} +} if { $result != 0 } { save_progress 4_1_error error "Detailed placement failed in CTS: $msg" @@ -74,11 +74,11 @@ if { !$::env(SKIP_CTS_REPAIR_TIMING) } { run_lec_test 4_rsz 4_before_rsz_lec.v 4_after_rsz_lec.v } -if { [env_var_exists_and_non_empty USE_NEGOTIATION] && $::env(USE_NEGOTIATION) } { - set result [catch { log_cmd detailed_placement -use_negotiation } msg] -} else { - set result [catch { log_cmd detailed_placement } msg] -} + if { [env_var_exists_and_non_empty USE_NEGOTIATION] && $::env(USE_NEGOTIATION) } { + set result [catch { log_cmd detailed_placement -use_negotiation } msg] + } else { + set result [catch { log_cmd detailed_placement } msg] + } if { $result != 0 } { save_progress 4_1_error error "Detailed placement failed in CTS: $msg" diff --git a/flow/scripts/global_route.tcl b/flow/scripts/global_route.tcl index 253b8fe04a..16a94aacbe 100644 --- a/flow/scripts/global_route.tcl +++ b/flow/scripts/global_route.tcl @@ -66,7 +66,7 @@ proc global_route_helper { } { log_cmd detailed_placement -use_negotiation } else { log_cmd detailed_placement - } + } # Route only the modified net by DPL log_cmd global_route -end_incremental {*}$res_aware \ -congestion_report_file $::env(REPORTS_DIR)/congestion_post_repair_design.rpt @@ -88,7 +88,7 @@ proc global_route_helper { } { log_cmd detailed_placement -use_negotiation } else { log_cmd detailed_placement - } + } check_placement -verbose # Route only the modified net by DPL log_cmd global_route -end_incremental {*}$res_aware \ From 86d697ee3c6b7276c8cc2636d24e8e87543c9a7b Mon Sep 17 00:00:00 2001 From: Augusto Berndt Date: Wed, 15 Apr 2026 10:24:06 +0000 Subject: [PATCH 3/7] include USE_NEGOTATION for dpl calls Signed-off-by: Augusto Berndt --- flow/scripts/variables.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flow/scripts/variables.yaml b/flow/scripts/variables.yaml index cf531c9e23..1fef7d48a3 100644 --- a/flow/scripts/variables.yaml +++ b/flow/scripts/variables.yaml @@ -616,6 +616,10 @@ DPO_MAX_DISPLACEMENT: description: | Specifies how far an instance can be moved when optimizing. default: 5 1 +USE_NEGOTIATION: + description: | + Enable using negotiation legalizer for detailed placement. + default: 0 GPL_TIMING_DRIVEN: description: | Specifies whether the placer should use timing driven placement. From 54919ca86274e6db2e793b703a03b307ec4f96de Mon Sep 17 00:00:00 2001 From: Augusto Berndt Date: Wed, 15 Apr 2026 10:28:18 +0000 Subject: [PATCH 4/7] remove unecessary code Signed-off-by: Augusto Berndt --- flow/scripts/cts.tcl | 4 ++-- flow/scripts/detail_place.tcl | 2 +- flow/scripts/global_route.tcl | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flow/scripts/cts.tcl b/flow/scripts/cts.tcl index 3737f93bdb..30d3a4f589 100644 --- a/flow/scripts/cts.tcl +++ b/flow/scripts/cts.tcl @@ -46,7 +46,7 @@ set_placement_padding -global \ -left $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT) \ -right $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT) -if { [env_var_exists_and_non_empty USE_NEGOTIATION] && $::env(USE_NEGOTIATION) } { +if { $::env(USE_NEGOTIATION) } { set result [catch { log_cmd detailed_placement -use_negotiation } msg] } else { set result [catch { log_cmd detailed_placement } msg] @@ -74,7 +74,7 @@ if { !$::env(SKIP_CTS_REPAIR_TIMING) } { run_lec_test 4_rsz 4_before_rsz_lec.v 4_after_rsz_lec.v } - if { [env_var_exists_and_non_empty USE_NEGOTIATION] && $::env(USE_NEGOTIATION) } { + if { $::env(USE_NEGOTIATION) } { set result [catch { log_cmd detailed_placement -use_negotiation } msg] } else { set result [catch { log_cmd detailed_placement } msg] diff --git a/flow/scripts/detail_place.tcl b/flow/scripts/detail_place.tcl index 746789e6e8..fccf5f98d9 100644 --- a/flow/scripts/detail_place.tcl +++ b/flow/scripts/detail_place.tcl @@ -15,7 +15,7 @@ proc do_dpl { } { set_placement_padding -global \ -left $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT) \ -right $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT) - if { [env_var_exists_and_non_empty USE_NEGOTIATION] && $::env(USE_NEGOTIATION) } { + if { $::env(USE_NEGOTIATION) } { log_cmd detailed_placement -use_negotiation {*}[env_var_or_empty DETAIL_PLACEMENT_ARGS] } else { log_cmd detailed_placement {*}[env_var_or_empty DETAIL_PLACEMENT_ARGS] diff --git a/flow/scripts/global_route.tcl b/flow/scripts/global_route.tcl index 16a94aacbe..9b0567427c 100644 --- a/flow/scripts/global_route.tcl +++ b/flow/scripts/global_route.tcl @@ -62,7 +62,7 @@ proc global_route_helper { } { # Running DPL to fix overlapped instances # Run to get modified net by DPL log_cmd global_route -start_incremental - if { [env_var_exists_and_non_empty USE_NEGOTIATION] && $::env(USE_NEGOTIATION) } { + if { $::env(USE_NEGOTIATION) } { log_cmd detailed_placement -use_negotiation } else { log_cmd detailed_placement @@ -84,7 +84,7 @@ proc global_route_helper { } { # Running DPL to fix overlapped instances # Run to get modified net by DPL log_cmd global_route -start_incremental - if { [env_var_exists_and_non_empty USE_NEGOTIATION] && $::env(USE_NEGOTIATION) } { + if { $::env(USE_NEGOTIATION) } { log_cmd detailed_placement -use_negotiation } else { log_cmd detailed_placement From 27e66f10e3a9dde1ed5d1200269db5fea1e75a1e Mon Sep 17 00:00:00 2001 From: Augusto Berndt Date: Wed, 15 Apr 2026 13:57:53 +0000 Subject: [PATCH 5/7] include USE_NEGOTATION for dpl calls Signed-off-by: Augusto Berndt --- docs/user/FlowVariables.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/user/FlowVariables.md b/docs/user/FlowVariables.md index c2c630e4e4..e06ea1f9c1 100644 --- a/docs/user/FlowVariables.md +++ b/docs/user/FlowVariables.md @@ -319,6 +319,7 @@ configuration file. | TNS_END_PERCENT| Default TNS_END_PERCENT value for post CTS timing repair. Try fixing all violating endpoints by default (reduce to 5% for runtime). Specifies how many percent of violating paths to fix [0-100]. Worst path will always be fixed.| 100| | UNSET_ABC9_BOX_CELLS| List of cells to unset the abc9_box attribute on| | | USE_FILL| Whether to perform metal density filling.| 0| +| USE_NEGOTIATION| Enable using negotiation legalizer for detailed placement.| 0| | VERILOG_DEFINES| Preprocessor defines passed to the language frontend. Example: `-D HPDCACHE_ASSERT_OFF`| | | VERILOG_FILES| The path to the design Verilog/SystemVerilog files providing a description of modules.| | | VERILOG_INCLUDE_DIRS| Specifies the include directories for the Verilog input files.| | @@ -655,4 +656,5 @@ configuration file. - [TAP_CELL_NAME](#TAP_CELL_NAME) - [TECH_LEF](#TECH_LEF) - [USE_FILL](#USE_FILL) +- [USE_NEGOTIATION](#USE_NEGOTIATION) From 05eca81dc4ea1cda31c7cb03e3c5d186dd5788e4 Mon Sep 17 00:00:00 2001 From: Augusto Berndt Date: Wed, 15 Apr 2026 15:00:48 +0000 Subject: [PATCH 6/7] include USE_NEGOTATION for dpl calls Signed-off-by: Augusto Berndt --- flow/scripts/variables.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flow/scripts/variables.json b/flow/scripts/variables.json index 5d28243d6b..85ddc5accf 100644 --- a/flow/scripts/variables.json +++ b/flow/scripts/variables.json @@ -1417,6 +1417,10 @@ "default": 0, "description": "Whether to perform metal density filling.\n" }, + "USE_NEGOTIATION": { + "default": 0, + "description": "Enable using negotiation legalizer for detailed placement.\n" + }, "VERILOG_DEFINES": { "description": "Preprocessor defines passed to the language frontend. Example: `-D HPDCACHE_ASSERT_OFF`\n", "stages": [ From 16d674a8ce3bfbb79980690b50d3def81200a0d3 Mon Sep 17 00:00:00 2001 From: Augusto Berndt Date: Wed, 15 Apr 2026 21:24:17 +0000 Subject: [PATCH 7/7] improve code readability with append_env_var Signed-off-by: Augusto Berndt --- flow/scripts/cts.tcl | 14 ++++---------- flow/scripts/detail_place.tcl | 8 +++----- flow/scripts/global_route.tcl | 14 ++++---------- 3 files changed, 11 insertions(+), 25 deletions(-) diff --git a/flow/scripts/cts.tcl b/flow/scripts/cts.tcl index 30d3a4f589..f079bb5f10 100644 --- a/flow/scripts/cts.tcl +++ b/flow/scripts/cts.tcl @@ -46,11 +46,9 @@ set_placement_padding -global \ -left $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT) \ -right $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT) -if { $::env(USE_NEGOTIATION) } { - set result [catch { log_cmd detailed_placement -use_negotiation } msg] -} else { - set result [catch { log_cmd detailed_placement } msg] -} +set dpl_args {} +append_env_var dpl_args USE_NEGOTIATION -use_negotiation 0 +set result [catch { log_cmd detailed_placement {*}$dpl_args } msg] if { $result != 0 } { save_progress 4_1_error error "Detailed placement failed in CTS: $msg" @@ -74,11 +72,7 @@ if { !$::env(SKIP_CTS_REPAIR_TIMING) } { run_lec_test 4_rsz 4_before_rsz_lec.v 4_after_rsz_lec.v } - if { $::env(USE_NEGOTIATION) } { - set result [catch { log_cmd detailed_placement -use_negotiation } msg] - } else { - set result [catch { log_cmd detailed_placement } msg] - } + set result [catch { log_cmd detailed_placement {*}$dpl_args } msg] if { $result != 0 } { save_progress 4_1_error error "Detailed placement failed in CTS: $msg" diff --git a/flow/scripts/detail_place.tcl b/flow/scripts/detail_place.tcl index fccf5f98d9..5fb802f7e7 100644 --- a/flow/scripts/detail_place.tcl +++ b/flow/scripts/detail_place.tcl @@ -15,11 +15,9 @@ proc do_dpl { } { set_placement_padding -global \ -left $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT) \ -right $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT) - if { $::env(USE_NEGOTIATION) } { - log_cmd detailed_placement -use_negotiation {*}[env_var_or_empty DETAIL_PLACEMENT_ARGS] - } else { - log_cmd detailed_placement {*}[env_var_or_empty DETAIL_PLACEMENT_ARGS] - } + set dpl_args [env_var_or_empty DETAIL_PLACEMENT_ARGS] + append_env_var dpl_args USE_NEGOTIATION -use_negotiation 0 + log_cmd detailed_placement {*}$dpl_args if { $::env(ENABLE_DPO) } { if { [env_var_exists_and_non_empty DPO_MAX_DISPLACEMENT] } { diff --git a/flow/scripts/global_route.tcl b/flow/scripts/global_route.tcl index 9b0567427c..3534fde65f 100644 --- a/flow/scripts/global_route.tcl +++ b/flow/scripts/global_route.tcl @@ -61,12 +61,10 @@ proc global_route_helper { } { # Running DPL to fix overlapped instances # Run to get modified net by DPL + set dpl_args {} + append_env_var dpl_args USE_NEGOTIATION -use_negotiation 0 log_cmd global_route -start_incremental - if { $::env(USE_NEGOTIATION) } { - log_cmd detailed_placement -use_negotiation - } else { - log_cmd detailed_placement - } + log_cmd detailed_placement {*}$dpl_args # Route only the modified net by DPL log_cmd global_route -end_incremental {*}$res_aware \ -congestion_report_file $::env(REPORTS_DIR)/congestion_post_repair_design.rpt @@ -84,11 +82,7 @@ proc global_route_helper { } { # Running DPL to fix overlapped instances # Run to get modified net by DPL log_cmd global_route -start_incremental - if { $::env(USE_NEGOTIATION) } { - log_cmd detailed_placement -use_negotiation - } else { - log_cmd detailed_placement - } + log_cmd detailed_placement {*}$dpl_args check_placement -verbose # Route only the modified net by DPL log_cmd global_route -end_incremental {*}$res_aware \