From afbb9748bdf56ebaf80e343c3ec68e0c3b6bd917 Mon Sep 17 00:00:00 2001 From: Krzysztof Bieganski Date: Wed, 8 Nov 2023 18:53:11 +0100 Subject: [PATCH] Add CI workflow for UVM testbench Signed-off-by: Krzysztof Bieganski --- .github/workflows/build-verilator.yml | 17 ++++-- .github/workflows/ci.yml | 5 ++ .github/workflows/test-uvm.yml | 75 +++++++++++++++++++++++++++ 3 files changed, 94 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/test-uvm.yml diff --git a/.github/workflows/build-verilator.yml b/.github/workflows/build-verilator.yml index 9a34e6f3c89..2ca41a28746 100644 --- a/.github/workflows/build-verilator.yml +++ b/.github/workflows/build-verilator.yml @@ -7,9 +7,20 @@ jobs: verilator: name: Build Verilator runs-on: ubuntu-latest + strategy: + matrix: + include: + - version: v5.010 + repo: verilator/verilator + commit: v5.010 + - version: uvm + repo: antmicro/verilator-1 + commit: df36e9ca2597aebe4b92c72461d945745b36c3e0 env: TOOL_NAME: verilator - TOOL_VERSION: v5.010 + TOOL_VERSION: ${{ matrix.version }} + TOOL_REPO: ${{ matrix.repo }} + TOOL_COMMIT: ${{ matrix.commit }} DEBIAN_FRONTEND: "noninteractive" steps: @@ -56,9 +67,9 @@ jobs: run: | export CCACHE_DIR=/opt/verilator/.cache ccache --show-config | grep cache_dir - git clone https://github.com/verilator/verilator + git clone https://github.com/${{ env.TOOL_REPO }} pushd verilator - git checkout ${{ env.TOOL_VERSION }} + git checkout ${{ env.TOOL_COMMIT }} autoconf ./configure --prefix=/opt/verilator make -j `nproc` diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1d8b7c40a7..db3001341dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,11 @@ jobs: needs: [Build-Verilator, Build-Spike] uses: ./.github/workflows/test-riscof.yml + Test-UVM: + name: Test-UVM + needs: [Build-Verilator] + uses: ./.github/workflows/test-uvm.yml + Report-Coverage: name: Report-Coverage needs: [Test-Regression, Test-Verification, Test-RISCV-DV, Test-RISCOF] diff --git a/.github/workflows/test-uvm.yml b/.github/workflows/test-uvm.yml new file mode 100644 index 00000000000..6cbc107e8a8 --- /dev/null +++ b/.github/workflows/test-uvm.yml @@ -0,0 +1,75 @@ +name: VeeR-EL2 verification + +on: + workflow_call: + +env: + VERILATOR_VERSION: v5.010 + +jobs: + tests: + name: UVM tests + runs-on: ubuntu-latest + env: + CCACHE_DIR: "/opt/uvm/.cache/" + VERILATOR_VERSION: uvm + DEBIAN_FRONTEND: "noninteractive" + steps: + - name: Setup repository + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Setup Cache Metadata + id: cache_metadata + run: | + date=$(date +"%Y_%m_%d") + time=$(date +"%Y%m%d_%H%M%S_%N") + cache_verilator_restore_key=cache_verilator_ + cache_verilator_key=${cache_verilator_restore_key}${{ env.VERILATOR_VERSION }} + cache_test_restore_key=${{ matrix.test }}_${{ matrix.coverage }}_ + cache_test_key=${cache_test_restore_key}${time} + + echo "date=$date" | tee -a "$GITHUB_ENV" + echo "time=$time" | tee -a "$GITHUB_ENV" + echo "cache_verilator_restore_key=$cache_verilator_restore_key" | tee -a "$GITHUB_ENV" + echo "cache_verilator_key=$cache_verilator_key" | tee -a "$GITHUB_ENV" + echo "cache_test_restore_key=$cache_test_restore_key" | tee -a "$GITHUB_ENV" + echo "cache_test_key=$cache_test_key" | tee -a "$GITHUB_ENV" + + + - name: Restore verilator cache + id: cache-verilator-restore + uses: actions/cache/restore@v3 + with: + path: | + /opt/verilator + /opt/verilator/.cache + key: ${{ env.cache_verilator_key }} + restore-keys: ${{ env.cache_verilator_restore_key }} + + - name: Setup tests cache + uses: actions/cache@v3 + id: cache-test-setup + with: + path: | + ${{ env.CCACHE_DIR }} + key: ${{ env.cache_test_key }} + restore-keys: ${{ env.cache_test_restore_key }} + + - name: Install prerequisities + run: | + sudo apt -qqy update && sudo apt -qqy --no-install-recommends install \ + build-essential + + - name: Setup environment + run: | + echo "/opt/verilator/bin" >> $GITHUB_PATH + RV_ROOT=`pwd` + echo "RV_ROOT=$RV_ROOT" >> $GITHUB_ENV + PYTHONUNBUFFERED=1 + echo "PYTHONUNBUFFERED=$PYTHONUNBUFFERED" >> $GITHUB_ENV + + - name: Run UVM testbench + run: | + make -f tools/Makefile verilator-uvm -j$(nproc)