@@ -2,17 +2,17 @@ yosys -import
22
33source $::env(SCRIPTS_DIR) /util.tcl
44
5- if {[info exist ::env( CACHED_NETLIST) ]} {
5+ if {[env_var_exists_and_non_empty CACHED_NETLIST]} {
66 exec cp $::env(CACHED_NETLIST) $::env(RESULTS_DIR) /1_1_yosys.v
7- if {[info exist ::env( CACHED_REPORTS) ]} {
7+ if {[env_var_exists_and_non_empty CACHED_REPORTS]} {
88 exec cp {*}$::env(CACHED_REPORTS) $::env(REPORTS_DIR) /.
99 }
1010 exit
1111}
1212
1313# Setup verilog include directories
1414set vIdirsArgs " "
15- if {[info exist ::env( VERILOG_INCLUDE_DIRS) ]} {
15+ if {[env_var_exists_and_non_empty VERILOG_INCLUDE_DIRS]} {
1616 foreach dir $::env(VERILOG_INCLUDE_DIRS) {
1717 lappend vIdirsArgs " -I$dir "
1818 }
@@ -39,19 +39,19 @@ foreach file $::env(VERILOG_FILES) {
3939read_liberty -lib {*}$::env(DONT_USE_LIBS)
4040
4141# Apply toplevel parameters (if exist)
42- if {[info exist ::env( VERILOG_TOP_PARAMS) ]} {
42+ if {[env_var_exists_and_non_empty VERILOG_TOP_PARAMS]} {
4343 dict for {key value} $::env(VERILOG_TOP_PARAMS) {
4444 chparam -set $key $value $::env(DESIGN_NAME)
4545 }
4646}
4747
4848# Read platform specific mapfile for OPENROAD_CLKGATE cells
49- if {[info exist ::env( CLKGATE_MAP_FILE) ]} {
49+ if {[env_var_exists_and_non_empty CLKGATE_MAP_FILE]} {
5050 read_verilog -defer $::env(CLKGATE_MAP_FILE)
5151}
5252
5353# Mark modules to keep from getting removed in flattening
54- if {[info exist ::env( PRESERVE_CELLS) ]} {
54+ if {[env_var_exists_and_non_empty PRESERVE_CELLS]} {
5555 # Expand hierarchy since verilog was read in with -defer
5656 hierarchy -check -top $::env(DESIGN_NAME)
5757 foreach cell $::env(PRESERVE_CELLS) {
@@ -77,13 +77,13 @@ set abc_args [list -script $abc_script \
7777
7878# Exclude dont_use cells. This includes macros that are specified via
7979# LIB_FILES and ADDITIONAL_LIBS that are included in LIB_FILES.
80- if {[info exist ::env( DONT_USE_CELLS)] && $::env(DONT_USE_CELLS) != " " } {
80+ if {[env_var_exists_and_non_empty DONT_USE_CELLS] } {
8181 foreach cell $::env(DONT_USE_CELLS) {
8282 lappend abc_args -dont_use $cell
8383 }
8484}
8585
86- if {[info exist ::env( SDC_FILE_CLOCK_PERIOD) ] && [file isfile $::env(SDC_FILE_CLOCK_PERIOD) ]} {
86+ if {[env_var_exists_and_non_empty SDC_FILE_CLOCK_PERIOD] && [file isfile $::env(SDC_FILE_CLOCK_PERIOD) ]} {
8787 puts " Extracting clock period from SDC file: $::env(SDC_FILE_CLOCK_PERIOD) "
8888 set fp [open $::env(SDC_FILE_CLOCK_PERIOD) r]
8989 set clock_period [string trim [read $fp ]]
0 commit comments