From 26b0f3534ead5fb73aa15eaec6a62f9acd37f495 Mon Sep 17 00:00:00 2001
From: donker <donker@astron.nl>
Date: Wed, 21 Dec 2022 15:13:42 +0100
Subject: [PATCH] L2SDP-880, backup changes

---
 config/hdl_buildset_casperunb1.cfg            |  2 +-
 config/hdl_buildset_casperxpm.cfg             |  2 +-
 config/hdl_buildset_unb1.cfg                  |  2 +-
 config/hdl_buildset_unb2.cfg                  |  2 +-
 config/hdl_buildset_unb2a.cfg                 |  2 +-
 config/hdl_buildset_unb2b.cfg                 | 16 ++--
 config/hdl_buildset_unb2c.cfg                 | 18 ++--
 core/generate_ip_libs                         |  2 +-
 core/hdl_libraries_wizard.py                  |  2 +-
 core/modelsim_config                          |  2 +-
 .../hdlbuildset_files/hdl_buildset_rsp.cfg    |  2 +-
 .../hdlbuildset_files/hdl_buildset_unb1.cfg   |  4 +-
 .../hdlbuildset_files/hdl_buildset_wrong.cfg  |  2 +-
 .../cdf_dir/hdllib_files/hdllib_wrong.cfg     |  6 +-
 .../test/cdf_dir/hdllib_files/test_hdllib.cfg |  6 +-
 .../tree/hdlbuildset/hdl_buildset_rsp.cfg     |  2 +-
 .../tree/hdlbuildset/hdl_buildset_unb1.cfg    |  2 +-
 .../tree/hdllib/technology/test_hdllib.cfg    |  6 +-
 core/test/t_hdl_configfile.py                 |  2 +-
 core/test/t_hdl_configtree.py                 |  2 +-
 doc/hdltool_readme.txt                        | 26 +++---
 doc/radiohdl_hdl_buildset_key_descriptions.md |  2 +-
 doc/radiohdl_hdl_buildset_uniboard1.md        | 18 ++--
 doc/radiohdl_hdl_buildset_uniboard2.md        |  2 +-
 doc/radiohdl_hdl_library_key_descriptions.md  |  4 +-
 doc/radiohdl_hdl_tool_modelsim.md             | 18 ++--
 doc/radiohdl_user_guide.md                    | 12 +--
 init_radiohdl.sh                              | 14 ++--
 modelsim/commands.do                          |  2 +-
 quartus/build_all_images                      | 46 ++++------
 quartus/build_image                           | 46 +++++-----
 quartus/compile_altera_simlibs                |  6 +-
 quartus/run_app                               |  6 +-
 quartus/run_app_clean                         |  2 +-
 quartus/run_bsp                               | 48 +++++------
 quartus/run_mif                               |  2 +-
 quartus/run_qcomp                             | 84 ++++++++++---------
 quartus/run_qsys                              |  2 +-
 quartus/run_qsys_pro                          |  2 +-
 quartus/run_rbf                               |  6 +-
 quartus/run_reg                               |  2 +-
 quartus/run_regtest_synth                     |  4 +-
 quartus/run_sof                               |  2 +-
 quartus/run_sopc                              |  2 +-
 quartus/set_quartus                           |  6 +-
 .../modelsim_regression_test_vhdl.py          |  6 +-
 .../modelsim_regression_test_vhdl_cron.sh     |  4 +-
 .../modelsim_regression_test_vhdl_mail.py     |  4 +-
 regressiontest/quartus_build_images_cron.sh   |  3 +-
 regressiontest/quartus_build_images_mail.py   |  2 +-
 50 files changed, 231 insertions(+), 236 deletions(-)

diff --git a/config/hdl_buildset_casperunb1.cfg b/config/hdl_buildset_casperunb1.cfg
index 54870b0..68d27b4 100644
--- a/config/hdl_buildset_casperunb1.cfg
+++ b/config/hdl_buildset_casperunb1.cfg
@@ -9,7 +9,7 @@ synth_tool_version        = 11.1
 sim_tool_name             = modelsim
 sim_tool_version          = 6.6c
 
-lib_root_dirs             = ${RADIOHDL_WORK}
+lib_root_dirs             = ${HDL_WORK}
 
 [quartus]
 quartus_dir               = ${ALTERA_DIR}/<synth_tool_version>
diff --git a/config/hdl_buildset_casperxpm.cfg b/config/hdl_buildset_casperxpm.cfg
index cf7ae53..ca58df5 100644
--- a/config/hdl_buildset_casperxpm.cfg
+++ b/config/hdl_buildset_casperxpm.cfg
@@ -9,7 +9,7 @@ synth_tool_version        = 11.1 # ???
 sim_tool_name             = modelsim
 sim_tool_version          = 6.6c
 
-lib_root_dirs             = ${RADIOHDL_WORK}
+lib_root_dirs             = ${HDL_WORK}
 
 [quartus]
 
diff --git a/config/hdl_buildset_unb1.cfg b/config/hdl_buildset_unb1.cfg
index dc9c660..3ad266b 100644
--- a/config/hdl_buildset_unb1.cfg
+++ b/config/hdl_buildset_unb1.cfg
@@ -9,7 +9,7 @@ synth_tool_version        = 11.1
 sim_tool_name             = modelsim
 sim_tool_version          = 6.6c
 
-lib_root_dirs             = ${RADIOHDL_WORK}/libraries ${RADIOHDL_WORK}/applications ${RADIOHDL_WORK}/boards
+lib_root_dirs             = ${HDL_WORK}/libraries ${HDL_WORK}/applications ${HDL_WORK}/boards
 
 [quartus]
 quartus_dir               = ${ALTERA_DIR}/<synth_tool_version>
diff --git a/config/hdl_buildset_unb2.cfg b/config/hdl_buildset_unb2.cfg
index e01a706..1d6a0a4 100644
--- a/config/hdl_buildset_unb2.cfg
+++ b/config/hdl_buildset_unb2.cfg
@@ -9,7 +9,7 @@ synth_tool_version        = 15.0
 sim_tool_name             = modelsim
 sim_tool_version          = 10.4
 
-lib_root_dirs             = ${RADIOHDL_WORK}/libraries ${RADIOHDL_WORK}/applications ${RADIOHDL_WORK}/boards
+lib_root_dirs             = ${HDL_WORK}/libraries ${HDL_WORK}/applications ${HDL_WORK}/boards
 
 [quartus]
 quartus_dir               = ${ALTERA_DIR}/<synth_tool_version>
diff --git a/config/hdl_buildset_unb2a.cfg b/config/hdl_buildset_unb2a.cfg
index 518b015..9d1513c 100644
--- a/config/hdl_buildset_unb2a.cfg
+++ b/config/hdl_buildset_unb2a.cfg
@@ -9,7 +9,7 @@ synth_tool_version        = 16.0
 sim_tool_name             = modelsim
 sim_tool_version          = 10.4
 
-lib_root_dirs             = ${RADIOHDL_WORK}/libraries ${RADIOHDL_WORK}/applications ${RADIOHDL_WORK}/boards
+lib_root_dirs             = ${HDL_WORK}/libraries ${HDL_WORK}/applications ${HDL_WORK}/boards
 
 [quartus]
 quartus_dir               = ${ALTERA_DIR}/<synth_tool_version>
diff --git a/config/hdl_buildset_unb2b.cfg b/config/hdl_buildset_unb2b.cfg
index aae7f32..df2a666 100644
--- a/config/hdl_buildset_unb2b.cfg
+++ b/config/hdl_buildset_unb2b.cfg
@@ -9,14 +9,14 @@ synth_tool_version        = 18.0
 sim_tool_name             = modelsim
 sim_tool_version          = 10.4
 
-#lib_root_dirs             = ${RADIOHDL_WORK}/libraries ${RADIOHDL_WORK}/applications ${RADIOHDL_WORK}/boards
-lib_root_dirs             = ${RADIOHDL_WORK}/libraries
-                            ${RADIOHDL_WORK}/boards/uniboard2b/
-                            ${RADIOHDL_WORK}/applications/disturb2
-                            ${RADIOHDL_WORK}/applications/lofar1
-                            ${RADIOHDL_WORK}/applications/lofar2/libraries
-                            ${RADIOHDL_WORK}/applications/lofar2/designs/lofar2_unb2b_sdp_station/
-                            ${RADIOHDL_WORK}/applications/lofar2/designs/lofar2_unb2b_ring/
+#lib_root_dirs             = ${HDL_WORK}/libraries ${HDL_WORK}/applications ${HDL_WORK}/boards
+lib_root_dirs             = ${HDL_WORK}/libraries
+                            ${HDL_WORK}/boards/uniboard2b/
+                            ${HDL_WORK}/applications/disturb2
+                            ${HDL_WORK}/applications/lofar1
+                            ${HDL_WORK}/applications/lofar2/libraries
+                            ${HDL_WORK}/applications/lofar2/designs/lofar2_unb2b_sdp_station/
+                            ${HDL_WORK}/applications/lofar2/designs/lofar2_unb2b_ring/
 
 [quartus]
 quartus_dir               = ${ALTERA_DIR}/<synth_tool_version>
diff --git a/config/hdl_buildset_unb2c.cfg b/config/hdl_buildset_unb2c.cfg
index fac5af5..4846d36 100644
--- a/config/hdl_buildset_unb2c.cfg
+++ b/config/hdl_buildset_unb2c.cfg
@@ -9,15 +9,15 @@ synth_tool_version        = 19.4
 sim_tool_name             = modelsim
 sim_tool_version          = 10.4
 
-#lib_root_dirs             = ${RADIOHDL_WORK}/libraries ${RADIOHDL_WORK}/applications ${RADIOHDL_WORK}/boards
-lib_root_dirs             = ${RADIOHDL_WORK}/libraries
-                            ${RADIOHDL_WORK}/boards/uniboard2c/
-                            ${RADIOHDL_WORK}/applications/disturb2
-                            ${RADIOHDL_WORK}/applications/lofar1
-                            ${RADIOHDL_WORK}/applications/lofar2/libraries
-                            ${RADIOHDL_WORK}/applications/lofar2/designs/lofar2_unb2c_sdp_station/
-                            ${RADIOHDL_WORK}/applications/lofar2/designs/lofar2_unb2c_ring/
-                            ${RADIOHDL_WORK}/applications/lofar2/designs/lofar2_unb2c_ddrctrl/
+#lib_root_dirs             = ${HDL_WORK}/libraries ${HDL_WORK}/applications ${HDL_WORK}/boards
+lib_root_dirs             = ${HDL_WORK}/libraries
+                            ${HDL_WORK}/boards/uniboard2c/
+                            ${HDL_WORK}/applications/disturb2
+                            ${HDL_WORK}/applications/lofar1
+                            ${HDL_WORK}/applications/lofar2/libraries
+                            ${HDL_WORK}/applications/lofar2/designs/lofar2_unb2c_sdp_station/
+                            ${HDL_WORK}/applications/lofar2/designs/lofar2_unb2c_ring/
+                            ${HDL_WORK}/applications/lofar2/designs/lofar2_unb2c_ddrctrl/
 
 [quartus]
 quartus_dir               = ${ALTERA_DIR}/<synth_tool_version>
