33 lines
921 B
Tcl
33 lines
921 B
Tcl
|
|
# environment related stuff
|
|
|
|
set ad_hdl_dir [file normalize [file join [file dirname [info script]] "../.."]]
|
|
|
|
# assuming that ghdl is cloned next to hdl repository
|
|
set ad_ghdl_dir [file normalize [file join [file dirname [info script]] "../../../ghdl"]]
|
|
|
|
|
|
if [info exists ::env(ADI_HDL_DIR)] {
|
|
set ad_hdl_dir [file normalize $::env(ADI_HDL_DIR)]
|
|
}
|
|
|
|
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)] {
|
|
puts "Getting from environment the parameter: $name=$::env($name) "
|
|
return $::env($name)
|
|
} else {
|
|
return $default_value
|
|
}
|
|
}
|
|
|
|
|