From e5b63d6e283f277a79947bcd4a616e4bf3ebadd9 Mon Sep 17 00:00:00 2001
From: dam1n19 <dam1n19@soton.ac.uk>
Date: Fri, 26 May 2023 10:59:08 +0100
Subject: [PATCH] SOC1-223: Update enviroment variable names

---
 bin/htmlgen/makefile            |  8 ++++----
 bin/htmlgen/project_html_gen.py | 14 +++++++-------
 tools/htmlgen                   |  2 +-
 tools/socpull                   |  4 ++--
 tools/socsim                    |  8 ++++----
 5 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/bin/htmlgen/makefile b/bin/htmlgen/makefile
index b675dd9..56c03b1 100644
--- a/bin/htmlgen/makefile
+++ b/bin/htmlgen/makefile
@@ -13,10 +13,10 @@
 TOP_MODULE      ?= nanosoc_chip
 
 # Filelist to give to v2html
-FILELIST        ?= $(PROJECT_DIR)/flist/project/system.flist
+FILELIST        ?= $(SOCLABS_PROJECT_DIR)/flist/project/system.flist
 
 # Directory to store generated HTML
-OUT_DIR         ?= $(PROJECT_DIR)
+OUT_DIR         ?= $(SOCLABS_PROJECT_DIR)
 
 # Name of generated filelist by python script
 OUTPUT_FILELIST := $(OUT_DIR)/filelist.flist
@@ -26,5 +26,5 @@ gen_html:
 	@mkdir -p $(OUT_DIR)/build
 	@(cd $(OUT_DIR)/build; \
 	rm *.html; rm *.gif; \
-	$(SOCTOOLS_FLOW_DIR)/bin/filelist_compile.py -e -f $(FILELIST) -o $(OUTPUT_FILELIST) ; \
-	$(SOCTOOLS_FLOW_DIR)/bin/htmlgen/v2html/v2html -f $(OUTPUT_FILELIST) -ht $(TOP_MODULE) ; )
+	$(SOCLABS_SOCTOOLS_FLOW_DIR)/bin/filelist_compile.py -e -f $(FILELIST) -o $(OUTPUT_FILELIST) ; \
+	$(SOCLABS_SOCTOOLS_FLOW_DIR)/bin/htmlgen/v2html/v2html -f $(OUTPUT_FILELIST) -ht $(TOP_MODULE) ; )
diff --git a/bin/htmlgen/project_html_gen.py b/bin/htmlgen/project_html_gen.py
index 922796a..5cc6d17 100755
--- a/bin/htmlgen/project_html_gen.py
+++ b/bin/htmlgen/project_html_gen.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python3
 #------------------------------------------------------------------------------------
 # HTML Project Generation Script
-# - Generates HTML based on all filelist in PROJECT_DIR/flist/project
+# - Generates HTML based on all filelist in SOCLABS_PROJECT_DIR/flist/project
 # A joint work commissioned on behalf of SoC Labs, under Arm Academic Access license.
 #
 # Contributors
@@ -28,7 +28,7 @@ def top_mod_find(filelist):
 
 def bootrom_gen():
     # Runs Bootrom generation script in NanoSoC Directory
-    bootrom_scipt_dir = os.getenv("NANOSOC_TECH_DIR")+"/system"
+    bootrom_scipt_dir = os.getenv("SOCLABS_NANOSOC_TECH_DIR")+"/system"
     subprocess.run(["make","-C",bootrom_scipt_dir,"bootrom"])
 
 def html_gen(filelist_path):
@@ -38,9 +38,9 @@ def html_gen(filelist_path):
     # Find Top-level module name
     top_mod = top_mod_find(filelist_path)
     # Work out output Directory
-    outdir = os.getenv("PROJECT_DIR")+"/"+filelist_name+"/html"
+    outdir = os.getenv("SOCLABS_PROJECT_DIR")+"/"+filelist_name+"/html"
     print(outdir)
-    html_scipt_dir = os.getenv("SOCTOOLS_FLOW_DIR")+"/bin/htmlgen"
+    html_scipt_dir = os.getenv("SOCLABS_SOCTOOLS_FLOW_DIR")+"/bin/htmlgen"
     subprocess.run(["make","-C",html_scipt_dir,"gen_html","TOP_MODULE="+top_mod,"OUT_DIR="+outdir])
 
 def project_gen(args):