diff --git a/core/generate_ip_libs b/core/generate_ip_libs
index e81fa0c..0d0851f 100755
--- a/core/generate_ip_libs
+++ b/core/generate_ip_libs
@@ -179,7 +179,7 @@ if __name__ == '__main__':
                 if ip_lib_info.hdl_lib_technology == technology and ip_tool_key in ip_lib_info.content:
                     # we have a match do the compilation
                     print("==> Processing {} with {}".format(ip_lib_info.ID, ip_tool))
-                    outputdir = os.path.join(os.getenv('RADIOHDL_BUILD_DIR'), '{}/{}/'.format(args.buildset, ip_tool))
+                    outputdir = os.path.join(os.getenv('HDL_BUILD_DIR'), '{}/{}/'.format(args.buildset, ip_tool))
                     mkdir(outputdir)
                     vhdl_files = [name for name in ip_lib_info[ip_tool_key].replace("\t", " ").split(" ")
                                   if name != '']
diff --git a/core/hdl_libraries_wizard.py b/core/hdl_libraries_wizard.py
index 159399b..6435060 100644
--- a/core/hdl_libraries_wizard.py
+++ b/core/hdl_libraries_wizard.py
@@ -417,7 +417,7 @@ class HdlLibrariesWizard:
             - project_deeper_subdir = 'p/p/p/' when project_dir_depth_<build_type> = 3, etc
         """
         # Determine build_maindir
-        build_maindir = expandvars('${RADIOHDL_BUILD_DIR}')
+        build_maindir = expandvars('${HDL_BUILD_DIR}')
         if not isabs(build_maindir):
             sys.exit('Error : The build_dir value must be an absolute path')
 
diff --git a/core/modelsim_config b/core/modelsim_config
index 4cff95d..4d61e7c 100755
--- a/core/modelsim_config
+++ b/core/modelsim_config
@@ -112,7 +112,7 @@ class ModelsimConfig(hdl_libraries_wizard.HdlLibrariesWizard):
         """
         fileName = 'hdl_libraries_ip_' + technologyName + '.txt'         # use fixed file name format
         if filePath is None:
-            toolDir    = os.path.expandvars('$RADIOHDL_BUILD_DIR')
+            toolDir    = os.path.expandvars('$HDL_BUILD_DIR')
             toolSubDir = self.buildset['buildset_name']
             fileNamePath = os.path.join(toolDir, toolSubDir, fileName)          # default file path
         else:
diff --git a/core/test/cdf_dir/hdlbuildset_files/hdl_buildset_rsp.cfg b/core/test/cdf_dir/hdlbuildset_files/hdl_buildset_rsp.cfg
index dd80b96..ecc91ad 100644
--- a/core/test/cdf_dir/hdlbuildset_files/hdl_buildset_rsp.cfg
+++ b/core/test/cdf_dir/hdlbuildset_files/hdl_buildset_rsp.cfg
@@ -14,7 +14,7 @@ project_dir_depth_sim     = 4
 project_dir_depth_synth   = 0
 
 lib_root_dir              = $RSP
-build_dir                 = $RADIOHDL_BUILD_DIR
+build_dir                 = $HDL_BUILD_DIR
 quartus_dir               = /home/software/Altera/<synth_tool_version>
 model_tech_altera_lib     = /home/software/modelsim_altera_libs/<synth_tool_version>
 model_tech_dir            = /home/software/Mentor/<sim_tool_version>/modeltech
diff --git a/core/test/cdf_dir/hdlbuildset_files/hdl_buildset_unb1.cfg b/core/test/cdf_dir/hdlbuildset_files/hdl_buildset_unb1.cfg
index 2dd24f4..12716c0 100644
--- a/core/test/cdf_dir/hdlbuildset_files/hdl_buildset_unb1.cfg
+++ b/core/test/cdf_dir/hdlbuildset_files/hdl_buildset_unb1.cfg
@@ -9,8 +9,8 @@ sim_tool_version          = 6.6c
 synth_tool_name           = quartus
 synth_tool_version        = 11.1sp2
 
-lib_root_dirs             = ${RADIOHDL_WORK}/libraries ${RADIOHDL_WORK}/applications ${RADIOHDL_WORK}/boards
-build_dir                 = $RADIOHDL_BUILD_DIR
+lib_root_dirs             = ${HDL_WORK}/libraries ${HDL_WORK}/applications ${HDL_WORK}/boards
+build_dir                 = $HDL_BUILD_DIR
 quartus_dir               = /home/software/Altera/<synth_tool_version>
 model_tech_altera_lib     = /home/software/modelsim_altera_libs/<synth_tool_version>
 model_tech_dir            = /home/software/Mentor/<sim_tool_version>/modeltech
diff --git a/core/test/cdf_dir/hdlbuildset_files/hdl_buildset_wrong.cfg b/core/test/cdf_dir/hdlbuildset_files/hdl_buildset_wrong.cfg
index 3c1db60..710001c 100644
--- a/core/test/cdf_dir/hdlbuildset_files/hdl_buildset_wrong.cfg
+++ b/core/test/cdf_dir/hdlbuildset_files/hdl_buildset_wrong.cfg
@@ -10,7 +10,7 @@ synth_tool_name           = quartus
 synth_tool_version        = 11.1sp2
 
 lib_root_dir              = $HDL
-build_dir                 = $RADIOHDL_BUILD_DIR
+build_dir                 = $HDL_BUILD_DIR
 quartus_dir               = /home/software/Altera/<synth_tool_version>
 model_tech_altera_lib     = /home/software/modelsim_altera_libs/<synth_tool_version>
 model_tech_dir            = /home/software/Mentor/<sim_tool_version>/modeltech
diff --git a/core/test/cdf_dir/hdllib_files/hdllib_wrong.cfg b/core/test/cdf_dir/hdllib_files/hdllib_wrong.cfg
index a0b4b0c..5380c8e 100644
--- a/core/test/cdf_dir/hdllib_files/hdllib_wrong.cfg
+++ b/core/test/cdf_dir/hdllib_files/hdllib_wrong.cfg
@@ -6,7 +6,7 @@ hdl_lib_technology =
 
 synth_files =
     technology_pkg.vhd
-    $RADIOHDL_BUILD_DIR/<buildset_name>/modelsim/technology/technology_select_pkg.vhd
+    $HDL_BUILD_DIR/<buildset_name>/modelsim/technology/technology_select_pkg.vhd
 test_bench_files =
 
 regression_test_vhdl = 
@@ -15,10 +15,10 @@ regression_test_vhdl =
 
 [modelsim_project_file]
 modelsim_copy_files = 
-    technology_select_pkg_<buildset_name>.vhd $RADIOHDL_BUILD_DIR/<buildset_name>/modelsim/technology/technology_select_pkg.vhd
+    technology_select_pkg_<buildset_name>.vhd $HDL_BUILD_DIR/<buildset_name>/modelsim/technology/technology_select_pkg.vhd
 
 
 
 [quartus_project_file]
 quartus_copy_files =
-    technology_select_pkg_<buildset_name>.vhd $RADIOHDL_BUILD_DIR/<buildset_name>/quartus/technology/technology_select_pkg.vhd
+    technology_select_pkg_<buildset_name>.vhd $HDL_BUILD_DIR/<buildset_name>/quartus/technology/technology_select_pkg.vhd
diff --git a/core/test/cdf_dir/hdllib_files/test_hdllib.cfg b/core/test/cdf_dir/hdllib_files/test_hdllib.cfg
index 20e85f3..c248393 100644
--- a/core/test/cdf_dir/hdllib_files/test_hdllib.cfg
+++ b/core/test/cdf_dir/hdllib_files/test_hdllib.cfg
@@ -6,7 +6,7 @@ hdl_lib_technology =
 
 synth_files =
     technology_pkg.vhd
-    $RADIOHDL_BUILD_DIR/<buildset_name>/modelsim/technology/technology_select_pkg.vhd
+    $HDL_BUILD_DIR/<buildset_name>/modelsim/technology/technology_select_pkg.vhd
 test_bench_files =
 
 regression_test_vhdl = 
@@ -15,10 +15,10 @@ regression_test_vhdl =
 
 [modelsim_project_file]
 modelsim_copy_files = 
-    technology_select_pkg_<buildset_name>.vhd $RADIOHDL_BUILD_DIR/<buildset_name>/modelsim/technology/technology_select_pkg.vhd
+    technology_select_pkg_<buildset_name>.vhd $HDL_BUILD_DIR/<buildset_name>/modelsim/technology/technology_select_pkg.vhd
 
 
 
 [quartus_project_file]
 quartus_copy_files =
-    technology_select_pkg_<buildset_name>.vhd $RADIOHDL_BUILD_DIR/<buildset_name>/quartus/technology/technology_select_pkg.vhd
+    technology_select_pkg_<buildset_name>.vhd $HDL_BUILD_DIR/<buildset_name>/quartus/technology/technology_select_pkg.vhd
diff --git a/core/test/cdf_dir/tree/hdlbuildset/hdl_buildset_rsp.cfg b/core/test/cdf_dir/tree/hdlbuildset/hdl_buildset_rsp.cfg
index dd80b96..ecc91ad 100644
--- a/core/test/cdf_dir/tree/hdlbuildset/hdl_buildset_rsp.cfg
+++ b/core/test/cdf_dir/tree/hdlbuildset/hdl_buildset_rsp.cfg
@@ -14,7 +14,7 @@ project_dir_depth_sim     = 4
 project_dir_depth_synth   = 0
 
 lib_root_dir              = $RSP
-build_dir                 = $RADIOHDL_BUILD_DIR
+build_dir                 = $HDL_BUILD_DIR
 quartus_dir               = /home/software/Altera/<synth_tool_version>
 model_tech_altera_lib     = /home/software/modelsim_altera_libs/<synth_tool_version>
 model_tech_dir            = /home/software/Mentor/<sim_tool_version>/modeltech
diff --git a/core/test/cdf_dir/tree/hdlbuildset/hdl_buildset_unb1.cfg b/core/test/cdf_dir/tree/hdlbuildset/hdl_buildset_unb1.cfg
index 15ff894..1efd231 100644
--- a/core/test/cdf_dir/tree/hdlbuildset/hdl_buildset_unb1.cfg
+++ b/core/test/cdf_dir/tree/hdlbuildset/hdl_buildset_unb1.cfg
@@ -10,7 +10,7 @@ synth_tool_name           = quartus
 synth_tool_version        = 11.1sp2
 
 lib_root_dir              = $HDL
