diff --git a/projects/scripts/adi_env.tcl b/projects/scripts/adi_env.tcl index 7656d740c..8e8fb63d0 100644 --- a/projects/scripts/adi_env.tcl +++ b/projects/scripts/adi_env.tcl @@ -15,3 +15,17 @@ if [info exists ::env(ADI_GHDL_DIR)] { set ad_ghdl_dir [file normalize $::env(ADI_GHDL_DIR)] } + +# This helper pocedure retrieves the value of varible from environment if exists, +# other case returns the provided default value +# name - name of the environment variable +# default_value - returned vale in case environment variable does not exists +proc get_env_param {name default_value} { + if [info exists ::env($name)] { + return $::env($name) + } else { + return $default_value + } +} + +