@@ -49,8 +49,8 @@ def project_gen(args):
         # Generate bootrom
         bootrom_gen()
         # Find all filelist in project filelist directory
-        for filelist in os.listdir(os.getenv("PROJECT_DIR")+"/flist/project"):
-            filelist_path = os.getenv("PROJECT_DIR")+"/flist/project/"+filelist
+        for filelist in os.listdir(os.getenv("SOCLABS_PROJECT_DIR")+"/flist/project"):
+            filelist_path = os.getenv("SOCLABS_PROJECT_DIR")+"/flist/project/"+filelist
             html_gen(filelist_path)
     else:
         if args.bootrom is True:
@@ -61,7 +61,7 @@ def project_gen(args):
         
 if __name__ == "__main__":
     # Capture Arguments from Command Line
-    parser = argparse.ArgumentParser(description='Generates HTML based on all filelist in PROJECT_DIR/flist/project')
+    parser = argparse.ArgumentParser(description='Generates HTML based on all filelist in SOCLABS_PROJECT_DIR/flist/project')
     parser.add_argument("-f", "--filelist", type=str, help="Generate only from this List", required=False)
     parser.add_argument("-b", "--bootrom", action='store_true', help="Generate Bootrom first", required=False)
     parser.add_argument("-o", "--output", type=str, help="Output Filelist location", required=False)
diff --git a/tools/htmlgen b/tools/htmlgen
index 4e09664..d04d0da 100755
--- a/tools/htmlgen
+++ b/tools/htmlgen
@@ -11,4 +11,4 @@
 #-----------------------------------------------------------------------------
 
 # Call Python script and pass options across
-python3 $SOCTOOLS_FLOW_DIR/bin/htmlgen/project_html_gen.py $@
\ No newline at end of file
+python3 $SOCLABS_SOCTOOLS_FLOW_DIR/bin/htmlgen/project_html_gen.py $@
\ No newline at end of file
diff --git a/tools/socpull b/tools/socpull
index 42ff651..84ad83b 100755
--- a/tools/socpull
+++ b/tools/socpull
@@ -1,8 +1,8 @@
 #!/bin/bash
 
 # Update all Submodules to latest commit
-cd $DESIGN_ROOT; git submodule foreach --recursive git pull
-# for d in $DESIGN_ROOT/* ; do
+cd $SOCLABS_DESIGN_ROOT; git submodule foreach --recursive git pull
+# for d in $SOCLABS_DESIGN_ROOT/* ; do
 #     if [ -f "$d/.git" ]; then
 #         echo "Git Pulling $d"
 #         cd $d; git pull; cd ..
diff --git a/tools/socsim b/tools/socsim
index 194c887..9c7fbf5 100755
--- a/tools/socsim
+++ b/tools/socsim
@@ -25,11 +25,11 @@ else
             if [ ${2} == "all" ]; then
                 # Clean all simualation directories
                 echo "Cleaning all Project Simulation Directories"
-                rm -rf $PROJECT_DIR/simulate/sim
-                mkdir -p $PROJECT_DIR/simulate/sim
+                rm -rf $SOCLABS_PROJECT_DIR/simulate/sim
+                mkdir -p $SOCLABS_PROJECT_DIR/simulate/sim
             else
                 # Remove specific simulaiton directory
-                SIM_DIR=$PROJECT_DIR/simulate/sim/${2}
+                SIM_DIR=$SOCLABS_PROJECT_DIR/simulate/sim/${2}
                 if [ -d "$SIM_DIR" ]; then
                     rm -rf $SIM_DIR
                 else 
@@ -40,7 +40,7 @@ else
     fi
 
     # Find a simulation script in the SoCSim environments of all subrepos
-    simscript=$(find ${SOCSIM_PATH//:/\ } -name "${1}.sh")
+    simscript=$(find ${SOCLABS_SOCSIM_PATH//:/\ } -name "${1}.sh")
 
     # Run Script if Found
     $simscript $@
-- 
GitLab