-build_dir                 = $RADIOHDL_BUILD_DIR
+build_dir                 = $HDL_BUILD_DIR
 quartus_dir               = /home/software/Altera/<synth_tool_version>
 model_tech_altera_lib     = /home/software/modelsim_altera_libs/<synth_tool_version>
 model_tech_dir            = /home/software/Mentor/<sim_tool_version>/modeltech
diff --git a/core/test/cdf_dir/tree/hdllib/technology/test_hdllib.cfg b/core/test/cdf_dir/tree/hdllib/technology/test_hdllib.cfg
index 20e85f3..c248393 100644
--- a/core/test/cdf_dir/tree/hdllib/technology/test_hdllib.cfg
+++ b/core/test/cdf_dir/tree/hdllib/technology/test_hdllib.cfg
@@ -6,7 +6,7 @@ hdl_lib_technology =
 
 synth_files =
     technology_pkg.vhd
-    $RADIOHDL_BUILD_DIR/<buildset_name>/modelsim/technology/technology_select_pkg.vhd
+    $HDL_BUILD_DIR/<buildset_name>/modelsim/technology/technology_select_pkg.vhd
 test_bench_files =
 
 regression_test_vhdl = 
@@ -15,10 +15,10 @@ regression_test_vhdl =
 
 [modelsim_project_file]
 modelsim_copy_files = 
-    technology_select_pkg_<buildset_name>.vhd $RADIOHDL_BUILD_DIR/<buildset_name>/modelsim/technology/technology_select_pkg.vhd
+    technology_select_pkg_<buildset_name>.vhd $HDL_BUILD_DIR/<buildset_name>/modelsim/technology/technology_select_pkg.vhd
 
 
 
 [quartus_project_file]
 quartus_copy_files =
-    technology_select_pkg_<buildset_name>.vhd $RADIOHDL_BUILD_DIR/<buildset_name>/quartus/technology/technology_select_pkg.vhd
+    technology_select_pkg_<buildset_name>.vhd $HDL_BUILD_DIR/<buildset_name>/quartus/technology/technology_select_pkg.vhd
diff --git a/core/test/t_hdl_configfile.py b/core/test/t_hdl_configfile.py
index 8e3fb6f..eef9f61 100644
--- a/core/test/t_hdl_configfile.py
+++ b/core/test/t_hdl_configfile.py
@@ -143,7 +143,7 @@ class Test_hdl_buildset_file(unittest.TestCase):
         buildset = HdlBuildset("./cdf_dir/hdlbuildset_files/hdl_buildset_unb1.cfg")
         self.assertEqual(buildset.buildset_name, "unb1")
         self.assertEqual(buildset.technology_names, "ip_stratixiv")
-        self.assertEqual(buildset.lib_root_dirs, "${RADIOHDL_WORK}/libraries ${RADIOHDL_WORK}/applications ${RADIOHDL_WORK}/boards")
+        self.assertEqual(buildset.lib_root_dirs, "${HDL_WORK}/libraries ${HDL_WORK}/applications ${HDL_WORK}/boards")
 
     def test_read_wrong_hdlbuildset_file(self):
         self.assertRaises(ConfigFileException, HdlBuildset, "./cdf_dir/hdlbuildset_files/hdl_buildset_wrong.cfg")
diff --git a/core/test/t_hdl_configtree.py b/core/test/t_hdl_configtree.py
index 14feca0..a8143fe 100644
--- a/core/test/t_hdl_configtree.py
+++ b/core/test/t_hdl_configtree.py
@@ -61,7 +61,7 @@ class Test_tree_behaviour(unittest.TestCase):
     self.assertEqual(util.synth_files, 'src/vhdl/util_logic.vhd src/vhdl/util_heater_pkg.vhd src/vhdl/util_heater.vhd')
     technology = tree.configfiles['technology']
     self.assertEqual(technology.hdl_library_clause_name, 'technology_lib')
-    self.assertEqual(technology.synth_files, 'technology_pkg.vhd $RADIOHDL_BUILD_DIR/<buildset_name>/modelsim/technology/technology_select_pkg.vhd')
+    self.assertEqual(technology.synth_files, 'technology_pkg.vhd $HDL_BUILD_DIR/<buildset_name>/modelsim/technology/technology_select_pkg.vhd')
 
     def test_hdlbuildset_tree(self):
         "Test if we can read in a tree with hdlbuildset files."
diff --git a/doc/hdltool_readme.txt b/doc/hdltool_readme.txt
index 9b7a9bc..59d33c6 100644
--- a/doc/hdltool_readme.txt
+++ b/doc/hdltool_readme.txt
@@ -296,35 +296,35 @@ b) Generate Quartus IP key
    can then generate the IP for all libraries that have such a key. The IP can then be generated outside the SVN tree.
    The $IP_DIR path compile_ip.tcl needs to be adjusted to generated/ and the IP then gets generated in:
    
-      $RADIOHDL_BUILD_DIR/<buildset_name>/quartus/<hdl_lib_name>/generated
+      $HDL_BUILD_DIR/<buildset_name>/quartus/<hdl_lib_name>/generated
    
    For generated IP that is kept in SVN that IP could still remain there.
    
    The hdllib.cfg should then also define a IP tool name subdirectory in build dir, eg.:
     
-     $RADIOHDL_BUILD_DIR/<buildset_name>/<tool_name> = $HDL_BUILD_DIR/qsys        or
+     $HDL_BUILD_DIR/<buildset_name>/<tool_name> = $HDL_BUILD_DIR/qsys        or
                                                         $HDL_BUILD_DIR/megawizard
     
-   or more general $RADIOHDL_BUILD_DIR/ip?
-   The $RADIOHDL_BUILD_DIR now has a modelsim and quartus subdir:
+   or more general $HDL_BUILD_DIR/ip?
+   The $HDL_BUILD_DIR now has a modelsim and quartus subdir:
     
-      $RADIOHDL_BUILD_DIR/<buildset_name>/modelsim       -- made by modelsim_config.py using sim_tool_name from hdl_buildset_<buildset_name>.cfg
-      $RADIOHDL_BUILD_DIR/<buildset_name>/quartus        -- made by quartus_config.py using synth_tool_name from hdl_buildset_<buildset_name>.cfg
+      $HDL_BUILD_DIR/<buildset_name>/modelsim       -- made by modelsim_config.py using sim_tool_name from hdl_buildset_<buildset_name>.cfg
+      $HDL_BUILD_DIR/<buildset_name>/quartus        -- made by quartus_config.py using synth_tool_name from hdl_buildset_<buildset_name>.cfg
    
    The IP can be put in a subdir using eg 'tool_name_ip' = quartus_ip:
    
-      $RADIOHDL_BUILD_DIR/<buildset_name>/quartus_ip     -- made by quartus_config.py using a new tool_name_ip from hdl_buildset_<buildset_name>.cfg
+      $HDL_BUILD_DIR/<buildset_name>/quartus_ip     -- made by quartus_config.py using a new tool_name_ip from hdl_buildset_<buildset_name>.cfg
       
    or can it be put in the synth_tool_name directory:
    
-      $RADIOHDL_BUILD_DIR/<buildset_name>/quartus
+      $HDL_BUILD_DIR/<buildset_name>/quartus
       
    or do we need tool_name_megawizard and tool_name_qsys to be able to create:
                                       
-      $RADIOHDL_BUILD_DIR/<buildset_name>/<tool_name>
-      $RADIOHDL_BUILD_DIR/unb1/megawizard     -- Altera MegaWizard
-      $RADIOHDL_BUILD_DIR/unb1/qsys           -- Altera QSYS
-      $RADIOHDL_BUILD_DIR/unb1/coregen        -- Xilinx
+      $HDL_BUILD_DIR/<buildset_name>/<tool_name>
+      $HDL_BUILD_DIR/unb1/megawizard     -- Altera MegaWizard
+      $HDL_BUILD_DIR/unb1/qsys           -- Altera QSYS
+      $HDL_BUILD_DIR/unb1/coregen        -- Xilinx
       
    Probably it is not so important whether the IP is generated by MegaWizard or Qsys, because that selection is
    already covered by the generate_ip.sh scripts. In the hdl_buildset_<buildset_name>.cfg both MegaWizard and Qsys can be regarded as
@@ -399,7 +399,7 @@ by hdl_config.py, so these IP libraries will not be build.
 
 The build directory currently contains:
 
-  $RADIOHDL_BUILD_DIR/<buildset_name>/<tool_name>/<hdl_lib_name>
+  $HDL_BUILD_DIR/<buildset_name>/<tool_name>/<hdl_lib_name>
 
 This scheme is probably still sufficent to also support the FPGA technology as a triplet. However it may be necessary to rename the
 library key values in the IP hdllib.cfg to contain the full triplet information, so eg.
diff --git a/doc/radiohdl_hdl_buildset_key_descriptions.md b/doc/radiohdl_hdl_buildset_key_descriptions.md
index d34b70f..4a6ddbc 100644
--- a/doc/radiohdl_hdl_buildset_key_descriptions.md
+++ b/doc/radiohdl_hdl_buildset_key_descriptions.md
@@ -57,7 +57,7 @@ Name and version of simulation tool to use with this buildset. Used as subdirect
 Name and version of synthesis tool to use with this buildset. Used as subdirectory name in the build directory, e.g. quartus, 11.1. Note: RadioHDL will look for a key in this config file that has the name of the value of sim_tool_name extended with '_dir'. So in this example file RadioHDL expects a key with the name quartus_dir.
 
 ***lib_root_dirs***  
-List of one or more root directories from where all HDL library configuration files (hdllib.cfg) are searched. There is only a single root directory for the build tree, that is defined by $RADIOHDL_BUILD_DIR.
+List of one or more root directories from where all HDL library configuration files (hdllib.cfg) are searched. There is only a single root directory for the build tree, that is defined by $HDL_BUILD_DIR.
 
 ### 2.1 [modelsim]
 ***modelsim_dir***  
