Skip to content

Commit bc9164d

Browse files
committed
scripts: use env_var_exists_and_non_empty for consistency and fewer surprises
Signed-off-by: Øyvind Harboe <[email protected]>
1 parent e58a24f commit bc9164d

File tree

8 files changed

+12
-12
lines changed

8 files changed

+12
-12
lines changed

flow/scripts/cts.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ if {[info exists ::env(SKIP_CTS_REPAIR_TIMING)] == 0 || $::env(SKIP_CTS_REPAIR_T
9494

9595
report_metrics 4 "cts final"
9696

97-
if { [info exists ::env(POST_CTS_TCL)] } {
97+
if { [env_var_exists_and_non_empty POST_CTS_TCL] } {
9898
source $::env(POST_CTS_TCL)
9999
}
100100

flow/scripts/detail_route.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ if {![info exist ::env(SKIP_ANTENNA_REPAIR_POST_DRT)]} {
7979
}
8080
}
8181

82-
if { [info exists ::env(POST_DETAIL_ROUTE_TCL)] } {
82+
if { [env_var_exists_and_non_empty POST_DETAIL_ROUTE_TCL] } {
8383
source $::env(POST_DETAIL_ROUTE_TCL)
8484
}
8585

flow/scripts/global_place_skip_io.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ source $::env(SCRIPTS_DIR)/load.tcl
22
load_design 2_floorplan.odb 2_floorplan.sdc
33

44

5-
if { [info exists ::env(FLOORPLAN_DEF)] } {
5+
if { [env_var_exists_and_non_empty FLOORPLAN_DEF] } {
66
puts "FLOORPLAN_DEF is set. Skipping global placement without IOs"
77
} else {
88
source $::env(SCRIPTS_DIR)/set_place_density.tcl

flow/scripts/io_placement_util.tcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
if {[info exists ::env(FLOORPLAN_DEF)]} {
1+
if {[env_var_exists_and_non_empty FLOORPLAN_DEF]} {
22
puts "Skipping IO placement as DEF file was used to initialize floorplan."
33
} else {
4-
if {[info exists ::env(IO_CONSTRAINTS)]} {
4+
if {[env_var_exists_and_non_empty IO_CONSTRAINTS]} {
55
source $::env(IO_CONSTRAINTS)
66
}
77
set args [list -hor_layer $::env(IO_PLACER_H) \

flow/scripts/macro_place_util.tcl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ proc find_macros {} {
1717
if {[find_macros] != ""} {
1818
# If wrappers defined replace macros with their wrapped version
1919
# # ----------------------------------------------------------------------------
20-
if {[info exists ::env(MACRO_WRAPPERS)]} {
20+
if {[env_var_exists_and_non_empty MACRO_WRAPPERS]} {
2121
source $::env(MACRO_WRAPPERS)
2222

2323
set wrapped_macros [dict keys [dict get $wrapper around]]
@@ -40,14 +40,14 @@ if {[find_macros] != ""} {
4040
set blockage_width [expr max($halo_max, $channel_max/2)]
4141

4242

43-
if {[info exists ::env(MACRO_BLOCKAGE_HALO)]} {
43+
if {[env_var_exists_and_non_empty MACRO_BLOCKAGE_HALO]} {
4444
set blockage_width $::env(MACRO_BLOCKAGE_HALO)
4545
}
4646

47-
if {[info exists ::env(MACRO_PLACEMENT_TCL)]} {
47+
if {[env_var_exists_and_non_empty MACRO_PLACEMENT_TCL]} {
4848
source $::env(MACRO_PLACEMENT_TCL)
4949
puts "Using manual macro placement file $::env(MACRO_PLACEMENT_TCL)"
50-
} elseif {[info exists ::env(MACRO_PLACEMENT)]} {
50+
} elseif {[env_var_exists_and_non_empty MACRO_PLACEMENT]} {
5151
source $::env(SCRIPTS_DIR)/read_macro_placement.tcl
5252
puts "Using manual macro placement file $::env(MACRO_PLACEMENT)"
5353
read_macro_placement $::env(MACRO_PLACEMENT)

flow/scripts/read_liberty.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if {[info exists ::env(PLATFORM)] && $::env(PLATFORM) == "asap7"} {
66
}
77

88
#Read Liberty
9-
if {[info exists ::env(CORNERS)]} {
9+
if {[env_var_exists_and_non_empty CORNERS]} {
1010
# corners
1111
define_corners {*}$::env(CORNERS)
1212
foreach corner $::env(CORNERS) {

flow/scripts/report_metrics.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ proc report_metrics { stage when {include_erc true} {include_clock_skew true} }
213213
report_puts "\n=========================================================================="
214214
report_puts "$when report_power"
215215
report_puts "--------------------------------------------------------------------------"
216-
if {[info exists ::env(CORNERS)]} {
216+
if {[env_var_exists_and_non_empty CORNERS]} {
217217
foreach corner $::env(CORNERS) {
218218
report_puts "Corner: $corner"
219219
report_power -corner $corner >> $filename

flow/scripts/resize.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ set_dont_use $::env(DONT_USE_CELLS)
1313
# by default, IO ports will be buffered
1414
# to not buffer IO ports, set environment variable
1515
# DONT_BUFFER_PORT = 1
16-
if { ![info exists ::env(FOOTPRINT)] } {
16+
if { ![env_var_exists_and_non_empty FOOTPRINT] } {
1717
if { ![info exists ::env(DONT_BUFFER_PORTS)] || $::env(DONT_BUFFER_PORTS) == 0 } {
1818
puts "Perform port buffering..."
1919
buffer_ports

0 commit comments

Comments
 (0)