@@ -40,13 +40,7 @@ set num_instances [llength [get_cells -hier *]]
4040puts " number instances in verilog is $num_instances "
4141
4242set additional_args " "
43- if { [info exists ::env(ADDITIONAL_SITES)]} {
44- append additional_args " -additional_sites $::env(ADDITIONAL_SITES) "
45- }
46-
47- proc env_var_exists_and_non_empty {env_var} {
48- return [expr {[info exists ::env($env_var )] && ![string equal $::env($env_var) " " ]}]
49- }
43+ append_env_var additinal_args ADDITIONAL_SITES -additional_sites 1
5044
5145set use_floorplan_def [env_var_exists_and_non_empty FLOORPLAN_DEF]
5246set use_footprint [env_var_exists_and_non_empty FOOTPRINT]
@@ -97,27 +91,27 @@ if {$use_floorplan_def} {
9791 exit 1
9892}
9993
100- if { [info exists ::env( MAKE_TRACKS) ] } {
94+ if { [env_var_exists_and_non_empty MAKE_TRACKS] } {
10195 source $::env(MAKE_TRACKS)
10296} elseif {[file exists $::env(PLATFORM_DIR) /make_tracks.tcl]} {
10397 source $::env(PLATFORM_DIR) /make_tracks.tcl
10498} else {
10599 make_tracks
106100}
107101
108- if {[info exists ::env( FOOTPRINT_TCL) ]} {
102+ if {[env_var_exists_and_non_empty FOOTPRINT_TCL]} {
109103 source $::env(FOOTPRINT_TCL)
110104}
111105
112- if { [info exists ::env( REMOVE_ABC_BUFFERS)] && $::env(REMOVE_ABC_BUFFERS) == 1 } {
106+ if { [env_var_equals REMOVE_ABC_BUFFERS 1] } {
113107 # remove buffers inserted by yosys/abc
114108 remove_buffers
115109} else {
116110 repair_timing_helper 0
117111}
118112
119113# #### Restructure for timing #########
120- if { [info exist ::env( RESYNTH_TIMING_RECOVER)] && $::env(RESYNTH_TIMING_RECOVER) == 1 } {
114+ if { [env_var_equals RESYNTH_TIMING_RECOVER 1] } {
121115 repair_design
122116 repair_timing
123117 # pre restructure area/timing report (ideal clocks)
@@ -156,7 +150,7 @@ report_units
156150report_units_metric
157151report_metrics 2 " floorplan final" false false
158152
159- if { [info exist ::env( RESYNTH_AREA_RECOVER)] && $::env(RESYNTH_AREA_RECOVER) == 1 } {
153+ if { [env_var_equals RESYNTH_AREA_RECOVER 1] } {
160154
161155 utl::push_metrics_stage " floorplan__{}__pre_restruct"
162156 set num_instances [llength [get_cells -hier *]]
@@ -194,7 +188,7 @@ if { [info exist ::env(RESYNTH_AREA_RECOVER)] && $::env(RESYNTH_AREA_RECOVER) ==
194188 utl::pop_metrics_stage
195189}
196190
197- if { [info exists ::env( POST_FLOORPLAN_TCL) ] } {
191+ if { [env_var_exists_and_non_empty POST_FLOORPLAN_TCL] } {
198192 source $::env(POST_FLOORPLAN_TCL)
199193}
200194
0 commit comments