diff --git a/doc/radiohdl_hdl_buildset_uniboard1.md b/doc/radiohdl_hdl_buildset_uniboard1.md
index fed70c8..0846d07 100644
--- a/doc/radiohdl_hdl_buildset_uniboard1.md
+++ b/doc/radiohdl_hdl_buildset_uniboard1.md
@@ -87,10 +87,10 @@ The UniBoard1 HDL source code is available in a source directory tree at hdl/. S
 ```
 The init_hdl.sh defines:
 
-- RADIOHDL_WORK directory for where the source code resides
-- RADIOHDL_BUILD_DIR directory for where the targets will be build
+- HDL_WORK directory for where the source code resides
+- HDL_BUILD_DIR directory for where the targets will be build
   
-The init_hdl.sh copies version controlled ${RADIOHDL_WORK}/hdl_user_components.ipx into the Altera dir's at ```$ALTERA_DIR/<tool version>/ip/altera/user_components.ipx```. This Altera user_components.ipx contains the search paths that Altera SOPC builder and Altera QSYS use.
+The init_hdl.sh copies version controlled ${HDL_WORK}/hdl_user_components.ipx into the Altera dir's at ```$ALTERA_DIR/<tool version>/ip/altera/user_components.ipx```. This Altera user_components.ipx contains the search paths that Altera SOPC builder and Altera QSYS use.
 
 > **NOTE:** Altera says that you can use your personal user_components.ipx file in ```~/.altera.quartus/ip/<quartus_version>/ip_search_path``` for this kind of additional paths but tests show that this does not work for all tools of Altera. Therefore the user_components.ipx file is copied to the Altera installation directory.
 
@@ -103,7 +103,7 @@ The init_hdl.sh can automatically also source init_radiohdl.sh, or source these
 The init_radiohdl.sh from the RadioHDL package defines:
 
 - RADIOHDL_GEAR directory of where the init_radiohdl.sh is located
-- RADIOHDL_BUILD_DIR = ${RADIOHDL_BUILD_DIR}/build if not already defined
+- HDL_BUILD_DIR = ${HDL_BUILD_DIR}/build if not already defined
 - RADIOHDL_CONFIG = ${RADIOHDL_GEAR}/config if not already defined
                                 
 The init_radiohdl.sh extends:
@@ -170,7 +170,7 @@ Creates:
 * directories ```build/unb1/quartus/<hdllib libraries>``` with Quartus files for synthesis
 * file build/unb1/quartus/technology_select_pkg.vhd to select stratixiv technology for UniBoard1
 
-The quartus_config creates the Quartus qpf, qsf for a top level design library and Quartus qip files all libraries. If a new VHDL file is added to a library or if a filename is changed, then it is necessary to rerun the quartus_config. Typically it is not necessary to do delete the entire $RADIOHDL_BUILD_DIR library of the design directory, but it can be necessary to make sure that Quartus is not 'confused' by obsolete files in that build directory. Make sure that any image files that needs to be kept are saved elsewhere, before deleting the build directory of the design library.
+The quartus_config creates the Quartus qpf, qsf for a top level design library and Quartus qip files all libraries. If a new VHDL file is added to a library or if a filename is changed, then it is necessary to rerun the quartus_config. Typically it is not necessary to do delete the entire $HDL_BUILD_DIR library of the design directory, but it can be necessary to make sure that Quartus is not 'confused' by obsolete files in that build directory. Make sure that any image files that needs to be kept are saved elsewhere, before deleting the build directory of the design library.
 
 
 #### 2.4.5 Create an IP block design for a design library in your project
@@ -190,7 +190,7 @@ Syntax:
   > run_qsys <buildset> <project> [<qsysfile>]  
   > run_sopc <buildset> <project> [<sopcfile>]  
 ```
-Both utilities only differ in name not in functionality. The ```<project>``` is a HDL library directory that needs to exist under $RADIOHDL_BUILD_DIR/${buildset}/quartus. If no ```<qsysfile>``` respectively ```<sopcfile>``` is specified during the invocation, then the utility will look for a file with the name ```<project>.qsys``` or ```<project>.sopc``` in the project directory.
+Both utilities only differ in name not in functionality. The ```<project>``` is a HDL library directory that needs to exist under $HDL_BUILD_DIR/${buildset}/quartus. If no ```<qsysfile>``` respectively ```<sopcfile>``` is specified during the invocation, then the utility will look for a file with the name ```<project>.qsys``` or ```<project>.sopc``` in the project directory.
 
 After generating all necessary files the utility will also build the software for the NiosII application using the RadioHDL run_app script. This run_app calls run_bsp and run_reg. The run_reg calls run_mif. For the FPGA designs on UniBoard the NiosII software application is fixed, because it implements the monitoring and control protocol interface between the 1GbE port and the memory mapped bus that is generated by SOPC or QSYS. The NiosII is the master on the memory mapped bus, and the slaves are configurable dependent on the design.
 
@@ -240,9 +240,9 @@ synth_tool_version        = 11.1
 sim_tool_name             = modelsim  
 sim_tool_version          = 6.6c  
   
-lib_root_dirs             = ${RADIOHDL_WORK}/libraries  
-                            ${RADIOHDL_WORK}/applications  
-                            ${RADIOHDL_WORK}/boards  
+lib_root_dirs             = ${HDL_WORK}/libraries  
+                            ${HDL_WORK}/applications  
+                            ${HDL_WORK}/boards  
   
 [quartus]  
 quartus_dir               = ${ALTERA_DIR}/<synth_tool_version>  
diff --git a/doc/radiohdl_hdl_buildset_uniboard2.md b/doc/radiohdl_hdl_buildset_uniboard2.md
index c13f708..cd43c3b 100644
--- a/doc/radiohdl_hdl_buildset_uniboard2.md
+++ b/doc/radiohdl_hdl_buildset_uniboard2.md
@@ -65,7 +65,7 @@ synth_tool_version        = 18.0
 sim_tool_name             = modelsim
 sim_tool_version          = 10.4
 
-lib_root_dirs             = ${RADIOHDL_WORK}/libraries ${RADIOHDL_WORK}/applications ${RADIOHDL_WORK}/boards
+lib_root_dirs             = ${HDL_WORK}/libraries ${HDL_WORK}/applications ${HDL_WORK}/boards
 
 [quartus]
 quartus_dir               = ${ALTERA_DIR}/<synth_tool_version>
diff --git a/doc/radiohdl_hdl_library_key_descriptions.md b/doc/radiohdl_hdl_library_key_descriptions.md
index 337e5b8..61c06fd 100644
--- a/doc/radiohdl_hdl_library_key_descriptions.md
+++ b/doc/radiohdl_hdl_library_key_descriptions.md
@@ -302,7 +302,7 @@ hdl_lib_uses_sim =
 hdl_lib_technology = ip_stratixiv
 
 synth_files =
-    $RADIOHDL_BUILD_DIR/unb1/quartus/unb1_minimal_sopc/sopc_unb1_minimal.vhd
+    $HDL_BUILD_DIR/unb1/quartus/unb1_minimal_sopc/sopc_unb1_minimal.vhd
     src/vhdl/qsys_unb1_minimal_pkg.vhd
     src/vhdl/mmm_unb1_minimal.vhd
     src/vhdl/unb1_minimal.vhd
@@ -382,7 +382,7 @@ test_bench_files =
 modelsim_copy_files =  
     
 modelsim_compile_ip_files =  
-    $RADIOHDL_WORK/libraries/technology/ip_stratixiv/mac_10g/compile_ip.tcl    
+    $HDL_WORK/libraries/technology/ip_stratixiv/mac_10g/compile_ip.tcl    
   
 [quartus_project_file]  
 quartus_copy_files =  
diff --git a/doc/radiohdl_hdl_tool_modelsim.md b/doc/radiohdl_hdl_tool_modelsim.md
index bb53971..86b7f1c 100644
--- a/doc/radiohdl_hdl_tool_modelsim.md
+++ b/doc/radiohdl_hdl_tool_modelsim.md
@@ -53,7 +53,7 @@ If the HDL uses vendor technology libraries then run the corresponding vendor sp
 
 ---
 ## 2 Creating Modelsim project files
-The binaries for Modelsim are built in a separate directory tree under $RADIOHDL_BUILD_DIR.
+The binaries for Modelsim are built in a separate directory tree under $HDL_BUILD_DIR.
 Use modelsim_config to create the Modelsim project files (mpf) for all your HDL libraries. In this example the quick start buildset 'qs' is used:
 ```
   > modelsim_config -h
@@ -61,21 +61,21 @@ Use modelsim_config to create the Modelsim project files (mpf) for all your HDL
 ```
 The modelsim_config script puts the created files and copied files in the build directory, at:
 ```
-$RADIOHDL_BUILD_DIR/<buildset_name>/<sim_tool_name>/<hdl_lib_name>
+$HDL_BUILD_DIR/<buildset_name>/<sim_tool_name>/<hdl_lib_name>
 ```
 For 'buildset_name = qs' and 'sim_tool_name = modelsim' defined in hdl_buildset_qs.cfg this is at:
 ```
-  $RADIOHDL_BUILD_DIR/qs/modelsim
+  $HDL_BUILD_DIR/qs/modelsim
 ```
-The ```<hdl_lib_name>``` sub directories follow from the 'hdl_lib_name' key that is defined in the hdllib.cfg configuration files per HDL library. The modelsim_config script finds all hdllib.cfg files within 'lib_root_dirs = ${RADIOHDL_WORK}' that is defined in hdl_buildset_qs.cfg. The lib_root_dirs  can list one or more search trees.
+The ```<hdl_lib_name>``` sub directories follow from the 'hdl_lib_name' key that is defined in the hdllib.cfg configuration files per HDL library. The modelsim_config script finds all hdllib.cfg files within 'lib_root_dirs = ${HDL_WORK}' that is defined in hdl_buildset_qs.cfg. The lib_root_dirs  can list one or more search trees.
 
 Optionally you can clear this directory before running modelsim_config because everything is recreated:
 ```
-  > rm -rf $RADIOHDL_BUILD_DIR/qs/modelsim
+  > rm -rf $HDL_BUILD_DIR/qs/modelsim
 ```
 If the HDL library dependencies change, e.g. because a new VHDL file is added to a library, or if a filename is changed, then it is necessary to rerun the modelsim_config.
 
-In addition to the Modelsim project files the modelsim_config also generates some auxiliary files that are used by commands.do in run_modelsim as quick reference to all HDL libraries. The central modelsim_project_files.txt at $RADIOHDL_BUILD_DIR/qs/modelsim/ contains a list of the paths to all HDL libraries. Per HDL library there is a ```<lib_name>_lib_order.txt``` file that contains a list of all HDL libraries  that this HDL library depends on in order.
+In addition to the Modelsim project files the modelsim_config also generates some auxiliary files that are used by commands.do in run_modelsim as quick reference to all HDL libraries. The central modelsim_project_files.txt at $HDL_BUILD_DIR/qs/modelsim/ contains a list of the paths to all HDL libraries. Per HDL library there is a ```<lib_name>_lib_order.txt``` file that contains a list of all HDL libraries  that this HDL library depends on in order.
 
 ---
 ## 3 Using Modelsim
@@ -129,7 +129,7 @@ Load Modelsim project file for HDL library dp_repack_data:
 ```
   ModelSim> lp dp_repack_data
 ```
-Clean build directories and makefiles in $RADIOHDL_BUILD_DIR that were made for dp_repack_data:
+Clean build directories and makefiles in $HDL_BUILD_DIR that were made for dp_repack_data:
 ```
   ModelSim> mk clean all
 ```
@@ -145,7 +145,7 @@ To make only the specific common_pkg library do:
 ```
   ModelSim> mk common_pkg
 ```
