From 33b9347c25bbd50fc408dbe02df8897af691adab Mon Sep 17 00:00:00 2001
From: David Mapstone <david@mapstone.me>
Date: Tue, 28 Feb 2023 15:07:16 +0000
Subject: [PATCH] Added Environment Sourcing Script

---
 accelerator-wrapper |  2 +-
 nanosoc             |  2 +-
 scripts/soc-pull    |  9 +++++++++
 set_env.sh          | 43 +++++++++++++++++++++++++++++++++++++++++++
 sha-2-accelerator   |  2 +-
 5 files changed, 55 insertions(+), 3 deletions(-)
 create mode 100755 scripts/soc-pull
 create mode 100755 set_env.sh

diff --git a/accelerator-wrapper b/accelerator-wrapper
index dc11858..182d507 160000
--- a/accelerator-wrapper
+++ b/accelerator-wrapper
@@ -1 +1 @@
-Subproject commit dc11858b92e1e6e842b69410ad91eb498cfbde87
+Subproject commit 182d50719dca5eab2e23974ba6097da3cc8ac7a5
diff --git a/nanosoc b/nanosoc
index dc54657..74c8e4c 160000
--- a/nanosoc
+++ b/nanosoc
@@ -1 +1 @@
-Subproject commit dc54657650d9c0828d2e13d6f26005e01430cb2d
+Subproject commit 74c8e4cdaad55b46db901cf336f12828344099ca
diff --git a/scripts/soc-pull b/scripts/soc-pull
new file mode 100755
index 0000000..ae36354
--- /dev/null
+++ b/scripts/soc-pull
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# Update all Submodules to latest commit
+for d in $DESIGN_ROOT/* ; do
+    if [ -f "$d/.git" ]; then
+        echo "Git Pulling $d"
+        cd $d; git pull; cd ..
+    fi
+done
\ No newline at end of file
diff --git a/set_env.sh b/set_env.sh
new file mode 100755
index 0000000..46dcf86
--- /dev/null
+++ b/set_env.sh
@@ -0,0 +1,43 @@
+#-----------------------------------------------------------------------------
+# SoC Labs Environment Setup Script
+# A joint work commissioned on behalf of SoC Labs, under Arm Academic Access license.
+#
+# Contributors
+#
+# David Mapstone (d.a.mapstone@soton.ac.uk)
+#
+# Copyright  2023, SoC Labs (www.soclabs.org)
+#-----------------------------------------------------------------------------
+#!/bin/bash
+
+# Get Root Location of Repository
+if [ -z $DESIGN_ROOT ]; then
+    # If $DESIGN_ROOT hasn't been set yet
+    DESIGN_ROOT=`git rev-parse --show-superproject-working-tree`
+    if [ -z $DESIGN_ROOT ]; then
+        # If not in a submodule
+        DESIGN_ROOT=`git rev-parse --show-toplevel`
+    fi
+fi
+
+# Set Environment Variable for this Repository
+export SHA_2_SOC_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
+
+# If this Repo is root of workspace
+if [ $SHA_2_SOC_DIR = $DESIGN_ROOT ]; then
+    echo "Design Workspace: $SHA_2_SOC_DIR" 
+    export DESIGN_ROOT
+fi
+
+# Source environment variables for all submodules
+for d in $SHA_2_SOC_DIR/* ; do
+    if [ -f "$d/.git" ]; then
+        if [ -f "$d/set_env.sh" ]; then
+        # If .git file exists - submodule
+            source $d/set_env.sh
+        fi
+    fi
+done
+
+# Add Scripts to PAth
+export PATH="$PATH:/$DESIGN_ROOT/scripts"
\ No newline at end of file
diff --git a/sha-2-accelerator b/sha-2-accelerator
index b50a185..df94cd3 160000
--- a/sha-2-accelerator
+++ b/sha-2-accelerator
@@ -1 +1 @@
-Subproject commit b50a185cf41cbc38dd9a917b7d61a698c2e205d7
+Subproject commit df94cd39be37fd9820d69167015865ffbacb8265
-- 
GitLab