2014-03-01 02:17:01 +00:00
|
|
|
|
|
|
|
# environment related stuff
|
|
|
|
|
2016-08-19 19:56:07 +00:00
|
|
|
set ad_hdl_dir [file normalize [file join [file dirname [info script]] "../.."]]
|
2019-07-12 07:24:48 +00:00
|
|
|
|
|
|
|
# assuming that ghdl is cloned next to hdl repository
|
|
|
|
set ad_ghdl_dir [file normalize [file join [file dirname [info script]] "../../../ghdl"]]
|
2016-08-19 19:56:07 +00:00
|
|
|
|
2014-03-01 02:17:01 +00:00
|
|
|
|
|
|
|
if [info exists ::env(ADI_HDL_DIR)] {
|
2017-10-23 08:52:53 +00:00
|
|
|
set ad_hdl_dir [file normalize $::env(ADI_HDL_DIR)]
|
2014-03-01 02:17:01 +00:00
|
|
|
}
|
|
|
|
|
2019-07-12 07:24:48 +00:00
|
|
|
if [info exists ::env(ADI_GHDL_DIR)] {
|
2019-07-25 14:58:36 +00:00
|
|
|
set ad_ghdl_dir [file normalize $::env(ADI_GHDL_DIR)]
|
2014-03-01 02:17:01 +00:00
|
|
|
}
|
|
|
|
|
2020-02-07 10:48:47 +00:00
|
|
|
|
|
|
|
# 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)] {
|
2020-05-15 06:42:50 +00:00
|
|
|
puts "Getting from environment the parameter: $name=$::env($name) "
|
2020-02-07 10:48:47 +00:00
|
|
|
return $::env($name)
|
|
|
|
} else {
|
|
|
|
return $default_value
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|