From ac5e13d19e0d621f9fcaca751e25615d11ad6fa8 Mon Sep 17 00:00:00 2001 From: Piotr Wegrzyn Date: Wed, 6 Mar 2024 17:23:34 +0100 Subject: [PATCH 1/4] Add risv-arch-test as submodule --- .gitmodules | 3 +++ test/external/riscof/riscv-arch-test | 1 + 2 files changed, 4 insertions(+) create mode 160000 test/external/riscof/riscv-arch-test diff --git a/.gitmodules b/.gitmodules index 6ecd7035d..8dea05eb8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,3 +5,6 @@ path = test/external/embench/embench-iot url = https://github.com/embench/embench-iot.git ignore = dirty +[submodule "test/external/riscof/riscv-arch-test"] + path = test/external/riscof/riscv-arch-test + url = https://github.com/riscv-non-isa/riscv-arch-test.git diff --git a/test/external/riscof/riscv-arch-test b/test/external/riscof/riscv-arch-test new file mode 160000 index 000000000..8a52b016d --- /dev/null +++ b/test/external/riscof/riscv-arch-test @@ -0,0 +1 @@ +Subproject commit 8a52b016dbe1e2733cc168b9d6e5c93e39059d4d From f7428d80956f098fc2b975aa39fb85b119248d61 Mon Sep 17 00:00:00 2001 From: Piotr Wegrzyn Date: Wed, 6 Mar 2024 17:30:07 +0100 Subject: [PATCH 2/4] Use cache for riscv-arch-test in CI --- .github/workflows/main.yml | 63 +++++++++++++++++++++++++++++++------- 1 file changed, 52 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9bb28de3c..101e0fd1a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -55,35 +55,63 @@ jobs: defaults: run: working-directory: test/external/riscof/ + steps: - name: Checkout uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Cache compiled and reference riscv-arch-test + id: cache-submit + uses: actions/cache@v3 + env: + cache-name: cache-riscv-arch-test + with: + path: | + test/external/riscof/riscv-arch-test/**/*.elf + test/external/riscof/riscof_work/**/*.signature + test/external/riscof/**/*Makefile* + + key: ${{ env.cache-name }}-${{ runner.os }}-${{ hashFiles( + '**/test/external/riscof/coreblocks/**', + '**/test/external/riscof/spike_simple/**', + '**/test/external/riscof/config.ini', + '**/.git/modules/test/external/riscof/riscv-arch-test/HEAD', + '**/docker/riscv-toolchain.Dockerfile' + ) }} + restore-keys: | + ${{ env.cache-name }}-${{ runner.os }}- - - name: Setup PATH + - if: ${{ steps.cache-riscv-arch-test.outputs.cache-hit != 'true' }} + name: Setup PATH run: echo "/.pyenv/bin" >> $GITHUB_PATH - - name: Setup pyenv python + - if: ${{ steps.cache-riscv-arch-test.outputs.cache-hit != 'true' }} + name: Setup pyenv python run: | eval "$(pyenv init --path)" pyenv global 3.6.15 . /venv3.6/bin/activate - - name: Setup arch test suite + - if: ${{ steps.cache-riscv-arch-test.outputs.cache-hit != 'true' }} + name: Setup arch test suite run: | . /venv3.6/bin/activate - riscof --verbose info arch-test --clone riscof testlist --config=config.ini --suite=riscv-arch-test/riscv-test-suite/ --env=riscv-arch-test/riscv-test-suite/env - - name: Build and run tests on reference and generate Makefiles + - if: ${{ steps.cache-riscv-arch-test.outputs.cache-hit != 'true' }} + name: Build and run tests on reference and generate Makefiles run: | . /venv3.6/bin/activate riscof run --config=config.ini --suite=riscv-arch-test/riscv-test-suite/ --env=riscv-arch-test/riscv-test-suite/env - - name: Build tests for Coreblocks + - if: ${{ steps.cache-riscv-arch-test.outputs.cache-hit != 'true' }} + name: Build tests for Coreblocks run: | MAKEFILE_PATH=riscof_work/Makefile.build-DUT-coreblocks ../../../ci/riscof_run_makefile.sh - - - uses: actions/upload-artifact@v3 + - if: ${{ steps.cache-riscv-arch-test.outputs.cache-hit != 'true' }} + uses: actions/upload-artifact@v3 with: name: "riscof-tests" path: | @@ -118,10 +146,23 @@ jobs: name: "verilog-full-core" path: . - - uses: actions/download-artifact@v3 + - uses: actions/cache@v3 + env: + cache-name: cache-riscv-arch-test with: - name: "riscof-tests" - path: test/external/riscof/ + path: | + test/external/riscof/riscv-arch-test/**/*.elf + test/external/riscof/riscof_work/**/*.signature + test/external/riscof/**/*Makefile* + + key: ${{ env.cache-name }}-${{ runner.os }}-${{ hashFiles( + '**/test/external/riscof/coreblocks/**', + '**/test/external/riscof/spike_simple/**', + '**/test/external/riscof/config.ini', + '**/.git/modules/test/external/riscof/riscv-arch-test/HEAD', + '**/docker/riscv-toolchain.Dockerfile' + ) }} + fail-on-cache-miss: true - name: Run tests on Coreblocks run: | From d1f49453d5304ca33bb71e0a2ac433c18e68090b Mon Sep 17 00:00:00 2001 From: Piotr Wegrzyn Date: Wed, 6 Mar 2024 17:38:36 +0100 Subject: [PATCH 3/4] fix?? --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 101e0fd1a..ec80c992f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -128,6 +128,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + with: + submodules: recursive - name: Set up Python uses: actions/setup-python@v4 From ff1744019264812a615161803b6431cdcc238e19 Mon Sep 17 00:00:00 2001 From: Piotr Wegrzyn Date: Wed, 6 Mar 2024 17:50:22 +0100 Subject: [PATCH 4/4] Fix cache skip --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ec80c992f..f792f796d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -63,7 +63,7 @@ jobs: submodules: recursive - name: Cache compiled and reference riscv-arch-test - id: cache-submit + id: cache-riscv-arch-test uses: actions/cache@v3 env: cache-name: cache-riscv-arch-test