From ee8e64284c1a32dc5def01b5b08f615e7e56dff9 Mon Sep 17 00:00:00 2001 From: PMiranda Date: Fri, 27 Oct 2023 10:59:07 +0100 Subject: [PATCH 1/4] fix(LIB): search modules in SOC/submodules - update LIB modules test script to search for modules in `SOC/submodules`. This fixes failing tests with missing `axi_ram` found in `SOC/submodules/AXI` --- submodules/LIB/scripts/test.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/submodules/LIB/scripts/test.sh b/submodules/LIB/scripts/test.sh index 3b622316f..c1453f8a8 100755 --- a/submodules/LIB/scripts/test.sh +++ b/submodules/LIB/scripts/test.sh @@ -2,6 +2,9 @@ set -e +#iob module search path in SOC/submodules directory +PROJECT_ROOT=../ + #find directories containing testbenches TBS=`find hardware | grep _tb.v | grep -v include` @@ -20,7 +23,7 @@ fi #test if first argument is test and run all tests if [ "$1" == "test" ]; then for i in $MODULES; do - make clean build-setup CORE=$i TOP_MODULE_NAME=$i + make clean build-setup PROJECT_ROOT=$PROJECT_ROOT CORE=$i TOP_MODULE_NAME=$i make -C ../${i}_V* sim-run done exit 0 @@ -29,10 +32,10 @@ fi #test if first argument is "build" and run build for single module if [ "$1" == "build" ]; then make clean build-setup CORE=$2 TOP_MODULE_NAME=$2 - make -C ../$2_V* sim-build + make -C ../$2_V* sim-build PROJECT_ROOT=$PROJECT_ROOT exit 0 fi #run single test make clean build-setup CORE=$1 TOP_MODULE_NAME=$1 -make -C ../$1_V* sim-run VCD=$VCD +make -C ../$1_V* sim-run VCD=$VCD PROJECT_ROOT=$PROJECT_ROOT From 7b5077bce81238ccae7e9263a397a7c1be879cfc Mon Sep 17 00:00:00 2001 From: PMiranda Date: Fri, 27 Oct 2023 11:00:28 +0100 Subject: [PATCH 2/4] feat(CI): add LIB test job - update SOC actions to run job testing LIB modules --- .github/workflows/ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 210bc551c..2db692df2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,17 @@ on: workflow_dispatch: jobs: + lib: + runs-on: self-hosted + timeout-minutes: 5 + + steps: + - uses: actions/checkout@v3 + with: + submodules: 'recursive' + - name: run uart test + run: cd submodules/LIB; ./scripts/test.sh test + uart: runs-on: self-hosted timeout-minutes: 5 From 02ec1d2b89920567fb4520c0860f7da44169bd3b Mon Sep 17 00:00:00 2001 From: PMiranda Date: Fri, 27 Oct 2023 11:05:21 +0100 Subject: [PATCH 3/4] fix(CI): run LIB tests from nix-shell --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2db692df2..a38765a91 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,8 +28,8 @@ jobs: - uses: actions/checkout@v3 with: submodules: 'recursive' - - name: run uart test - run: cd submodules/LIB; ./scripts/test.sh test + - name: run LIB test + run: nix-shell --run "cd submodules/LIB; ./scripts/test.sh test" uart: runs-on: self-hosted From d52f9ecf8320ba76542df51d389bf8c6673a5d31 Mon Sep 17 00:00:00 2001 From: PMiranda Date: Fri, 27 Oct 2023 11:15:16 +0100 Subject: [PATCH 4/4] fix(LIB): update PROJECT_ROOT to match UART - update PROJECT_ROOT in LIB/makefile to match usage in other submodules --- submodules/LIB/Makefile | 1 + submodules/LIB/scripts/test.sh | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/submodules/LIB/Makefile b/submodules/LIB/Makefile index 076706113..2b4abd466 100644 --- a/submodules/LIB/Makefile +++ b/submodules/LIB/Makefile @@ -4,6 +4,7 @@ # LIB_DIR:=. +PROJECT_ROOT=.. DISABLE_LINT:=1 DISABLE_FORMAT:=1 # Default lib module to setup. Can be overriden by the user. diff --git a/submodules/LIB/scripts/test.sh b/submodules/LIB/scripts/test.sh index c1453f8a8..3b622316f 100755 --- a/submodules/LIB/scripts/test.sh +++ b/submodules/LIB/scripts/test.sh @@ -2,9 +2,6 @@ set -e -#iob module search path in SOC/submodules directory -PROJECT_ROOT=../ - #find directories containing testbenches TBS=`find hardware | grep _tb.v | grep -v include` @@ -23,7 +20,7 @@ fi #test if first argument is test and run all tests if [ "$1" == "test" ]; then for i in $MODULES; do - make clean build-setup PROJECT_ROOT=$PROJECT_ROOT CORE=$i TOP_MODULE_NAME=$i + make clean build-setup CORE=$i TOP_MODULE_NAME=$i make -C ../${i}_V* sim-run done exit 0 @@ -32,10 +29,10 @@ fi #test if first argument is "build" and run build for single module if [ "$1" == "build" ]; then make clean build-setup CORE=$2 TOP_MODULE_NAME=$2 - make -C ../$2_V* sim-build PROJECT_ROOT=$PROJECT_ROOT + make -C ../$2_V* sim-build exit 0 fi #run single test make clean build-setup CORE=$1 TOP_MODULE_NAME=$1 -make -C ../$1_V* sim-run VCD=$VCD PROJECT_ROOT=$PROJECT_ROOT +make -C ../$1_V* sim-run VCD=$VCD