diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 831efa175..90b928b38 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -57,35 +57,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-riscv-arch-test + 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* - - name: Setup PATH + 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 }}- + + - 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: | @@ -102,6 +130,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + with: + submodules: recursive - name: Set up Python uses: actions/setup-python@v4 @@ -120,10 +150,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: | 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