From ba44851783e4a8001a3146bd9c8d416b1b5b081e Mon Sep 17 00:00:00 2001
From: Erik Kooistra <kooistra@astron.nl>
Date: Mon, 20 Apr 2015 12:37:15 +0000
Subject: [PATCH] Use <toolset> in build dir path.

---
 tools/modelsim/commands.do  | 7 ++++++-
 tools/quartus/run_all_qsys  | 2 +-
 tools/quartus/run_all_sopc  | 2 +-
 tools/quartus/run_app       | 4 ++--
 tools/quartus/run_app_clean | 4 ++--
 tools/quartus/run_bsp       | 4 ++--
 tools/quartus/run_mif       | 4 ++--
 tools/quartus/run_qcomp     | 4 ++--
 tools/quartus/run_qsys      | 4 ++--
 tools/quartus/run_rbf       | 4 ++--
 tools/quartus/run_reg       | 4 ++--
 tools/quartus/run_sof       | 4 ++--
 tools/quartus/run_sopc      | 4 ++--
 13 files changed, 28 insertions(+), 23 deletions(-)

diff --git a/tools/modelsim/commands.do b/tools/modelsim/commands.do
index a4bcea8e1f..6ca1790862 100644
--- a/tools/modelsim/commands.do
+++ b/tools/modelsim/commands.do
@@ -59,6 +59,11 @@ proc hdl_build {} {
     return $env(HDL_BUILD_DIR)
 }
 
+proc hdl_toolset {} {
+    global env
+    return $env(TOOLSET)
+}
+
 #-------------------------------------------------------------------------------
 # LP = Load project
 #-------------------------------------------------------------------------------