-The first time 'mk all' is called the libraries are compiled and the library makefiles are made. The library makefiles are stored in the library build directories in $RADIOHDL_BUILD_DIR. It is important that all libraries compile OK, because otherwise the library makefiles are not created properly. Therefore if a library fails to compile, then load that library project with 'lp' and keep on doing 'mk compile' until the library compiles OK. Then when it compiles OK do 'mk clean' to clear the library build directory at $RADIOHDL_BUILD_DIR, and then do 'mk' or 'mk all' to compile the library again and create a proper makefile. Repeat this process until also the top level HDL library compiles OK.
+The first time 'mk all' is called the libraries are compiled and the library makefiles are made. The library makefiles are stored in the library build directories in $HDL_BUILD_DIR. It is important that all libraries compile OK, because otherwise the library makefiles are not created properly. Therefore if a library fails to compile, then load that library project with 'lp' and keep on doing 'mk compile' until the library compiles OK. Then when it compiles OK do 'mk clean' to clear the library build directory at $HDL_BUILD_DIR, and then do 'mk' or 'mk all' to compile the library again and create a proper makefile. Repeat this process until also the top level HDL library compiles OK.
 
 With the proper makefiles for all HDL libraries it is sufficient to use 'mk' to automatically recompile only the HDL source files that changed or that depend on the changed file. Similar with 'mk all' a change in some lower level library HDL file will only cause that the HDL files that depend on it will be recompiled. For a big project with many libraries using 'mk all' is much easier and faster to use than 'mk compile all'. Doing 'mk all' and again 'mk all' should show that the second 'mk all' did not need to recompile any HDL again.
 
@@ -165,7 +165,7 @@ Then the 'mk all' in the dp_repack_data library will not recompile the libraries
 ```
 Then the 'mk all' in the dp_repack_data library will recompile and recreate the makefile for the common_pkg library, and then reompile the HDL files in the higher libraries (up to dp_repack_data) that directly or indirectly depend on a HDL file in the common_pkg library.
 
-If a new VHDL file is added to a library or if a filename is changed, then it is necessary to rerun the modelsim_config and to do 'mk clean' on that library. It is important that Modelsim does not have that library open already, so either quit Modelsim first or 'lp' to another library first, before running modelsim_config. Typically it is not necessary to do 'mk clean all', nor is it necessary to delete the entire $RADIOHDL_BUILD_DIR library subdirectories.
+If a new VHDL file is added to a library or if a filename is changed, then it is necessary to rerun the modelsim_config and to do 'mk clean' on that library. It is important that Modelsim does not have that library open already, so either quit Modelsim first or 'lp' to another library first, before running modelsim_config. Typically it is not necessary to do 'mk clean all', nor is it necessary to delete the entire $HDL_BUILD_DIR library subdirectories.
 
 ### 3.3 Simulating the HDL
 
diff --git a/doc/radiohdl_user_guide.md b/doc/radiohdl_user_guide.md
index ff7525c..a216267 100644
--- a/doc/radiohdl_user_guide.md
+++ b/doc/radiohdl_user_guide.md
@@ -68,7 +68,7 @@ The parameters for the HDL source libraries, the vendor IP blocks, the build too
 
 After setting up the configuration files for the tools and the source files, RadioHDL can create for the selected buildset all libraries for simulation, create all IP libraries, find out dependencies, generate project files and do a lot more of these labour-intensive tasks automatically.
 
-![Figure 1](./radiohdl_work_flow.jpg "radiohdl_work_flow.jpg")  
+![Figure 1](./HDL_WORK_flow.jpg "HDL_WORK_flow.jpg")  
 Figure 1: RadioHDL flow from source to target
 
 The main benefit of RadioHDL is that it speeds up HDL development by providing a uniform and automated way of using tools and building code. The disadvantage of using RadioHDL is that it requires an initial effort to support a vendor tool and to maintain this support with changes in vendor tool versions. However in practice it has appeared worth the effort to use and maintain RadioHDL.
@@ -109,7 +109,7 @@ Create a directory at some location $QS_DIR to store the quick start (QS) exampl
   $QS_DIR/cores/dp/dp_pkg
   $QS_DIR/cores/dp/dp_repack_data
 ```
-Source init_qs.sh from within $QS_DIR to set the RadioHDL environment variables RADIOHDL_WORK and RADIOHDL_BUILD_DIR for the quick start (qs) project.
+Source init_qs.sh from within $QS_DIR to set the RadioHDL environment variables HDL_WORK and HDL_BUILD_DIR for the quick start (qs) project.
 ```
   > . ./init_qs.sh
 ```
@@ -130,7 +130,7 @@ Use RadioHDL to build Modelsim simulation project files (*.mpf) for the quick st
 ```
 The modelsim_config script puts the created files and copied files in the build directory, at:
 ```
-  $RADIOHDL_BUILD_DIR/qs/modelsim
+  $HDL_BUILD_DIR/qs/modelsim
 ```
 
 ### 2.4 Simulate the HDL test bench in Modelsim
@@ -179,9 +179,9 @@ The utility **modify_configfiles** implements a tiny menu system that enables yo
 The following environment variables are important for RadioHDL:
 
 * RADIOHDL_GEAR : Points to the main directory where your checked out the RadioHDL package. This is the location where this init_radiohdl.sh file is located. Do not change this variable.
-* RADIOHDL_BUILD_DIR : Points to the directory where RadioHDL will store all its result files. If this variable is not already set when init_radiohdl.sh is run, then it will be set to point to $RADIOHDL_WORK/build.
+* HDL_BUILD_DIR : Points to the directory where RadioHDL will store all its result files. If this variable is not already set when init_radiohdl.sh is run, then it will be set to point to $HDL_WORK/build.
 * RADIOHDL_CONFIG : Points to the directory where RadioHDL expects the hdl_buildset and hdl_tool configuration files. If this variable is not already set when init_radiohdl.sh is run, then it will be set to point to $RADIOHDL_GEAR/config.
-* RADIOHDL_WORK : Points to the root directory of the your project that will use RadioHDL.
+* HDL_WORK : Points to the root directory of the your project that will use RadioHDL.
 
 
 ### 3.2 Configuration files kinds
@@ -306,7 +306,7 @@ This is equivalent with:
 ```
 You can use environment variables in values:
 ```
-    lib_root_dirs = ${RADIOHDL_WORK}
+    lib_root_dirs = ${HDL_WORK}
 ```
 Keys are always in lowercase even when the name of the key will be used as environment variable. RadioHDL takes care that the key names are converted to uppercase in these cases.
 
diff --git a/init_radiohdl.sh b/init_radiohdl.sh
index cfc6def..cc6654f 100755
--- a/init_radiohdl.sh
+++ b/init_radiohdl.sh
@@ -34,12 +34,12 @@ if [[ "$_" == "${0}" ]]; then
     return
 fi
 
-# check for RADIOHDL_WORK variable , if it not exists:
+# check for HDL_WORK variable , if it not exists:
 # 1) run ". ./init_hdl.sh" in the hdl source dir instead.
 # 2) or set variable manualy
 
-if [[ -z "${RADIOHDL_WORK}" ]]; then
-    echo "environ variable 'RADIOHDL_WORK' not available"
+if [[ -z "${HDL_WORK}" ]]; then
+    echo "environ variable 'HDL_WORK' not available"
     echo "source 'init_hdl.sh' script in hdl directory instead of this one"
     echo ". ./init_hdl.sh"
     return
@@ -56,14 +56,16 @@ do
     fi
 done
 
-echo "RadioHDL environment will be setup for" $RADIOHDL_WORK
+echo "RadioHDL environment will be setup for" $HDL_WORK
 
 # Figure out where this script is located and set environment variables accordingly
 export RADIOHDL_GEAR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-#export RADIOHDL_GEAR=${RADIOHDL_GEAR}
 # setup paths to build and config dir if not already defined by the user.
-#export RADIOHDL_BUILD_DIR=${RADIOHDL_BUILD_DIR:-${RADIOHDL_WORK}/build}
 export RADIOHDL_CONFIG="${RADIOHDL_CONFIG:-${RADIOHDL_GEAR}/config}"
+export RADIOHDL_BUILD_RESULT="${HOME}/hdl_build_result"
+if [ ! -d "${RADIOHDL_BUILD_RESULT}" ]; then
+    mkdir "${RADIOHDL_BUILD_RESULT}"
+fi
 
 . ${RADIOHDL_GEAR}/generic.sh
 
