diff --git a/.github/workflows/build-verilator.yml b/.github/workflows/build-verilator.yml deleted file mode 100644 index daa2432dff0..00000000000 --- a/.github/workflows/build-verilator.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: Verilator Build - -on: - workflow_call: - -jobs: - verilator: - name: Build Verilator - runs-on: ubuntu-latest - strategy: - matrix: - include: - - version: v5.024 - repo: verilator/verilator - commit: v5.024 - - version: uvm - repo: verilator/verilator - commit: 7ca2d6470a - env: - TOOL_NAME: verilator - TOOL_VERSION: ${{ matrix.version }} - TOOL_REPO: ${{ matrix.repo }} - TOOL_COMMIT: ${{ matrix.commit }} - DEBIAN_FRONTEND: "noninteractive" - - steps: - - name: Setup Cache Metadata - id: cache_metadata - run: | - cache_date=$(date +"%Y_%m_%d") - cache_name=cache_${{ env.TOOL_NAME }}_${{ env.TOOL_VERSION }}_${{ env.TOOL_COMMIT }} - echo "Cache date: "$cache_date - echo "Cache name: "$cache_name - echo "cache_date=$cache_date" >> "$GITHUB_ENV" - echo "cache_name=$cache_name" >> "$GITHUB_ENV" - - - name: Setup cache - uses: actions/cache@v3 - id: cache - timeout-minutes: 60 - with: - path: | - /opt/verilator - /opt/verilator/.cache - key: ${{ env.cache_name }}_${{ env.cache_date }} - restore-keys: ${{ env.cache_name }}_ - - - name: Install prerequisities - if: ${{ steps.cache.outputs.cache-hit != 'true' }} - run: | - sudo apt -qqy update && sudo apt -qqy --no-install-recommends install \ - autoconf automake autotools-dev \ - bc bison build-essential \ - ccache curl \ - flex \ - gawk git gperf \ - help2man \ - libexpat-dev libfl-dev libfl2 libgmp-dev \ - libmpc-dev libmpfr-dev libtool \ - ninja-build \ - patchutils python3 python3-pip \ - texinfo \ - zlib1g zlib1g-dev - - - name: Build Verilator - if: ${{ steps.cache.outputs.cache-hit != 'true' }} - run: | - export CCACHE_DIR=/opt/verilator/.cache - ccache --show-config | grep cache_dir - git clone https://github.com/${{ env.TOOL_REPO }} verilator - pushd verilator - git checkout ${{ env.TOOL_COMMIT }} - autoconf - ./configure --prefix=/opt/verilator - make -j `nproc` - make install - popd diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d44639cdc3..0b05b76b673 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,60 +8,36 @@ on: jobs: - Build-Verilator: - name: Build-Verilator - uses: ./.github/workflows/build-verilator.yml - - Build-Spike: - name: Build-Spike - uses: ./.github/workflows/build-spike.yml - - Get-Renode: - name: Get-Renode - uses: ./.github/workflows/get-renode.yml - - Build-OpenOCD: - name: Build-OpenOCD - uses: ./.github/workflows/build-openocd.yml - Test-Regression: name: Test-Regression - needs: [Build-Verilator] uses: ./.github/workflows/test-regression.yml Test-Verification: name: Test-Verification - needs: [Build-Verilator] uses: ./.github/workflows/test-verification.yml Test-Microarchitectural: name: Test-Microarchitectural - needs: [Build-Verilator] uses: ./.github/workflows/test-uarch.yml Test-RISCV-DV: name: Test-RISCV-DV - needs: [Build-Verilator, Build-Spike, Get-Renode] uses: ./.github/workflows/test-riscv-dv.yml Test-RISCOF: name: Test-RISCOF - 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 Test-Renode: name: Test-Renode - needs: [Get-Renode] uses: ./.github/workflows/test-renode.yml Test-OpenOCD: name: Test-OpenOCD - needs: [Build-Verilator, Build-OpenOCD] uses: ./.github/workflows/test-openocd.yml Report-Coverage: diff --git a/.github/workflows/get-renode.yml b/.github/workflows/get-renode.yml deleted file mode 100644 index 57c7beeaf41..00000000000 --- a/.github/workflows/get-renode.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Get Renode - -on: - workflow_call: - -jobs: - -#--------------# -# Renode -#--------------# - renode: - name: Get Renode - runs-on: ubuntu-latest - env: - TOOL_NAME: renode - TOOL_VERSION: 1.15.3+20240924gitc7bc336bb - DEBIAN_FRONTEND: "noninteractive" - - steps: - - name: Setup Cache Metadata - id: cache_metadata - run: | - cache_date=$(date +"%Y_%m_%d") - cache_name=cache_${{ env.TOOL_NAME }}_${{ env.TOOL_VERSION }} - echo "Cache date: "$cache_date - echo "Cache name: "$cache_name - echo "cache_date=$cache_date" >> "$GITHUB_ENV" - echo "cache_name=$cache_name" >> "$GITHUB_ENV" - - - name: Setup cache - uses: actions/cache@v3 - id: cache - timeout-minutes: 60 - with: - path: | - /opt/renode - key: ${{ env.cache_name }}_${{ env.cache_date }} - restore-keys: ${{ env.cache_name }}_ - - - name: Get Renode - if: ${{ steps.cache.outputs.cache-hit != 'true' }} - run: | - wget https://builds.renode.io/renode-${{ env.TOOL_VERSION}}.linux-portable.tar.gz - - - name: Rename the archive - if: ${{ steps.cache.outputs.cache-hit != 'true' }} - run: | - mv ${{ github.workspace }}/renode-*.tar.gz ${{ github.workspace }}/renode.tar.gz - - - name: Unpack binaries - if: ${{ steps.cache.outputs.cache-hit != 'true' }} - run: | - pushd /opt - mv ${{ github.workspace }}/renode.tar.gz . - mkdir -p renode - tar -zxvf renode.tar.gz --strip-components=1 -C renode/ - popd diff --git a/.github/workflows/test-openocd.yml b/.github/workflows/test-openocd.yml index b86675aefa8..fa64af13ae8 100644 --- a/.github/workflows/test-openocd.yml +++ b/.github/workflows/test-openocd.yml @@ -8,6 +8,7 @@ jobs: tests: name: Run OpenOCD tests runs-on: ubuntu-latest + container: ghcr.io/antmicro/cores-veer-el2:latest strategy: fail-fast: false matrix: @@ -16,7 +17,6 @@ jobs: env: DEBIAN_FRONTEND: "noninteractive" CCACHE_DIR: "/opt/openocd-tests/.cache/" - VERILATOR_VERSION: v5.024 steps: - name: Install utils @@ -31,46 +31,20 @@ jobs: 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 }}_${{ env.VERILATOR_COMMIT }} - cache_openocd_restore_key=cache_openocd_ - cache_openocd_key=${cache_openocd_restore_key} cache_test_restore_key=${{ 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_openocd_restore_key=$cache_openocd_restore_key" | tee -a "$GITHUB_ENV" - echo "cache_openocd_key=$cache_openocd_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 }} - - - name: Restore OpenOCD cache - id: cache-openocd-restore - uses: actions/cache/restore@v3 - with: - path: | - /opt/openocd - /opt/openocd/.cache - key: ${{ env.cache_openocd_key }} - restore-keys: ${{ env.cache_openocd_restore_key }} - - name: Setup repository uses: actions/checkout@v3 with: submodules: recursive - name: install SiteSpawner package + shell: bash run: | python3 -m venv .venv .venv/bin/python3 -m pip install tools/SiteSpawner @@ -79,6 +53,7 @@ jobs: python3 -m pip install tools/SiteSpawner - name: Build verilated simulation + shell: bash run: | export PATH=/opt/verilator/bin:/opt/openocd/bin:$PATH export RV_ROOT=$(pwd) @@ -91,6 +66,7 @@ jobs: -f ${RV_ROOT}/testbench/openocd_scripts/jtag_cg.tcl - name: Prepare coverage data + shell: bash run: | export PATH=/opt/verilator/bin:$PATH export RV_ROOT=$(pwd) diff --git a/.github/workflows/test-regression.yml b/.github/workflows/test-regression.yml index 905331d13b9..0264c2d0bd5 100644 --- a/.github/workflows/test-regression.yml +++ b/.github/workflows/test-regression.yml @@ -8,6 +8,7 @@ jobs: regression-tests: name: Regression tests runs-on: ubuntu-latest + container: ghcr.io/antmicro/cores-veer-el2:latest strategy: matrix: bus: ["axi", "ahb"] @@ -21,7 +22,6 @@ jobs: env: DEBIAN_FRONTEND: "noninteractive" CCACHE_DIR: "/opt/regression/.cache/" - VERILATOR_VERSION: v5.024 steps: - name: Install utils @@ -37,28 +37,14 @@ jobs: 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 }}_${{ env.VERILATOR_COMMIT }} 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 }} - - name: Setup tests cache uses: actions/cache@v3 id: cache-test-setup @@ -74,6 +60,7 @@ jobs: submodules: recursive - name: install SiteSpawner package + shell: bash run: | python3 -m venv .venv .venv/bin/python3 -m pip install tools/SiteSpawner @@ -82,6 +69,7 @@ jobs: python3 -m pip install tools/SiteSpawner - name: Setup environment + shell: bash run: | echo "/opt/verilator/bin" >> $GITHUB_PATH RV_ROOT=`pwd` @@ -92,13 +80,16 @@ jobs: echo "TEST_PATH=$TEST_PATH" >> $GITHUB_ENV - name: Run tests + shell: bash run: | export PATH=/opt/verilator/bin:$PATH export RV_ROOT=`pwd` .github/scripts/run_regression_test.sh $TEST_PATH ${{ matrix.bus }} ${{ matrix.test}} ${{ matrix.coverage }} ${{ matrix.priv }} - name: Prepare coverage data + shell: bash run: | + source .venv/bin/activate sis -d convert --dat-dir ${TEST_PATH}/ mkdir -p results mv ${TEST_PATH}/coverage.info \ diff --git a/.github/workflows/test-renode.yml b/.github/workflows/test-renode.yml index 159e394ee4f..fad11edf576 100644 --- a/.github/workflows/test-renode.yml +++ b/.github/workflows/test-renode.yml @@ -6,10 +6,10 @@ on: jobs: tests: runs-on: ubuntu-latest + container: ghcr.io/antmicro/cores-veer-el2:latest strategy: fail-fast: false env: - RENODE_VERSION: latest DEBIAN_FRONTEND: "noninteractive" steps: - name: Clone repository @@ -17,29 +17,6 @@ jobs: 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_renode_restore_key=cache_renode_ - cache_renode_key=${cache_renode_restore_key}${{ env.RENODE_VERSION }} - - echo "date=$date" | tee -a "$GITHUB_ENV" - echo "time=$time" | tee -a "$GITHUB_ENV" - echo "cache_renode_restore_key=$cache_renode_restore_key" | tee -a "$GITHUB_ENV" - echo "cache_renode_key=$cache_renode_key" | tee -a "$GITHUB_ENV" - - - name: Restore Renode cache - id: cache-renode-restore - uses: actions/cache/restore@v3 - with: - path: | - /opt/renode - key: ${{ env.cache_renode_key }} - restore-keys: ${{ env.cache_renode_restore_key }} - fail-on-cache-miss: true - - name: Install dependencies run: | sudo apt -qqy update && sudo apt -qqy --no-install-recommends install \ diff --git a/.github/workflows/test-riscof.yml b/.github/workflows/test-riscof.yml index cf41ee62984..9d262df12a1 100644 --- a/.github/workflows/test-riscof.yml +++ b/.github/workflows/test-riscof.yml @@ -8,6 +8,7 @@ jobs: tests: name: Run RISCOF tests runs-on: ubuntu-latest + container: ghcr.io/antmicro/cores-veer-el2:latest strategy: fail-fast: false matrix: @@ -16,8 +17,6 @@ jobs: env: DEBIAN_FRONTEND: "noninteractive" CCACHE_DIR: "/opt/riscof/.cache/" - VERILATOR_VERSION: v5.024 - SPIKE_VERSION: d70ea67d steps: - name: Install utils @@ -32,40 +31,13 @@ jobs: 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 }}_${{ env.VERILATOR_COMMIT }} - cache_spike_restore_key=cache_spike_ - cache_spike_key=${cache_spike_restore_key}${{ env.SPIKE_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_spike_restore_key=$cache_spike_restore_key" | tee -a "$GITHUB_ENV" - echo "cache_spike_key=$cache_spike_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 }} - - - name: Restore Spike cache - id: cache-spike-restore - uses: actions/cache/restore@v3 - with: - path: | - /opt/spike - /opt/spike/.cache - key: ${{ env.cache_spike_key }} - restore-keys: ${{ env.cache_spike_restore_key }} - - name: Setup tests cache uses: actions/cache@v3 id: cache-test-setup @@ -96,6 +68,7 @@ jobs: submodules: recursive - name: install SiteSpawner package + shell: bash run: | python3 -m venv .venv .venv/bin/python3 -m pip install tools/SiteSpawner @@ -108,6 +81,7 @@ jobs: pip3 install git+https://github.com/riscv/riscof@a25e315 - name: Clone tests + shell: bash run: | mkdir -p riscof pushd riscof @@ -118,6 +92,7 @@ jobs: popd - name: Configure RISCOF + shell: bash run: | pushd riscof # Copy RISCOF configuration @@ -129,6 +104,7 @@ jobs: popd - name: Build VeeR model + shell: bash run: | export PATH=/opt/verilator/bin:$PATH export RV_ROOT=`pwd` @@ -142,6 +118,7 @@ jobs: popd - name: Run tests, collect coverage + shell: bash run: | export PATH=/opt/verilator/bin:/opt/spike/bin:$PATH pushd riscof @@ -151,6 +128,7 @@ jobs: popd - name: Prepare coverage data + shell: bash run: | export PATH=/opt/verilator/bin:$PATH sis -d convert --dat-dir riscof/coverage/ @@ -158,8 +136,9 @@ jobs: riscof/coverage/coverage_riscof_${{matrix.priv}}_${{ matrix.coverage }}.info - name: Prepare report + shell: bash run: | - PYTEST_STYLE_SRC_DIR=${{ github.workspace }}/.github/scripts/pytest/ + PYTEST_STYLE_SRC_DIR=$(pwd)/.github/scripts/pytest/ PYTEST_CSS=${PYTEST_STYLE_SRC_DIR}/css/styles.css pushd riscof/riscof_work bash ${PYTEST_STYLE_SRC_DIR}/style_pytest_report.sh ${PYTEST_STYLE_SRC_DIR} . report.html diff --git a/.github/workflows/test-riscv-dv.yml b/.github/workflows/test-riscv-dv.yml index fae8f5b9fc9..16afe199f1b 100644 --- a/.github/workflows/test-riscv-dv.yml +++ b/.github/workflows/test-riscv-dv.yml @@ -71,6 +71,7 @@ jobs: - name: Generate code (pyflow) if: steps.cache-code.outputs.cache-hit != 'true' && matrix.version == 'pyflow' + shell: bash run: | export RV_ROOT=`realpath .` pushd tools/riscv-dv @@ -97,6 +98,7 @@ jobs: run-tests: name: Run RISC-V DV tests runs-on: ubuntu-latest + container: ghcr.io/antmicro/cores-veer-el2:latest needs: [ generate-config, generate-code ] strategy: fail-fast: false @@ -127,9 +129,6 @@ jobs: env: DEBIAN_FRONTEND: "noninteractive" CCACHE_DIR: "/opt/riscv-dv/.cache/" - VERILATOR_VERSION: v5.024 - SPIKE_VERSION: d70ea67d - RENODE_VERSION: latest CACHE_HASH: ${{ needs.generate-config.outputs.hash }} steps: @@ -143,6 +142,7 @@ jobs: # As of July 9th, 2024 `ubuntu:latest` comes with riscv64-unknown-elf-gcc # 10.0.2. We need a newer version for bitmanip extension support. - name: Install cross-compiler + shell: bash run: | echo "deb http://archive.ubuntu.com/ubuntu/ noble main universe" | sudo tee -a /etc/apt/sources.list > /dev/null sudo apt -qqy update && sudo apt -qqy --no-install-recommends install \ @@ -154,66 +154,23 @@ jobs: 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 }}_${{ env.VERILATOR_COMMIT }} - cache_spike_restore_key=cache_spike_ - cache_spike_key=${cache_spike_restore_key}${{ env.SPIKE_VERSION }} - cache_renode_restore_key=cache_renode_ - cache_renode_key=${cache_renode_restore_key}${{ env.RENODE_VERSION }} cache_test_restore_key=${{ matrix.test }}_${{ matrix.coverage }}_ cache_test_key=${cache_test_restore_key}${time} cache_code=cache_${{ matrix.test }}_${{ matrix.version }} 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_spike_restore_key=$cache_spike_restore_key" | tee -a "$GITHUB_ENV" - echo "cache_spike_key=$cache_spike_key" | tee -a "$GITHUB_ENV" - echo "cache_renode_restore_key=$cache_renode_restore_key" | tee -a "$GITHUB_ENV" - echo "cache_renode_key=$cache_renode_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" echo "cache_code=${cache_code}_${{ env.CACHE_HASH }}" | 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 }} - fail-on-cache-miss: true - - - name: Restore Spike cache - id: cache-spike-restore - uses: actions/cache/restore@v3 - with: - path: | - /opt/spike - /opt/spike/.cache - key: ${{ env.cache_spike_key }} - restore-keys: ${{ env.cache_spike_restore_key }} - fail-on-cache-miss: true - - - name: Restore Renode cache - id: cache-renode-restore - uses: actions/cache/restore@v3 - with: - path: | - /opt/renode - key: ${{ env.cache_renode_key }} - restore-keys: ${{ env.cache_renode_restore_key }} - fail-on-cache-miss: true - - name: Setup repository uses: actions/checkout@v3 with: submodules: recursive - name: install SiteSpawner package + shell: bash run: | python3 -m venv .venv .venv/bin/python3 -m pip install tools/SiteSpawner @@ -240,17 +197,16 @@ jobs: key: cache_tests_${{ steps.cache_timestamp.outputs.time }} restore-keys: cache_tests_ - - name: Cache Code Restore - uses: actions/cache/restore@v3 - id: cache-code-restore - timeout-minutes: 60 + - name: Download Code Artifact + uses: actions/download-artifact@v3 with: - path: tools/riscv-dv/work/test_${{ matrix.test }}/asm_test - key: ${{ env.cache_code }} - fail-on-cache-miss: true + name: riscv-dv_generated_code_${{ matrix.version }} + path: tools/riscv-dv/work/ - name: Run test + shell: bash run: | + ls tools/riscv-dv/work export PATH=/opt/verilator/bin:$PATH export RV_ROOT=`realpath .` export RISCV_GCC=riscv64-unknown-elf-gcc @@ -313,8 +269,6 @@ jobs: env: DEBIAN_FRONTEND: "noninteractive" CCACHE_DIR: "/opt/riscv-dv/.cache/" - VERILATOR_VERSION: v5.024 - SPIKE_VERSION: d70ea67d GHA_EXTERNAL_DISK: additional-tools GHA_SA: gh-sa-veer-uploader CACHE_HASH: ${{ needs.generate-config.outputs.hash }} @@ -336,48 +290,16 @@ jobs: 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_spike_restore_key=cache_spike_ - cache_spike_key=${cache_spike_restore_key}${{ env.SPIKE_VERSION }} - cache_renode_restore_key=cache_renode_ - cache_renode_key=${cache_renode_restore_key}${{ env.RENODE_VERSION }} cache_test_restore_key=${{ matrix.test }}_${{ matrix.coverage }}_ cache_test_key=${cache_test_restore_key}${time} cache_code=cache_${{ matrix.test }}_${{ matrix.version }} 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_spike_restore_key=$cache_spike_restore_key" | tee -a "$GITHUB_ENV" - echo "cache_spike_key=$cache_spike_key" | tee -a "$GITHUB_ENV" - echo "cache_renode_restore_key=$cache_renode_restore_key" | tee -a "$GITHUB_ENV" - echo "cache_renode_key=$cache_renode_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" echo "cache_code=${cache_code}_${{ env.CACHE_HASH }}" | 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: Restore Spike cache - id: cache-spike-restore - uses: actions/cache/restore@v3 - with: - path: | - /opt/spike - /opt/spike/.cache - key: ${{ env.cache_spike_key }} - restore-keys: ${{ env.cache_spike_restore_key }} - - name: Cache Code Restore uses: actions/cache/restore@v3 id: cache-code-restore diff --git a/.github/workflows/test-uarch.yml b/.github/workflows/test-uarch.yml index 1b1f5ca56ba..a6844d6036e 100644 --- a/.github/workflows/test-uarch.yml +++ b/.github/workflows/test-uarch.yml @@ -3,13 +3,11 @@ name: VeeR-EL2 Microarchitectural tests on: workflow_call: -env: - VERILATOR_VERSION: v5.024 - jobs: lint: name: Lint microarchitectural tests runs-on: ubuntu-latest + container: ghcr.io/antmicro/cores-veer-el2:latest steps: - name: Setup repository uses: actions/checkout@v3 @@ -17,6 +15,7 @@ jobs: submodules: recursive - name: Setup environment + shell: bash run: | RV_ROOT=`pwd` echo "RV_ROOT=$RV_ROOT" >> $GITHUB_ENV @@ -26,15 +25,20 @@ jobs: TEST_PATH=$RV_ROOT/verification/block echo "TEST_PATH=$TEST_PATH" >> $GITHUB_ENV - pip3 install nox + python3 -m venv .venv + source .venv/bin/activate + python3 -m pip install nox - name: Lint + shell: bash run: | + source .venv/bin/activate pushd ${TEST_PATH} nox -s test_lint popd tests: name: Microarchitectural tests runs-on: ubuntu-latest + container: ghcr.io/antmicro/cores-veer-el2:latest strategy: matrix: test: @@ -56,7 +60,6 @@ jobs: - "block/lsu_tl" env: CCACHE_DIR: "/opt/verification/.cache/" - VERILATOR_VERSION: v5.024 DEBIAN_FRONTEND: "noninteractive" steps: - name: Setup repository @@ -65,39 +68,27 @@ jobs: submodules: recursive - name: install SiteSpawner package + shell: bash run: | python3 -m venv .venv - .venv/bin/python3 -m pip install tools/SiteSpawner source .venv/bin/activate - echo "PATH=$PATH" >> $GITHUB_ENV python3 -m pip install tools/SiteSpawner + python3 -m pip install meson nox - name: Setup Cache Metadata id: cache_metadata + shell: bash 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 }}_${{ env.VERILATOR_COMMIT }} cache_test_restore_key=uarch_${{ 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 }} - - name: Setup tests cache uses: actions/cache@v3 id: cache-test-setup @@ -125,6 +116,7 @@ jobs: sudo cpanm Bit::Vector - name: Setup environment + shell: bash run: | echo "/opt/verilator/bin" >> $GITHUB_PATH RV_ROOT=`pwd` @@ -143,17 +135,19 @@ jobs: # Fix random generator seed echo "RANDOM_SEED=1377424946" >> $GITHUB_ENV - pip3 install meson nox - - name: Run ${{ matrix.test }} + shell: bash run: | + source .venv/bin/activate pushd ${TEST_PATH} nox -s ${TEST_NAME}_verify popd - name: Prepare coverage data + shell: bash run: | export PATH=/opt/verilator/bin:$PATH + source .venv/bin/activate sis -d convert --dat-dir ${TEST_PATH}/${TEST_NAME}/ mkdir -p results mv ${TEST_PATH}/${TEST_NAME}/*.info results/ diff --git a/.github/workflows/test-uvm.yml b/.github/workflows/test-uvm.yml index dda98a5d8bb..5d089b67d24 100644 --- a/.github/workflows/test-uvm.yml +++ b/.github/workflows/test-uvm.yml @@ -7,10 +7,9 @@ jobs: tests: name: UVM tests runs-on: ubuntu-latest + container: ghcr.io/antmicro/cores-veer-el2:latest env: CCACHE_DIR: "/opt/uvm/.cache/" - VERILATOR_VERSION: uvm - VERILATOR_COMMIT: 7ca2d6470a DEBIAN_FRONTEND: "noninteractive" steps: - name: Setup repository @@ -23,28 +22,14 @@ jobs: 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 }}_${{ env.VERILATOR_COMMIT }} 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 }} - - name: Setup tests cache uses: actions/cache@v3 id: cache-test-setup @@ -62,7 +47,7 @@ jobs: - name: Setup environment run: | - echo "/opt/verilator/bin" >> $GITHUB_PATH + echo "/opt/verilator_uvm/bin" >> $GITHUB_PATH RV_ROOT=`pwd` echo "RV_ROOT=$RV_ROOT" >> $GITHUB_ENV PYTHONUNBUFFERED=1 diff --git a/.github/workflows/test-verification.yml b/.github/workflows/test-verification.yml index 252e2bcd867..e13d95d364b 100644 --- a/.github/workflows/test-verification.yml +++ b/.github/workflows/test-verification.yml @@ -3,21 +3,18 @@ name: VeeR-EL2 verification on: workflow_call: -env: - VERILATOR_VERSION: v5.024 - jobs: tests: name: Verification tests runs-on: ubuntu-latest + container: ghcr.io/antmicro/cores-veer-el2:latest strategy: matrix: test: ["test_pyuvm"] coverage: ["all", "branch", "toggle"] #TODO: add functional coverage env: - CCACHE_DIR: "/opt/verification/.cache/" - VERILATOR_VERSION: v5.024 DEBIAN_FRONTEND: "noninteractive" + CCACHE_DIR: "/opt/regression/.cache/" steps: - name: Setup repository uses: actions/checkout@v3 @@ -25,40 +22,26 @@ jobs: submodules: recursive - name: install SiteSpawner package + shell: bash run: | python3 -m venv .venv - .venv/bin/python3 -m pip install tools/SiteSpawner source .venv/bin/activate - echo "PATH=$PATH" >> $GITHUB_ENV python3 -m pip install tools/SiteSpawner - name: Setup Cache Metadata id: cache_metadata + shell: bash 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 }}_${{ env.VERILATOR_COMMIT }} 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 }} - - name: Setup tests cache uses: actions/cache@v3 id: cache-test-setup @@ -86,6 +69,7 @@ jobs: sudo cpanm Bit::Vector - name: Setup environment + shell: bash run: | echo "/opt/verilator/bin" >> $GITHUB_PATH RV_ROOT=`pwd` @@ -95,11 +79,14 @@ jobs: TEST_PATH=$RV_ROOT/verification/top/${{ matrix.test }} echo "TEST_PATH=$TEST_PATH" >> $GITHUB_ENV + - name: Run ${{ matrix.test }} + shell: bash run: | + source .venv/bin/activate pip3 install meson pip3 install -r $RV_ROOT/verification/top/requirements.txt - PYTEST_STYLE_SRC_DIR=${{ github.workspace }}/.github/scripts/pytest/ + PYTEST_STYLE_SRC_DIR=$RV_ROOT/.github/scripts/pytest/ PYTEST_CSS=${PYTEST_STYLE_SRC_DIR}/css/styles.css HTML_FILE=${{ matrix.test }}_${{ matrix.COVERAGE }}.html pushd ${TEST_PATH} @@ -108,18 +95,22 @@ jobs: popd - name: Prepare pytest-html data + shell: bash run: | - pushd ${{ github.workspace }} + source .venv/bin/activate + pushd $RV_ROOT WEBPAGE_DIR=webpage_${{ matrix.test }}_${{ matrix.COVERAGE }} mkdir -p $WEBPAGE_DIR mv ${TEST_PATH}/${{ matrix.test }}_${{ matrix.COVERAGE }}.html $WEBPAGE_DIR mv ${TEST_PATH}/assets $WEBPAGE_DIR - JS_SCRIPT_DIR=${{ github.workspace }}/.github/scripts/pytest/script + JS_SCRIPT_DIR=$RV_ROOT/.github/scripts/pytest/script mv $JS_SCRIPT_DIR $WEBPAGE_DIR popd - name: Prepare coverage data + shell: bash run: | + source .venv/bin/activate export PATH=/opt/verilator/bin:$PATH sis -d convert --dat-dir ${TEST_PATH} mkdir -p results