@@ -324,7 +329,7 @@ proc mk_test {arg_lib} {
 #-------------------------------------------------------------------------------
 
 proc read_modelsim_project_files_file {} {
-    set fp [open [hdl_build]/modelsim/modelsim_project_files.txt]
+    set fp [open [hdl_build]/[hdl_toolset]/modelsim/modelsim_project_files.txt]
     set data [read $fp]
     close $fp
     set lines [split $data \n]
diff --git a/tools/quartus/run_all_qsys b/tools/quartus/run_all_qsys
index f4e4d8851b..05056ff9b5 100755
--- a/tools/quartus/run_all_qsys
+++ b/tools/quartus/run_all_qsys
@@ -75,7 +75,7 @@ PRJS="${RADIOHDL}"
 PRJ=
 for prj in ${PRJS}
     do
-        if [ -d "${prj}/build/quartus/${project}" ]; then
+        if [ -d "${prj}/build/${toolset}/quartus/${project}" ]; then
             PRJ=${prj}
         fi  
     done  
diff --git a/tools/quartus/run_all_sopc b/tools/quartus/run_all_sopc
index c1f22de4c7..bc880f4a67 100755
--- a/tools/quartus/run_all_sopc
+++ b/tools/quartus/run_all_sopc
@@ -76,7 +76,7 @@ PRJS="${RADIOHDL}"
 PRJ=
 for prj in ${PRJS}
     do
-        if [ -d "${prj}/build/quartus/${project}" ]; then
+        if [ -d "${prj}/build/${toolset}/quartus/${project}" ]; then
             PRJ=${prj}
         fi  
     done  
diff --git a/tools/quartus/run_app b/tools/quartus/run_app
index 7470467d97..2d87cb8104 100755
--- a/tools/quartus/run_app
+++ b/tools/quartus/run_app
@@ -123,7 +123,7 @@ PRJS="${RADIOHDL}"
 PRJ=
 for prj in ${PRJS}
     do
-        if [ -d "${prj}/build/quartus/${project}" ]; then
+        if [ -d "${prj}/build/${toolset}/quartus/${project}" ]; then
             PRJ=${prj}
         fi  
     done  
@@ -138,7 +138,7 @@ if [ -z "${app}" ]; then
 fi
 
 # Generate the paths we need
-quartusdir="${PRJ}/build/quartus/${project}"
+quartusdir="${PRJ}/build/${toolset}/quartus/${project}"
 builddir="${quartusdir}/software"
 bspdstdir="${builddir}/bsp"
 unbsrcdir="${UNB}/Firmware/software/modules/src"
diff --git a/tools/quartus/run_app_clean b/tools/quartus/run_app_clean
index 781eb7dd38..8f194ec833 100755
--- a/tools/quartus/run_app_clean
+++ b/tools/quartus/run_app_clean
@@ -83,7 +83,7 @@ PRJS="${RADIOHDL}"
 PRJ=
 for prj in ${PRJS}
     do
-        if [ -d "${prj}/build/quartus/${project}" ]; then
+        if [ -d "${prj}/build/${toolset}/quartus/${project}" ]; then
             PRJ=${prj}
         fi  
     done  
@@ -103,7 +103,7 @@ fi
 #            situations (exist + clean) vs (!exist + !clean).
 # For now I (H. Verkouter) lean towards the logical clause since I think
 # a non-fatal failure at this stage should not break other scripts
-appdir="${PRJ}/build/quartus/${project}/software/${app}"
+appdir="${PRJ}/build/${toolset}/quartus/${project}/software/${app}"
 
 if [ -d "${appdir}" ]; then
     unb_exec $0 msg=no rm -Rf ${appdir}
diff --git a/tools/quartus/run_bsp b/tools/quartus/run_bsp
index 848ba55016..55b1ef7d70 100755
--- a/tools/quartus/run_bsp
+++ b/tools/quartus/run_bsp
@@ -81,7 +81,7 @@ PRJS="${RADIOHDL}"
 PRJ=
 for prj in ${PRJS}
     do
-        if [ -d "${prj}/build/quartus/${project}" ]; then
+        if [ -d "${prj}/build/${toolset}/quartus/${project}" ]; then
             PRJ=${prj}
         fi  
     done  
@@ -90,7 +90,7 @@ if [ -z "${project}" -o -z "${PRJ}" ]; then
 fi
 
 # now we can generate paths
-quartusdir="${PRJ}/build/quartus/${project}"
+quartusdir="${PRJ}/build/${toolset}/quartus/${project}"
 builddir="${quartusdir}/software"
 bspdir="${builddir}/bsp"
 
diff --git a/tools/quartus/run_mif b/tools/quartus/run_mif
index bd955e5f0a..244879681e 100755
--- a/tools/quartus/run_mif
+++ b/tools/quartus/run_mif
@@ -83,7 +83,7 @@ PRJS="${RADIOHDL}"
 PRJ=
 for prj in ${PRJS}
     do
-        if [ -d "${prj}/build/quartus/${project}" ]; then
+        if [ -d "${prj}/build/${toolset}/quartus/${project}" ]; then
             PRJ=${prj}
         fi  
     done  
@@ -91,7 +91,7 @@ if [ -z "${project}" -o -z "${PRJ}" ]; then
     unb_error $0 "Please enter a valid project name as parameter"
 fi
 
-quartusdir="${PRJ}/build/quartus/${project}"
+quartusdir="${PRJ}/build/${toolset}/quartus/${project}"
 builddir="${quartusdir}/software"
 bspdstdir="${builddir}/bsp"
 
diff --git a/tools/quartus/run_qcomp b/tools/quartus/run_qcomp
index 2916642d7f..087a0d3fb9 100755
--- a/tools/quartus/run_qcomp
+++ b/tools/quartus/run_qcomp
@@ -86,7 +86,7 @@ PRJS="${RADIOHDL}"
 PRJ=
 for prj in ${PRJS}
     do
-        if [ -d "${prj}/build/quartus/${project}" ]; then
+        if [ -d "${prj}/build/${toolset}/quartus/${project}" ]; then
             PRJ=${prj}
         fi  
     done  
@@ -95,7 +95,7 @@ if [ -z "${project}" -o -z "${PRJ}" ]; then
 fi
 
 # check if the quartus project directory is there
-quartusdir="${PRJ}/build/quartus/${project}"
+quartusdir="${PRJ}/build/${toolset}/quartus/${project}"
 unb_exec $0 msg=no test -d ${quartusdir}
 
 if [ -z "${rev}" ]; then
diff --git a/tools/quartus/run_qsys b/tools/quartus/run_qsys
index f9a8c01c5d..08e57f2211 100755
--- a/tools/quartus/run_qsys
+++ b/tools/quartus/run_qsys
@@ -72,7 +72,7 @@ PRJS="${RADIOHDL}"
 PRJ=
 for prj in ${PRJS}
     do
-        if [ -d "${prj}/build/quartus/${project}" ]; then
+        if [ -d "${prj}/build/${toolset}/quartus/${project}" ]; then
             PRJ=${prj}
         fi  
     done  
@@ -81,7 +81,7 @@ if [ -z "${project}" -o -z "${PRJ}" ]; then
 fi
 
 # Form name of quartusdir and check if it indeed exists
-quartusdir="${PRJ}/build/quartus/${project}"
+quartusdir="${PRJ}/build/${toolset}/quartus/${project}"
 unb_exec $0 msg=no test -d ${quartusdir}
 
 # the QSYS file is optional. If it is omitted choose the first
diff --git a/tools/quartus/run_rbf b/tools/quartus/run_rbf
index 731e7155cb..13c7a1822d 100755
--- a/tools/quartus/run_rbf
+++ b/tools/quartus/run_rbf
@@ -78,7 +78,7 @@ PRJS="${RADIOHDL}"
 PRJ=
 for prj in ${PRJS}
     do
-        if [ -d "${prj}/build/quartus/${project}" ]; then
+        if [ -d "${prj}/build/${toolset}/quartus/${project}" ]; then
             PRJ=${prj}
         fi  
     done  
@@ -86,7 +86,7 @@ if [ -z "${project}" -o -z "${PRJ}" ]; then
     unb_error $0 "Please enter a valid project name as parameter"
 fi
 
-quartusdir="${PRJ}/build/quartus/${project}"
+quartusdir="${PRJ}/build/${toolset}/quartus/${project}"
 
 if [ -z "${rev}" ]; then
   project_rev="${project}"
diff --git a/tools/quartus/run_reg b/tools/quartus/run_reg
index 98a341176e..f96f36f8a4 100755
--- a/tools/quartus/run_reg
+++ b/tools/quartus/run_reg
@@ -78,7 +78,7 @@ PRJS="${RADIOHDL}"
 PRJ=
 for prj in ${PRJS}
     do
-        if [ -d "${prj}/build/quartus/${project}" ]; then
+        if [ -d "${prj}/build/${toolset}/quartus/${project}" ]; then
             PRJ=${prj}
         fi  
     done  
@@ -86,7 +86,7 @@ if [ -z "${project}" -o -z "${PRJ}" ]; then
     unb_error $0 "Please enter a valid project name as parameter"
 fi
 
-quartusdir="${PRJ}/build/quartus/${project}"
+quartusdir="${PRJ}/build/${toolset}/quartus/${project}"
 builddir="${quartusdir}/software"
 bspdstdir="${builddir}/bsp"
 
diff --git a/tools/quartus/run_sof b/tools/quartus/run_sof
index 89d7670aa8..faf276d20b 100755
--- a/tools/quartus/run_sof
+++ b/tools/quartus/run_sof
@@ -147,7 +147,7 @@ PRJS="${RADIOHDL}"
 PRJ=
 for prj in ${PRJS}
     do
-        if [ -d "${prj}/build/quartus/${project}" ]; then
+        if [ -d "${prj}/build/${toolset}/quartus/${project}" ]; then
             PRJ=${prj}
         fi  
     done  
@@ -162,7 +162,7 @@ fi
 # check if the quartusdirectory does exist 
 # (such that it won't fail with a cryptic error but with
 #  a readable one
-quartusdir[1]="${PRJ}/build/quartus/${project}"
+quartusdir[1]="${PRJ}/build/${toolset}/quartus/${project}"
 unb_exec $0 msg=no test -d ${quartusdir[1]}
 
 if [ -z "${rev}" ]; then
diff --git a/tools/quartus/run_sopc b/tools/quartus/run_sopc
index 7ecfe807af..651669bf87 100755
--- a/tools/quartus/run_sopc
+++ b/tools/quartus/run_sopc
@@ -74,7 +74,7 @@ PRJS="${RADIOHDL}"
 PRJ=
 for prj in ${PRJS}
     do
-        if [ -d "${prj}/build/quartus/${project}" ]; then
+        if [ -d "${prj}/build/${toolset}/quartus/${project}" ]; then
             PRJ=${prj}
         fi  
     done  
@@ -83,7 +83,7 @@ if [ -z "${project}" -o -z "${PRJ}" ]; then
 fi
 
 # Form name of quartusdir and check if it indeed exists
-quartusdir="${PRJ}/build/quartus/${project}"
+quartusdir="${PRJ}/build/${toolset}/quartus/${project}"
 unb_exec $0 msg=no test -d ${quartusdir}
 
 # the SOPC file is optional. If it is omitted choose the first
-- 
GitLab