diff --git a/modelsim/commands.do b/modelsim/commands.do
index 5fee58a..a266132 100644
--- a/modelsim/commands.do
+++ b/modelsim/commands.do
@@ -56,7 +56,7 @@ proc hdl_env {} {
 
 proc hdl_build {} {
     global env
-    return $env(RADIOHDL_BUILD_DIR)
+    return $env(HDL_BUILD_DIR)
 }
 
 proc hdl_buildset {} {
diff --git a/quartus/build_all_images b/quartus/build_all_images
index 4dbd2ba..4d415bd 100755
--- a/quartus/build_all_images
+++ b/quartus/build_all_images
@@ -2,23 +2,23 @@
 # set -eu
 # -------------------------------------------------------------------------- #
 #
-# Copyright (C) 2022                                                        
+# Copyright (C) 2022
 # ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
-# JIVE (Joint Institute for VLBI in Europe) <http://www.jive.nl/>           
-# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands                             
-#                                                                           
-# This program is free software: you can redistribute it and/or modify      
-# it under the terms of the GNU General Public License as published by      
-# the Free Software Foundation, either version 3 of the License, or         
-# (at your option) any later version.                                       
-#                                                                           
-# This program is distributed in the hope that it will be useful,           
-# but WITHOUT ANY WARRANTY; without even the implied warranty of            
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             
-# GNU General Public License for more details.                              
-#                                                                           
-# You should have received a copy of the GNU General Public License         
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.     
+# JIVE (Joint Institute for VLBI in Europe) <http://www.jive.nl/>
+# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 # -------------------------------------------------------------------------- #
 #
@@ -74,7 +74,7 @@ fi
 if [ $# -lt 1 ]; then
     exit_with_error "Wrong number of arguments specified."
 fi
-filename=$1 
+filename=$1
 
 # Build image for each line in $filename
 # skip lines starting with #
@@ -97,18 +97,6 @@ grep -v '^#' < "${filename}" | {
             else
                 hdl_exec "$0" build_image "${BUILDSET}" "${PROJECT}" --rev="${REVISION}"
             fi
-            # Copy resulting bitstream to $out directory
-            if [ -n "${out}" ]; then
-                if [ ! -d "${out}" ]; then
-                    hdl_exec "$0" mkdir "${out}"
-                fi
-                # get rbf/sof filename git hash will be expanded
-                rbf_file=("${RADIOHDL_BUILD_DIR}"/"${BUILDSET}"/quartus/"${REVISION}"/"${REVISION}"-*.rbf)
-                sof_file=("${RADIOHDL_BUILD_DIR}"/"${BUILDSET}"/quartus/"${REVISION}"/"${REVISION}"-*.sof)
-                # copy files if exist
-                [[ -f "${rbf_file}" ]] && hdl_exec "$0" cp "${rbf_file}" "${out}"
-                [[ -f "${sof_file}" ]] && hdl_exec "$0" cp "${sof_file}" "${out}"
-            fi
             STOP_TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S")
             echo "== STOP BUILD == at ${STOP_TIMESTAMP}"
         fi
diff --git a/quartus/build_image b/quartus/build_image
index b2dec08..14bb9e0 100755
--- a/quartus/build_image
+++ b/quartus/build_image
@@ -2,29 +2,29 @@
 set -eu
 # -------------------------------------------------------------------------- #
 #
-# Copyright (C) 2022                                                        
+# Copyright (C) 2022
 # ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
-# JIVE (Joint Institute for VLBI in Europe) <http://www.jive.nl/>           
-# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands                             
-#                                                                           
-# This program is free software: you can redistribute it and/or modify      
-# it under the terms of the GNU General Public License as published by      
-# the Free Software Foundation, either version 3 of the License, or         
-# (at your option) any later version.                                       
-#                                                                           
-# This program is distributed in the hope that it will be useful,           
-# but WITHOUT ANY WARRANTY; without even the implied warranty of            
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             
-# GNU General Public License for more details.                              
-#                                                                           
-# You should have received a copy of the GNU General Public License         
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.     
+# JIVE (Joint Institute for VLBI in Europe) <http://www.jive.nl/>
+# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 # -------------------------------------------------------------------------- #
 #
 # Author: Reinier vd Walle
 # Purpose: Run all commands in order to compile a Quartus design.
-# Description: Executes quartus_config, run_qsys_pro, gen_rom_mmap.py, run_reg, 
+# Description: Executes quartus_config, run_qsys_pro, gen_rom_mmap.py, run_reg,
 # run_qcomp and run_rbf to do a full compilation of a quartus design. The bitstream
 # files (.sof and.rbf) will be in the corresponding build directory of the design.
 # Run this tool with at least the commandline arguments:
@@ -89,15 +89,15 @@ project=$2
 hdl_exec "$0" quartus_config "${buildset}"
 
 
-PRJS="${RADIOHDL_BUILD_DIR}"
+PRJS="${HDL_BUILD_DIR}"
 PRJ=
 for prj in ${PRJS}
     do
         echo "check if project '${project}' in dir '${prj}'"
         if [ -d "${prj}/${buildset}/quartus/${project}" ]; then
             PRJ=${prj}
-        fi  
-    done  
+        fi
+    done
 if [ -z "${project}" -o -z "${PRJ}" ]; then
     hdl_error "$0" "Please enter a valid project name"
 fi
@@ -131,7 +131,5 @@ hdl_exec "$0" run_reg "${buildset}" "${project_rev}"
 hdl_exec "$0" run_qcomp "${buildset}" "${project_rev}" --clk=CLK --seed="${SEED}"
 
 # run_rbf
-hdl_exec "$0" run_rbf "${buildset}" "${project_rev}"
-
-
-
+# for user image now done in run_qcomp
+# hdl_exec "$0" run_rbf "${buildset}" "${project_rev}"
diff --git a/quartus/compile_altera_simlibs b/quartus/compile_altera_simlibs
index f66cd3c..636f741 100755
--- a/quartus/compile_altera_simlibs
+++ b/quartus/compile_altera_simlibs
@@ -54,9 +54,9 @@ buildset=$1
 # Select output directory for the library compilation results
 buildset_config_file="${RADIOHDL_CONFIG}/hdl_buildset_${buildset}.cfg"
 . ${RADIOHDL_GEAR}/set_config_variable $buildset_config_file synth_tool_name,synth_tool_version
-OUTPUT_DIR=${RADIOHDL_BUILD_DIR}/${SYNTH_TOOL_NAME}/${SYNTH_TOOL_VERSION}
+OUTPUT_DIR=${HDL_BUILD_DIR}/${SYNTH_TOOL_NAME}/${SYNTH_TOOL_VERSION}
 mkdir -p ${OUTPUT_DIR}
-mkdir -p ${RADIOHDL_BUILD_DIR}/${buildset}
+mkdir -p ${HDL_BUILD_DIR}/${buildset}
 
 # Select FPGA device family for the library compilation
 . ${RADIOHDL_GEAR}/set_config_variable $buildset_config_file family_names
@@ -107,7 +107,7 @@ do
     $MODELSIM_DIR/$MODELSIM_PLATFORM/vsim -c -do ${FAMILY}_vhdl.do
 
     # 5) Leave files for modelsim_config
-    libraryfile=${RADIOHDL_BUILD_DIR}/${buildset}/hdl_libraries_ip_${FAMILY}.txt
+    libraryfile=${HDL_BUILD_DIR}/${buildset}/hdl_libraries_ip_${FAMILY}.txt
     rm -f ${libraryfile}
     grep vmap ${OUTPUT_DIR}/${FAMILY}_*.do | sort | \
          sed "s?${OUTPUT_DIR}?\$MODEL_TECH_ALTERA_LIB?g" | while read vmap label location
diff --git a/quartus/run_app b/quartus/run_app
index b161746..3d1a135 100755
--- a/quartus/run_app
+++ b/quartus/run_app
@@ -120,7 +120,7 @@ if [ -z "${NIOSDIR}" ]; then
 fi
 
 # search for existing project directory
-PRJS="${RADIOHDL_BUILD_DIR}"
+PRJS="${HDL_BUILD_DIR}"
 PRJ=
 for prj in ${PRJS}
     do
@@ -142,9 +142,9 @@ fi
 quartusdir="${PRJ}/${buildset}/quartus/${project}"
 builddir="${quartusdir}/software"
 bspdstdir="${builddir}/bsp"
-unbsrcdir="${RADIOHDL_WORK}/libraries/unb_osy/modules"
+unbsrcdir="${HDL_WORK}/libraries/unb_osy/modules"
 unbdstdir="${builddir}/unb_lib"
-appsrcdir="${RADIOHDL_WORK}/libraries/unb_osy"
+appsrcdir="${HDL_WORK}/libraries/unb_osy"
 appdstdir="${builddir}/${app}"
 
 # Is the application available?
diff --git a/quartus/run_app_clean b/quartus/run_app_clean
index bf5b85a..f5a69c7 100755
--- a/quartus/run_app_clean
+++ b/quartus/run_app_clean
@@ -40,7 +40,7 @@ project=$2
 app=${3:+$3}
 . ${RADIOHDL_GEAR}/quartus/set_quartus ${buildset}
 
-PRJS="${RADIOHDL_BUILD_DIR}"
+PRJS="${HDL_BUILD_DIR}"
 PRJ=
 for prj in ${PRJS}
     do
diff --git a/quartus/run_bsp b/quartus/run_bsp
index 87a04dc..83ef59b 100755
--- a/quartus/run_bsp
+++ b/quartus/run_bsp
@@ -1,23 +1,23 @@
 #!/bin/bash -eu
 # -------------------------------------------------------------------------- #
 #
-# Copyright (C) 2010                                                        
+# Copyright (C) 2010
 # ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
-# JIVE (Joint Institute for VLBI in Europe) <http://www.jive.nl/>           
-# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands                             
-#                                                                           
-# This program is free software: you can redistribute it and/or modify      
-# it under the terms of the GNU General Public License as published by      
-# the Free Software Foundation, either version 3 of the License, or         
-# (at your option) any later version.                                       
-#                                                                           
-# This program is distributed in the hope that it will be useful,           
-# but WITHOUT ANY WARRANTY; without even the implied warranty of            
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             
-# GNU General Public License for more details.                              
-#                                                                           
-# You should have received a copy of the GNU General Public License         
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.     
+# JIVE (Joint Institute for VLBI in Europe) <http://www.jive.nl/>
+# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 # -------------------------------------------------------------------------- #
 
@@ -68,7 +68,7 @@ do
 	--bloat)
 	    hal_lightweight_driver=false
 	    hal_enable_small_libc=0
-	    ;;	
+	    ;;
         -*|--*)
             exit_with_error "Unknown option: "$1
             ;;
@@ -93,14 +93,14 @@ project=$2
 
 
 # check projectfile
-PRJS="${RADIOHDL_BUILD_DIR}"
+PRJS="${HDL_BUILD_DIR}"
 PRJ=
 for prj in ${PRJS}
     do
         if [ -d "${prj}/${buildset}/quartus/${project}" ]; then
             PRJ=${prj}
-        fi  
-    done  
+        fi
+    done
 if [ -z "${project}" -o -z "${PRJ}" ]; then
     hdl_error $0 "Please enter a valid project name"
 fi
@@ -113,7 +113,7 @@ bspdir="${builddir}/bsp"
 # assert the quartusdir exists
 hdl_exec $0 msg=no test -d ${quartusdir}
 
-# If we have a makefile see if no-one changed the sopcinfo 
+# If we have a makefile see if no-one changed the sopcinfo
 # (since if they did we must re-generate files).
 # Otherwise we must generate the BSP package
 
@@ -129,7 +129,7 @@ if [ -d "${bspdir}" -a -f "${bspdir}/Makefile" ]; then
     #       does not work on Windows. Winders cannot discriminate
     #       between "time-of-last-access" and "time-of-last-modification"
     #       whereas under Linux this works like a charm.
-    #       The result was that under Windows "make -n" would 
+    #       The result was that under Windows "make -n" would
     #       always indicate that the target needed to be rebuilt.
     #       Maybe there is another reason - fact is that "make"
     #       didn't work on windows. This does.
@@ -137,7 +137,7 @@ if [ -d "${bspdir}" -a -f "${bspdir}/Makefile" ]; then
     if [ -z "${sopcfile}" ]; then
         hdl_error $0 "No sopc(info) file?!!"
     fi
-    if [ ${sopcfile} -nt ${bspdir}/settings.bsp ]; then        
+    if [ ${sopcfile} -nt ${bspdir}/settings.bsp ]; then
         hdl_info $0 "Someone has been tinkering with .sopcinfo"
         hdl_info $0 "Regenerating the BSP files"
         hdl_exec $0 msg=no nios2-bsp-generate-files \
@@ -147,7 +147,7 @@ if [ -d "${bspdir}" -a -f "${bspdir}/Makefile" ]; then
 else
     # we must generate the BSP files
     hdl_info $0 "Generating BSP files for ${project}"
-    hdl_exec $0 msg=no nios2-bsp hal ${bspdir} ${quartusdir} 
+    hdl_exec $0 msg=no nios2-bsp hal ${bspdir} ${quartusdir}
 fi
 
 # check if we've already updated the BSP settings to our likings
diff --git a/quartus/run_mif b/quartus/run_mif
index 1ed1e1a..abcc545 100755
--- a/quartus/run_mif
+++ b/quartus/run_mif
@@ -81,7 +81,7 @@ project=$2
 . ${RADIOHDL_GEAR}/quartus/set_quartus ${buildset}
 
 # check projectfile
-PRJS="${RADIOHDL_BUILD_DIR}"
+PRJS="${HDL_BUILD_DIR}"
 PRJ=
 for prj in ${PRJS}
     do
diff --git a/quartus/run_qcomp b/quartus/run_qcomp
index 52a7962..295be74 100755
--- a/quartus/run_qcomp
+++ b/quartus/run_qcomp
@@ -1,23 +1,23 @@
 #!/bin/bash -eu
 # -------------------------------------------------------------------------- #
 #
-# Copyright (C) 2012                                                        
+# Copyright (C) 2012
 # ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
-# JIVE (Joint Institute for VLBI in Europe) <http://www.jive.nl/>           
-# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands                             
-#                                                                           
-# This program is free software: you can redistribute it and/or modify      
-# it under the terms of the GNU General Public License as published by      
-# the Free Software Foundation, either version 3 of the License, or         
-# (at your option) any later version.                                       
-#                                                                           
-# This program is distributed in the hope that it will be useful,           
-# but WITHOUT ANY WARRANTY; without even the implied warranty of            
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             
-# GNU General Public License for more details.                              
-#                                                                           
-# You should have received a copy of the GNU General Public License         
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.     
+# JIVE (Joint Institute for VLBI in Europe) <http://www.jive.nl/>
+# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 # -------------------------------------------------------------------------- #
 #
@@ -90,15 +90,15 @@ project=$2
 # read in the configuration based on the user arguments
 . ${RADIOHDL_GEAR}/quartus/set_quartus ${buildset}
 
-PRJS="${RADIOHDL_BUILD_DIR}"
+PRJS="${HDL_BUILD_DIR}"
 PRJ=
 for prj in ${PRJS}
     do
         hdl_info $0 "check if project '${project}' in dir '${prj}'"
         if [ -d "${prj}/${buildset}/quartus/${project}" ]; then
             PRJ=${prj}
-        fi  
-    done  
+        fi
+    done
 if [ -z "${project}" -o -z "${PRJ}" ]; then
     hdl_error $0 "Please enter a valid project name"
 fi
@@ -135,43 +135,49 @@ do
     hdl_info $0 "Adding fitter seed value of ${i} to ${project_rev}.qsf"
     echo -e "\nset_global_assignment -name SEED ${i}\n" >> ${quartusdir}/${project_rev}.qsf
     echo -e "\nset_global_assignment -name NUM_PARALLEL_PROCESSORS 6\n" >> ${quartusdir}/${project_rev}.qsf
-    
+
     hdl_info $0 "Performing full compile of project ${project_rev}"
     quartus_sh $mem_width --flow compile ${project_rev} | grep -v Info
     hdl_info $0 "compile done"
-    
+
+
     if [ $? -eq 0 ]
     then
       # Successful compile.
-      hdl_info $0 "Full compile successful"  
-      # . Add SVN rev to SOF file name
+      hdl_info $0 "Full compile successful"
+      
       if [ -n "${HDL_GIT_REVISION_SHORT}" ]; then
-        git_revision=`echo ${HDL_GIT_REVISION_SHORT}`  # ${HDL_GIT_REVISION_SHORT} looks like: "7d81650af"
-        hdl_info $0 "copy file ${quartusdir}/${project_rev}.sof to ${quartusdir}/${project_rev}-r${git_revision}.sof"
-        cp -p ${quartusdir}/${project_rev}.sof ${quartusdir}/${project_rev}-r${git_revision}.sof
+        git_revision=$(echo ${HDL_GIT_REVISION_SHORT})  # ${HDL_GIT_REVISION_SHORT} looks like: "7d81650af"
       fi
+            
+      # . Add git rev to SOF file name
+      hdl_info $0 "copy file ${quartusdir}/${project_rev}.sof to ${quartusdir}/${project_rev}-r${git_revision}.sof"
+      cp -p ${quartusdir}/${project_rev}.sof ${quartusdir}/${project_rev}-r${git_revision}.sof
+      
+      hdl_exec $0 quartus_cpf -c --option=${HOME}/.run_rbf_temp_options_file ${quartusdir}/${project_rev}.sof ${quartusdir}/${project_rev}.rbf
+      # . Add git rev to SBF file name
+      echo "copy file ${quartusdir}/${project_rev}.rbf to ${quartusdir}/${project_rev}-r${git_revision}.rbf"
+      cp ${quartusdir}/${project_rev}.rbf ${quartusdir}/${project_rev}-r${git_revision}.rbf
+      
       # . Check if user passed a clk
       if [ -z "${CLK}" ]
       then
           :
       else
-          fmax_str=`quartus_fmax.sh ${quartusdir}/${project_rev}.sta.rpt $CLK`
-          fmax=`echo $fmax_str | cut -f1 -d"." | sed 's/[^0-9]//g'` 
-          # . Report fMax 
+          fmax_str=$(quartus_fmax.sh ${quartusdir}/${project_rev}.sta.rpt $CLK)
+          fmax=$(echo $fmax_str | cut -f1 -d"." | sed 's/[^0-9]//g')
+          # . Report fMax
           hdl_info $0 "fMax of ${CLK}: ${fmax} MHz"
+          echo "fMax of ${CLK}: ${fmax} MHz" > ${quartusdir}/fmax.txt
+          time_stamp=$(date -u +"%Y-%m-%dT%H:%M")
           # . Copy quartus output dir preserving the meta file information, add fMax portfix
-          
-          resultdir="${RADIOHDL_BUILD_DIR}/quartus_results/"
-          if [ ! -d "${resultdir}" ]; then
-             mkdir "${resultdir}"
-          fi
-          cp -rp ${quartusdir} ${resultdir}/${project}_${fmax}MHz
+          cp -rp ${quartusdir} ${RADIOHDL_BUILD_RESULT}/${time_stamp}_${project_rev}_${fmax}MHz
       fi
       # Print critical warnings
       # If grep find no match it wil return 1 as exitcode and the script is killed.
       # use following format to prefend a grep with no match to kill the script, the exitcode is now always forched to 0, to avoid script abort due to running bash -e:
       #   echo "anything" | { grep e || true; }
-      #     
+      #
       cd ${quartusdir}
       hdl_warning $0 "Listing Critical Warnings"
       # Print pin location warnings, if any
@@ -183,20 +189,20 @@ do
       hdl_info $0 "Full compile successful."
     else
       # Compile failed
-      hdl_info $0 "Full compile failed"  
+      hdl_info $0 "Full compile failed"
       # . Print the errors
       cd ${quartusdir}
       hdl_warning $0 "Listing Critical Warnings"
       # Print pin location warnings, if any
       echo "." | { cat *.fit.rpt | grep -H --color=auto 'No exact pin location' | grep -H --color=auto 'Critical Warning' || true; }
       # . print corresponding info
-      echo "." | { grep -H --color=auto 'not assigned to an exact location' *.fit.rpt || true; }     
+      echo "." | { grep -H --color=auto 'not assigned to an exact location' *.fit.rpt || true; }
       # Print remaining critical warnings, EXCEPT the always presetn TSE warning
       echo "." | { cat *.rpt | grep -v 'mixed_port_feed_through_mode\" parameter of RAM atom' | grep -H --color=auto 'Critical Warning' || true; }
       hdl_error_noexit $0 "Error(s) occured"
       # Print error messages
       echo "." | { cat *.rpt | grep -v 'Error detection' | grep -H --color=auto 'Error' || true; }
-      hdl_error $0 "Full compile failed"  
+      hdl_error $0 "Full compile failed"
     fi
 
 done
diff --git a/quartus/run_qsys b/quartus/run_qsys
index eb9b24a..c7883a7 100755
--- a/quartus/run_qsys
+++ b/quartus/run_qsys
@@ -41,7 +41,7 @@ qsysfile=${3:+$3}
 . ${RADIOHDL_GEAR}/quartus/set_quartus ${buildset}
 
 # search for existing project directory
-PRJS="${RADIOHDL_BUILD_DIR}"
+PRJS="${HDL_BUILD_DIR}"
 PRJ=
 for prj in ${PRJS}
     do
diff --git a/quartus/run_qsys_pro b/quartus/run_qsys_pro
index 0276b55..ba80d55 100755
--- a/quartus/run_qsys_pro
+++ b/quartus/run_qsys_pro
@@ -41,7 +41,7 @@ qsysfile=${3:+$3}
 . ${RADIOHDL_GEAR}/quartus/set_quartus ${buildset}
 
 # search for existing project directory
-PRJS="${RADIOHDL_BUILD_DIR}"
+PRJS="${HDL_BUILD_DIR}"
 PRJ=
 for prj in ${PRJS}
     do
diff --git a/quartus/run_rbf b/quartus/run_rbf
index aec2808..2b25079 100755
--- a/quartus/run_rbf
+++ b/quartus/run_rbf
@@ -78,7 +78,7 @@ project=$2
 # read in the configuration based on the user arguments
 . ${RADIOHDL_GEAR}/quartus/set_quartus ${buildset}
 
-PRJS="${RADIOHDL_BUILD_DIR}"
+PRJS="${HDL_BUILD_DIR}"
 PRJ=
 for prj in ${PRJS}
     do
@@ -118,7 +118,7 @@ if [ -z "${arg_unb2_factory}" ]; then
   hdl_exec $0 quartus_cpf -c --option=${HOME}/.run_rbf_temp_options_file ${quartusdir}/${project_rev}.sof ${quartusdir}/${project_rev}.rbf
 else
   hdl_info $0 "-> This is a factory image for Uniboard2: Convert .SOF -> .POF -> .HEXOUT -> .RBF"
-  # for more info see: ${RADIOHDL_WORK}/libraries/io/epcs/doc/README.txt
+  # for more info see: ${HDL_WORK}/libraries/io/epcs/doc/README.txt
   hdl_exec $0 quartus_cpf -d EPCQL1024 -m ASx4 --option=${HOME}/.run_rbf_temp_options_file -c ${quartusdir}/${project_rev}.sof ${quartusdir}/${project_rev}.pof
   hdl_exec $0 quartus_cpf -c ${quartusdir}/${project_rev}.pof ${quartusdir}/${project_rev}.hexout
   hdl_exec $0 nios2-elf-objcopy -I ihex -O binary ${quartusdir}/${project_rev}.hexout ${quartusdir}/${project_rev}.rbf
@@ -135,7 +135,7 @@ fi
 
 
 if [ -n "${HDL_GIT_REVISION_SHORT}" ]; then
-  git_revision=`echo ${HDL_GIT_REVISION_SHORT}`  # ${HDL_GIT_REVISION_SHORT} looks like: "7d81650af"
+  git_revision=$(echo ${HDL_GIT_REVISION_SHORT})  # ${HDL_GIT_REVISION_SHORT} looks like: "7d81650af"
   echo "copy file ${quartusdir}/${project_rev}.rbf to ${quartusdir}/${project_rev}-r${git_revision}.rbf"
   cp ${quartusdir}/${project_rev}.rbf ${quartusdir}/${project_rev}-r${git_revision}.rbf
 fi
diff --git a/quartus/run_reg b/quartus/run_reg
index 59ae126..6a8c065 100755
--- a/quartus/run_reg
+++ b/quartus/run_reg
@@ -74,7 +74,7 @@ project=$2
 . ${RADIOHDL_GEAR}/quartus/set_quartus ${buildset}
 
 # check projectfile
-PRJS="${RADIOHDL_BUILD_DIR}"
+PRJS="${HDL_BUILD_DIR}"
 PRJ=
 for prj in ${PRJS}
     do
diff --git a/quartus/run_regtest_synth b/quartus/run_regtest_synth
index 03a6ac8..a4f3e55 100755
--- a/quartus/run_regtest_synth
+++ b/quartus/run_regtest_synth
@@ -58,7 +58,7 @@ hdl_exec $0 . ${RADIOHDL_GEAR}/setup_radiohdl.sh
 
 # Generate all IP 
 hdl_info $0 "Generating all IP"
-hdl_exec $0 cd ${RADIOHDL_WORK}/libraries/technology/ip_stratixiv
+hdl_exec $0 cd ${HDL_WORK}/libraries/technology/ip_stratixiv
 #hdl_exec $0 sh generate-all-ip.sh
 
 # Run quartus_config.py
@@ -85,7 +85,7 @@ hdl_exec $0 run_rbf   unb1 apertif_unb1_bn_filterbank
 # At this point, errors may or may not have occured.  Perform checks here.
 # Check if all RBF files have been generated
 NOF_RBF_REQ=1
-FOUND_RBF=$(find ${RADIOHDL_BUILD_DIR} -name *.rbf | grep "\-r")
+FOUND_RBF=$(find ${HDL_BUILD_DIR} -name *.rbf | grep "\-r")
 NOF_RBF=$(echo ${FOUND_RBF} | grep -c "rbf")
 RESULT=FAILED
 if (( NOF_RBF == NOF_RBF_REQ )); then
diff --git a/quartus/run_sof b/quartus/run_sof
index d5b4548..d185d00 100755
--- a/quartus/run_sof
+++ b/quartus/run_sof
@@ -159,7 +159,7 @@ do
 done
 
 # check projectfile
-PRJS="${RADIOHDL_BUILD_DIR}"
+PRJS="${HDL_BUILD_DIR}"
 PRJ=
 for prj in ${PRJS}
     do
diff --git a/quartus/run_sopc b/quartus/run_sopc
index 7e1b512..eab2700 100755
--- a/quartus/run_sopc
+++ b/quartus/run_sopc
@@ -41,7 +41,7 @@ sopcfile=${3:+$3}
 . ${RADIOHDL_GEAR}/quartus/set_quartus ${buildset}
 
 # search for existing project directory
-PRJS="${RADIOHDL_BUILD_DIR}"
+PRJS="${HDL_BUILD_DIR}"
 PRJ=
 for prj in ${PRJS}
     do
diff --git a/quartus/set_quartus b/quartus/set_quartus
index ceb2e3b..ee4ede2 100755
--- a/quartus/set_quartus
+++ b/quartus/set_quartus
@@ -75,15 +75,15 @@ done
 # TODO: move to hdl_tool_quartus.cfg : user_environment_variables ???
 # HDL_GIT_REVISION (first 32 digits of full 40-digits hash) is used in firmware
 # HDL_GIT_REVISION_SHORT (first 9 digits of full hash) is used in file-naming
-if [[ -n "${RADIOHDL_WORK}" ]]; then
-    git_rev=`cd $RADIOHDL_WORK; git rev-parse HEAD; cd -`
+if [[ -n "${HDL_WORK}" ]]; then
+    git_rev=`cd $HDL_WORK; git rev-parse HEAD; cd -`
     export HDL_GIT_REVISION=${git_rev}
     export HDL_GIT_REVISION_SHORT=${git_rev:0:9}
     #export HDL_GIT_REVISION=1010101
     #export HDL_GIT_REVISION_SHORT=101
     echo "set GIT revision to '${HDL_GIT_REVISION}' and as short '${HDL_GIT_REVISION_SHORT}'"
 else
-    echo "GIT revision not set (RADIOHDL_WORK not available), run first '. ./init_hdl.sh' in hdl dir"
+    echo "GIT revision not set (HDL_WORK not available), run first '. ./init_hdl.sh' in hdl dir"
 fi
 export UNB_COMPILE_STAMPS=1
 
diff --git a/regressiontest/modelsim_regression_test_vhdl.py b/regressiontest/modelsim_regression_test_vhdl.py
index 9c06125..b2d8661 100755
--- a/regressiontest/modelsim_regression_test_vhdl.py
+++ b/regressiontest/modelsim_regression_test_vhdl.py
@@ -170,7 +170,7 @@ def main():
     run_start_time = time.time()
 
     # put all tb tests in the task-queue
-    lock = os.path.join(os.getenv("RADIOHDL_BUILD_DIR"), buildset, "modelsim/easics/work", "_lock")
+    lock = os.path.join(os.getenv("HDL_BUILD_DIR"), buildset, "modelsim/easics/work", "_lock")
     logger.info("lockfile='%s'", lock)
     open_tasks = []
 
@@ -410,7 +410,7 @@ class TestBenchWorker(multiprocessing.Process):
         self.sim_errors = []
         self.n_tb = 0
         self.run_time = 0
-        sim_dir = os.path.join(os.getenv("RADIOHDL_BUILD_DIR"), f"sim_worker{self._id}")
+        sim_dir = os.path.join(os.getenv("HDL_BUILD_DIR"), f"sim_worker{self._id}")
         if not os.path.exists(sim_dir):
             os.mkdir(sim_dir)
 
@@ -885,7 +885,7 @@ if __name__ == "__main__":
 
     args.buildset_file = "hdl_buildset_" + args.buildset + ".cfg"
 
-    out_dir = os.path.join(os.getenv("RADIOHDL_BUILD_DIR"), args.buildset, "modelsim")
+    out_dir = os.path.join(os.getenv("HDL_BUILD_DIR"), args.buildset, "modelsim")
     file_name = f"regression_test_{args.buildset}"
 
     my_logger = MyLogger(log_path=out_dir, file_name=file_name, name_size=15)
diff --git a/regressiontest/modelsim_regression_test_vhdl_cron.sh b/regressiontest/modelsim_regression_test_vhdl_cron.sh
index e45cc4b..784eb96 100755
--- a/regressiontest/modelsim_regression_test_vhdl_cron.sh
+++ b/regressiontest/modelsim_regression_test_vhdl_cron.sh
@@ -62,7 +62,7 @@ hdl_exec "$0" git pull
 
 # get hash from last test if file excists
 git_prev_hash="none"
-git_hash_filename="${RADIOHDL_WORK}"/previous_git_hash.txt
+git_hash_filename="${HDL_WORK}"/previous_git_hash.txt
 [[ -f "${git_hash_filename}" ]] && git_prev_hash=$(cat "${git_hash_filename}")
 git_active_hash=$(git rev-parse HEAD) 
 
@@ -92,7 +92,7 @@ grep -v '^#' < "${buildset_filename}" | {
 
             echo "cleanup last build"
             # Cleanup last build if exists
-            hdl_exec "$0" rm -rf "${RADIOHDL_BUILD_DIR:?}"/"${buildset}"
+            hdl_exec "$0" rm -rf "${HDL_BUILD_DIR:?}"/"${buildset}"
 
             # Build all IP 
             echo "call compile_altera_simlibs"
diff --git a/regressiontest/modelsim_regression_test_vhdl_mail.py b/regressiontest/modelsim_regression_test_vhdl_mail.py
index 16a1af7..aa845f5 100755
--- a/regressiontest/modelsim_regression_test_vhdl_mail.py
+++ b/regressiontest/modelsim_regression_test_vhdl_mail.py
@@ -81,7 +81,7 @@ def get_host_ip():
 
 def get_git_hash():
     # Get the GIT revision to put in the email subject
-    os.chdir(os.getenv("RADIOHDL_WORK"))
+    os.chdir(os.getenv("HDL_WORK"))
     p = Popen("git rev-parse HEAD", shell=True, stdout=PIPE, stderr=PIPE)
     stdout, stderr = p.communicate()
     git_revision = stdout.decode("utf-8")
@@ -137,7 +137,7 @@ if __name__ == "__main__":
     )
     args = argparser.parse_args()
 
-    out_dir = os.path.join(os.getenv("RADIOHDL_BUILD_DIR"), args.buildset, "modelsim")
+    out_dir = os.path.join(os.getenv("HDL_BUILD_DIR"), args.buildset, "modelsim")
 
     result_file_name = "regression_test_" + args.buildset + ".log"
     result_file_path = os.path.join(out_dir, result_file_name)
diff --git a/regressiontest/quartus_build_images_cron.sh b/regressiontest/quartus_build_images_cron.sh
index 506a0d6..246f6b6 100755
--- a/regressiontest/quartus_build_images_cron.sh
+++ b/regressiontest/quartus_build_images_cron.sh
@@ -49,6 +49,7 @@ hdl_info "$0" "Build all images in file: ${BUILDFILE}"
 
 LOGFILE="${HOME}"/quartus_build_images_cron.log
 OUT_DIR="${HOME}"/bitstream
+
 # Delete any previous log files
 if [ -f "${LOGFILE}" ]; then
     hdl_exec "$0" rm "${LOGFILE}"
@@ -66,7 +67,7 @@ echo "initialize all systems"
 
 echo "cleanup last build"
 # Cleanup last build if excists
-hdl_exec "$0" rm -rf "${RADIOHDL_BUILD_DIR:?}"/*
+hdl_exec "$0" rm -rf "${HDL_BUILD_DIR:?}"/*
 
 # Build all IP 
 echo "call generate_ip_libs"
diff --git a/regressiontest/quartus_build_images_mail.py b/regressiontest/quartus_build_images_mail.py
index 7c74f24..1b2fc53 100755
--- a/regressiontest/quartus_build_images_mail.py
+++ b/regressiontest/quartus_build_images_mail.py
@@ -79,7 +79,7 @@ def get_host_ip():
 
 def get_git_hash():
     # Get the GIT revision to put in the email subject
-    os.chdir(os.getenv("RADIOHDL_WORK"))
+    os.chdir(os.getenv("HDL_WORK"))
     p = Popen("git rev-parse HEAD", shell=True, stdout=PIPE, stderr=PIPE)
     stdout, stderr = p.communicate()
     git_revision = stdout.decode("utf-8")
-- 
GitLab