diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39c270a3e..af2f1ffc8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,8 +28,25 @@ jobs: tc-llvm: runs-on: ubuntu-22.04 steps: + - uses: actions/checkout@v6 + - name: Recover the submodule commit hash + id: recover_hash + run: | + git submodule status toolchain/riscv-llvm | cut -d' ' -f1 + echo "tc-llvm-hash=`git submodule status toolchain/riscv-llvm | cut -d' ' -f1`" >> $GITHUB_ENV + - name: Cache the LLVM toolchain + uses: actions/cache@v5 + id: tc-llvm-cache + env: + cache-name: cache-llvm + with: + path: install/riscv-llvm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.tc-llvm-hash }} + restore-keys: + ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.tc-llvm-hash }} # LLVM and GCC installations require plenty of disk space - name: Free Disk Space (Ubuntu) + if: steps.tc-llvm-cache.outputs.cache-hit != 'true' uses: jlumbroso/free-disk-space@main with: # this might remove tools that are actually needed, @@ -44,22 +61,6 @@ jobs: large-packages: true docker-images: true swap-storage: true - - uses: actions/checkout@v4 - - name: Recover the submodule commit hash - id: recover_hash - run: | - git submodule status toolchain/riscv-llvm | cut -d' ' -f1 - echo "tc-llvm-hash=`git submodule status toolchain/riscv-llvm | cut -d' ' -f1`" >> $GITHUB_ENV - - name: Cache the LLVM toolchain - uses: actions/cache@v4 - id: tc-llvm-cache - env: - cache-name: cache-llvm - with: - path: install/riscv-llvm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.tc-llvm-hash }} - restore-keys: - ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.tc-llvm-hash }} - name: Download the LLVM toolchain if: steps.tc-llvm-cache.outputs.cache-hit != 'true' run: git submodule update --init --recursive --checkout -- toolchain/riscv-llvm @@ -75,7 +76,7 @@ jobs: - name: Tar LLVM run: tar -cvf tc-llvm.tar install/riscv-llvm - name: Upload LLVM - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: tc-llvm path: tc-llvm.tar @@ -83,8 +84,25 @@ jobs: tc-gcc: runs-on: ubuntu-22.04 steps: + - uses: actions/checkout@v6 + - name: Recover the submodule commit hash + id: recover_hash + run: | + git submodule status toolchain/riscv-gnu-toolchain | cut -d' ' -f1 + echo "tc-gcc-hash=`git submodule status toolchain/riscv-gnu-toolchain | cut -d' ' -f1`" >> $GITHUB_ENV + - name: Cache the GCC toolchain + uses: actions/cache@v5 + id: tc-gcc-cache + env: + cache-name: cache-gcc + with: + path: install/riscv-gcc + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.tc-gcc-hash }} + restore-keys: + ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.tc-gcc-hash }} # LLVM and GCC installations require plenty of disk space - name: Free Disk Space (Ubuntu) + if: steps.tc-gcc-cache.outputs.cache-hit != 'true' uses: jlumbroso/free-disk-space@main with: # this might remove tools that are actually needed, @@ -99,22 +117,6 @@ jobs: large-packages: true docker-images: true swap-storage: true - - uses: actions/checkout@v4 - - name: Recover the submodule commit hash - id: recover_hash - run: | - git submodule status toolchain/riscv-gnu-toolchain | cut -d' ' -f1 - echo "tc-gcc-hash=`git submodule status toolchain/riscv-gnu-toolchain | cut -d' ' -f1`" >> $GITHUB_ENV - - name: Cache the GCC toolchain - uses: actions/cache@v4 - id: tc-gcc-cache - env: - cache-name: cache-gcc - with: - path: install/riscv-gcc - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.tc-gcc-hash }} - restore-keys: - ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.tc-gcc-hash }} - name: Download the GCC toolchain if: steps.tc-gcc-cache.outputs.cache-hit != 'true' run: git submodule update --init --recursive --checkout -- toolchain/riscv-gnu-toolchain @@ -126,7 +128,7 @@ jobs: - name: Tar GCC run: tar -cvf tc-gcc.tar install/riscv-gcc - name: Upload GCC - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: tc-gcc path: tc-gcc.tar @@ -134,14 +136,14 @@ jobs: tc-isa-sim: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Recover the submodule commit hash id: recover_hash run: | git submodule status toolchain/riscv-isa-sim | cut -d' ' -f1 echo "tc-isa-sim-hash=`git submodule status toolchain/riscv-isa-sim | cut -d' ' -f1`" >> $GITHUB_ENV - name: Cache Spike - uses: actions/cache@v4 + uses: actions/cache@v5 id: tc-isa-sim-cache env: cache-name: cache-spike @@ -161,7 +163,7 @@ jobs: - name: Tar Spike run: tar -cvf tc-isa-sim.tar install/riscv-isa-sim - name: Upload Spike - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: tc-isa-sim path: tc-isa-sim.tar @@ -169,14 +171,14 @@ jobs: tc-verilator: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Recover the submodule commit hash id: recover_hash run: | git submodule status toolchain/verilator | cut -d' ' -f1 echo "tc-verilator-hash=`git submodule status toolchain/verilator | cut -d' ' -f1`" >> $GITHUB_ENV - name: Cache Verilator - uses: actions/cache@v4 + uses: actions/cache@v5 id: tc-verilator-cache env: cache-name: cache-verilator @@ -197,7 +199,7 @@ jobs: - name: Tar Verilator run: tar -cvf tc-verilator.tar install/verilator - name: Upload Verilator - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: tc-verilator path: tc-verilator.tar @@ -214,8 +216,8 @@ jobs: ara_config: [2_lanes, 4_lanes, 8_lanes, 16_lanes] needs: tc-llvm steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 with: python-version: 3.12.0 - name: Install Python requirements @@ -225,7 +227,7 @@ jobs: git submodule update --init --recursive -- toolchain/riscv-isa-sim git submodule foreach --recursive git reset --hard - name: Download the LLVM toolchain - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: tc-llvm - name: Untar LLVM @@ -233,7 +235,7 @@ jobs: - name: Compile applications run: config=${{ matrix.ara_config }} make -C apps - name: Upload applications - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: compile-apps-${{ matrix.ara_config }} path: apps/bin @@ -246,25 +248,25 @@ jobs: ara_config: [2_lanes, 4_lanes, 8_lanes, 16_lanes] needs: ["tc-llvm", "tc-gcc", "tc-isa-sim"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Download Spike run: | git submodule update --init --recursive -- toolchain/riscv-isa-sim git submodule foreach --recursive git reset --hard - name: Get Spike artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: tc-isa-sim - name: Untar Spike run: tar xvf tc-isa-sim.tar - name: Get LLVM toolchain artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: tc-llvm - name: Untar LLVM run: tar xvf tc-llvm.tar - name: Get GCC toolchain artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: tc-gcc - name: Untar GCC @@ -272,7 +274,7 @@ jobs: - name: Compile applications run: config=${{ matrix.ara_config }} make -C apps riscv_tests - name: Upload applications - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: compile-riscv-tests-${{ matrix.ara_config }} path: apps/bin @@ -285,29 +287,23 @@ jobs: ara_config: [2_lanes, 4_lanes, 8_lanes, 16_lanes] needs: ["tc-verilator", "tc-isa-sim"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Download Spike run: | git submodule update --init --recursive -- toolchain/riscv-isa-sim git submodule foreach --recursive git reset --hard - name: Get Spike artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: tc-isa-sim - name: Untar Spike run: tar xvf tc-isa-sim.tar - name: Get Verilator artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: tc-verilator - name: Untar Verilator run: tar xvf tc-verilator.tar - - name: Set the Verilator root directory - run: | - echo VERILATOR_ROOT="$GITHUB_WORKSPACE/install/verilator" >> $GITHUB_ENV - VERILATOR_ROOT="$GITHUB_WORKSPACE/install/verilator" - ln -s $VERILATOR_ROOT/share/verilator/include $VERILATOR_ROOT/include - ln -s $VERILATOR_ROOT/share/verilator/bin/verilator_includer $VERILATOR_ROOT/bin/verilator_includer - name: Download RTL submodules run: make -C hardware checkout - name: Compile Verilated model of Ara @@ -318,7 +314,7 @@ jobs: - name: Tar Verilated model of Ara run: tar -cvf ara.tar hardware/build/verilator hardware/bender - name: Upload Ara Verilated model - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: compile-ara-${{ matrix.ara_config }} path: ara.tar @@ -336,21 +332,21 @@ jobs: ara_config: [2_lanes, 4_lanes, 8_lanes, 16_lanes] needs: ["compile-ara", "compile-apps"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Get Spike artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: tc-isa-sim - name: Untar Spike run: tar xvf tc-isa-sim.tar - name: Get Verilated model of Ara - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: compile-ara-${{ matrix.ara_config }} - name: Untar Verilated model of Ara run: tar xvf ara.tar - name: Get applications - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: compile-apps-${{ matrix.ara_config }} path: apps/bin @@ -369,21 +365,21 @@ jobs: ara_config: [2_lanes, 4_lanes, 8_lanes, 16_lanes] needs: ["compile-ara", "compile-riscv-tests"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Get Spike artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: tc-isa-sim - name: Untar Spike run: tar xvf tc-isa-sim.tar - name: Get Verilated model of Ara - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: compile-ara-${{ matrix.ara_config }} - name: Untar Verilated model of Ara run: tar xvf ara.tar - name: Get RISC-V tests - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: compile-riscv-tests-${{ matrix.ara_config }} path: apps/bin @@ -394,21 +390,21 @@ jobs: runs-on: ubuntu-22.04 needs: ["tc-isa-sim", "compile-riscv-tests"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Get Spike artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: tc-isa-sim - name: Untar Spike run: tar xvf tc-isa-sim.tar - name: Download the LLVM toolchain - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: tc-llvm - name: Untar LLVM run: tar xvf tc-llvm.tar - name: Download the GCC toolchain - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: tc-gcc - name: Untar GCC @@ -418,7 +414,7 @@ jobs: make -C apps/riscv-tests/isa clean make -C apps riscv_tests_spike - name: Upload dumps - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: riscv-tests-spike path: | @@ -432,8 +428,8 @@ jobs: check-license: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 with: python-version: 3.12.0 - name: Install Python requirements @@ -445,14 +441,14 @@ jobs: runs-on: ubuntu-22.04 needs: ['tc-llvm'] steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 with: python-version: 3.12.0 - name: Install Python requirements run: pip install -r python-requirements.txt - name: Download the LLVM toolchain - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: tc-llvm - name: Untar LLVM @@ -470,7 +466,7 @@ jobs: check-trailing-whitespaces: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 - name: Determine base commit @@ -503,26 +499,26 @@ jobs: ara_config: [2_lanes, 4_lanes, 8_lanes, 16_lanes] needs: ["compile-ara", "compile-apps"] steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 with: python-version: 3.12.0 - name: Install Python requirements run: pip install -r python-requirements.txt - name: Download the LLVM toolchain - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: tc-llvm - name: Untar LLVM run: tar xvf tc-llvm.tar - name: Get Spike artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: tc-isa-sim - name: Untar Spike run: tar xvf tc-isa-sim.tar - name: Get Verilated model of Ara - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: compile-ara-${{ matrix.ara_config }} - name: Untar Verilated model of Ara @@ -537,12 +533,12 @@ jobs: run: | tar -cvf benchmarks-${{ matrix.ara_config }}.tar *.benchmark - name: Upload [f]dotproduct runtime results - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: dotproducts-${{ matrix.ara_config }} path: dotproducts-${{ matrix.ara_config }}.tar - name: Upload runtime results - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: benchmark-${{ matrix.ara_config }} path: benchmarks-${{ matrix.ara_config }}.tar @@ -551,43 +547,43 @@ jobs: runs-on: ubuntu-22.04 needs: benchmark steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 with: python-version: 3.12.0 - name: Install Python requirements run: pip install -r python-requirements.txt - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Get [f]dotproduct results (2 lanes) - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: dotproducts-2_lanes - name: Get [f]dotproduct results (4 lanes) - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: dotproducts-4_lanes - name: Get [f]dotproduct results (8 lanes) - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: dotproducts-8_lanes - name: Get [f]dotproduct results (16 lanes) - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: dotproducts-16_lanes - name: Get benchmark results (2 lanes) - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: benchmark-2_lanes - name: Get benchmark results (4 lanes) - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: benchmark-4_lanes - name: Get benchmark results (8 lanes) - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: benchmark-8_lanes - name: Get benchmark results (16 lanes) - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: benchmark-16_lanes - name: Untar the [f]dotproduct results @@ -619,82 +615,82 @@ jobs: - name: Plot the rooflines run: gnuplot -c scripts/benchmark.gnuplot - name: Upload the imatmul roofline - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: imatmul_roofline path: imatmul.png - name: Upload the fmatmul roofline - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: fmatmul_roofline path: fmatmul.png - name: Upload the iconv2d roofline - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: iconv2d_roofline path: iconv2d.png - name: Upload the fconv2d roofline - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: fconv2d_roofline path: fconv2d.png - name: Upload the fconv3d roofline - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: fconv3d_roofline path: fconv3d.png - name: Upload the jacobi2d roofline - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: jacobi2d_roofline path: jacobi2d.png - name: Upload the dropout roofline - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: dropout_roofline path: dropout.png - name: Upload the fft roofline - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: fft_roofline path: fft.png - name: Upload the dwt roofline - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: dwt_roofline path: dwt.png - name: Upload the exp roofline - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: exp_roofline path: exp.png - name: Upload the softmax roofline - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: softmax_roofline path: softmax.png - name: Upload the fdotproduct roofline - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: fdotproduct_plots path: fdotproduct.tar - name: Upload the dotproduct roofline - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: dotproduct_plots path: dotproduct.tar - name: Upload the pathfinder roofline - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: pathfinder_roofline path: pathfinder.png - name: Upload the roi_align roofline - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: roi_align_roofline path: roi_align.png - name: Upload the lavamd roofline - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: lavamd_roofline path: lavamd.png @@ -708,9 +704,9 @@ jobs: if: always() needs: ["simulate", "riscv-tests-spike", "riscv-tests-simv"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Delete artifacts - uses: geekyeggo/delete-artifact@v5 + uses: geekyeggo/delete-artifact@v6 with: name: | tc-llvm @@ -728,9 +724,9 @@ jobs: if: always() needs: ["simulate", "riscv-tests-spike", "riscv-tests-simv"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Delete artifacts - uses: geekyeggo/delete-artifact@v5 + uses: geekyeggo/delete-artifact@v6 with: name: | compile-ara-${{ matrix.ara_config }} diff --git a/Makefile b/Makefile index 48fe43753..71a3218d7 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ LLVM_INSTALL_DIR ?= ${INSTALL_DIR}/riscv-llvm ISA_SIM_INSTALL_DIR ?= ${INSTALL_DIR}/riscv-isa-sim ISA_SIM_MOD_INSTALL_DIR ?= ${INSTALL_DIR}/riscv-isa-sim-mod VERIL_INSTALL_DIR ?= ${INSTALL_DIR}/verilator -VERIL_VERSION ?= v5.012 +VERIL_VERSION ?= 06263ec724e7bf1fb0a0366b3aec54cd431c51d6 DTC_COMMIT ?= b6910bec11614980a21e46fbccc35934b671bd81 CMAKE ?= cmake diff --git a/hardware/Makefile b/hardware/Makefile index 5c2b23343..5b8ad663a 100644 --- a/hardware/Makefile +++ b/hardware/Makefile @@ -190,7 +190,7 @@ $(veril_library)/V$(veril_top): $(config_file) Makefile ../Bender.yml $(shell fi -GNrLanes=$(nr_lanes) \ -GVLEN=$(vlen) \ -O3 \ - --hierarchical \ + $(if $(trace),,--hierarchical) \ -Wno-fatal \ -Wno-PINCONNECTEMPTY \ -Wno-BLKANDNBLK \ diff --git a/patches/0002-riscv-isa-sim-patch b/patches/0002-riscv-isa-sim-patch deleted file mode 100644 index d191904ca..000000000 --- a/patches/0002-riscv-isa-sim-patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/riscv/processor.cc b/riscv/processor.cc -index c56819a..a7ebd30 100644 ---- a/riscv/processor.cc -+++ b/riscv/processor.cc -@@ -381,8 +381,8 @@ reg_t processor_t::vectorUnit_t::set_vl(int rd, int rs1, reg_t reqVL, reg_t newT - int new_vlmul = 0; - if (vtype != newType){ - vtype = newType; -- vsew = 1 << (extract64(newType, 3, 3) + 3); -- new_vlmul = int8_t(extract64(newType, 0, 3) << 5) >> 5; -+ vsew = 1 << (extract64(newType, 2, 3) + 3); -+ new_vlmul = int8_t(((extract64(newType, 5, 1) << 2) + extract64(newType, 0, 2)) << 5) >> 5; - vflmul = new_vlmul >= 0 ? 1 << new_vlmul : 1.0 / (1 << -new_vlmul); - vlmax = (VLEN/vsew) * vflmul; - vta = extract64(newType, 6, 1); diff --git a/toolchain/verilator b/toolchain/verilator index 651f22338..06263ec72 160000 --- a/toolchain/verilator +++ b/toolchain/verilator @@ -1 +1 @@ -Subproject commit 651f2233876cc2c6b7fce5d19ee186042cad0081 +Subproject commit 06263ec724e7bf1fb0a0366b3aec54cd431c51d6