Skip to content

Commit 16d674a

Browse files
committed
improve code readability with append_env_var
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
1 parent 05eca81 commit 16d674a

3 files changed

Lines changed: 11 additions & 25 deletions

File tree

flow/scripts/cts.tcl

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,9 @@ set_placement_padding -global \
4646
-left $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT) \
4747
-right $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT)
4848

49-
if { $::env(USE_NEGOTIATION) } {
50-
set result [catch { log_cmd detailed_placement -use_negotiation } msg]
51-
} else {
52-
set result [catch { log_cmd detailed_placement } msg]
53-
}
49+
set dpl_args {}
50+
append_env_var dpl_args USE_NEGOTIATION -use_negotiation 0
51+
set result [catch { log_cmd detailed_placement {*}$dpl_args } msg]
5452
if { $result != 0 } {
5553
save_progress 4_1_error
5654
error "Detailed placement failed in CTS: $msg"
@@ -74,11 +72,7 @@ if { !$::env(SKIP_CTS_REPAIR_TIMING) } {
7472
run_lec_test 4_rsz 4_before_rsz_lec.v 4_after_rsz_lec.v
7573
}
7674

77-
if { $::env(USE_NEGOTIATION) } {
78-
set result [catch { log_cmd detailed_placement -use_negotiation } msg]
79-
} else {
80-
set result [catch { log_cmd detailed_placement } msg]
81-
}
75+
set result [catch { log_cmd detailed_placement {*}$dpl_args } msg]
8276
if { $result != 0 } {
8377
save_progress 4_1_error
8478
error "Detailed placement failed in CTS: $msg"

flow/scripts/detail_place.tcl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@ proc do_dpl { } {
1515
set_placement_padding -global \
1616
-left $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT) \
1717
-right $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT)
18-
if { $::env(USE_NEGOTIATION) } {
19-
log_cmd detailed_placement -use_negotiation {*}[env_var_or_empty DETAIL_PLACEMENT_ARGS]
20-
} else {
21-
log_cmd detailed_placement {*}[env_var_or_empty DETAIL_PLACEMENT_ARGS]
22-
}
18+
set dpl_args [env_var_or_empty DETAIL_PLACEMENT_ARGS]
19+
append_env_var dpl_args USE_NEGOTIATION -use_negotiation 0
20+
log_cmd detailed_placement {*}$dpl_args
2321

2422
if { $::env(ENABLE_DPO) } {
2523
if { [env_var_exists_and_non_empty DPO_MAX_DISPLACEMENT] } {

flow/scripts/global_route.tcl

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,10 @@ proc global_route_helper { } {
6161

6262
# Running DPL to fix overlapped instances
6363
# Run to get modified net by DPL
64+
set dpl_args {}
65+
append_env_var dpl_args USE_NEGOTIATION -use_negotiation 0
6466
log_cmd global_route -start_incremental
65-
if { $::env(USE_NEGOTIATION) } {
66-
log_cmd detailed_placement -use_negotiation
67-
} else {
68-
log_cmd detailed_placement
69-
}
67+
log_cmd detailed_placement {*}$dpl_args
7068
# Route only the modified net by DPL
7169
log_cmd global_route -end_incremental {*}$res_aware \
7270
-congestion_report_file $::env(REPORTS_DIR)/congestion_post_repair_design.rpt
@@ -84,11 +82,7 @@ proc global_route_helper { } {
8482
# Running DPL to fix overlapped instances
8583
# Run to get modified net by DPL
8684
log_cmd global_route -start_incremental
87-
if { $::env(USE_NEGOTIATION) } {
88-
log_cmd detailed_placement -use_negotiation
89-
} else {
90-
log_cmd detailed_placement
91-
}
85+
log_cmd detailed_placement {*}$dpl_args
9286
check_placement -verbose
9387
# Route only the modified net by DPL
9488
log_cmd global_route -end_incremental {*}$res_aware \

0 commit comments

Comments
 (0)