Install bazel manually #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CoralNPU RTL | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| tags: | |
| - "*" | |
| branches: | |
| - main | |
| - 98486-add-verilator-simulation | |
| env: | |
| CI_VERILATOR_VERSION: v5.048 | |
| jobs: | |
| build-coralnpu: | |
| runs-on: ubuntu-22.04 | |
| if: false | |
| permissions: | |
| contents: write | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 1 | |
| #ssh-key: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
| - uses: bazel-contrib/setup-bazel@0.15.0 | |
| with: | |
| bazelisk-version: 1.29.0 | |
| # Avoid downloading Bazel every time. bazelisk-cache: true | |
| # Store build cache per workflow. | |
| disk-cache: ${{ github.workflow }} | |
| # Share repository cache between workflows. | |
| repository-cache: true | |
| - name: build | |
| run: bazel build //hdl/chisel/src/coralnpu:rvv_core_mini_axi_cc_library_emit_verilog | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: RvvCoreMiniAxi | |
| path: | | |
| ${{ github.workspace }}/bazel-bin/hdl/chisel/src/coralnpu/RvvCoreMiniAxi.sv | |
| ${{ github.workspace }}/bazel-bin/hdl/chisel/src/coralnpu/RvvCoreMiniAxi.zip | |
| - uses: softprops/action-gh-release@v2 | |
| if: github.ref_type == 'tag' | |
| with: | |
| files: | | |
| ${{ github.workspace }}/bazel-bin/hdl/chisel/src/coralnpu/RvvCoreMiniAxi.sv | |
| ${{ github.workspace }}/bazel-bin/hdl/chisel/src/coralnpu/RvvCoreMiniAxi.zip | |
| build-verilator: | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: write | |
| timeout-minutes: 30 | |
| env: | |
| CI_BUILD_STAGE_NAME: build | |
| CI_RUNS_ON: ubuntu-24.04 | |
| CI_OS_NAME: linux | |
| CI_VERILATOR_INSTALL_DIR: ${{ github.workspace }}/verilator_install | |
| steps: | |
| - name: clone verilator | |
| run: | | |
| git clone https://github.com/verilator/verilator | |
| - name: install dependencies | |
| run: ${{ github.workspace }}/verilator/ci/ci-install.bash | |
| - name: | |
| run: | | |
| pushd ${{ github.workspace }}/verilator | |
| autoconf | |
| ./configure --prefix="${{ env.CI_VERILATOR_INSTALL_DIR }}" | |
| make -j $(nproc) | |
| make install | |
| popd | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: verilator | |
| path: | | |
| ${{ env.CI_VERILATOR_INSTALL_DIR }} | |
| simulate: | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: write | |
| timeout-minutes: 30 | |
| needs: | |
| - build-verilator | |
| env: | |
| CI_BUILD_STAGE_NAME: build | |
| CI_RUNS_ON: ubuntu-24.04 | |
| CI_OS_NAME: linux | |
| CI_VERILATOR_INSTALL_DIR: ${{ github.workspace }}/verilator_install | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 1 | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: verilator | |
| path: ${{ github.workspace }}/verilator_install | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y git gcc autoconf bc bison build-essential ca-certificates ccache clang curl device-tree-compiler flex fuse3 gawk git gnupg mold python-is-python3 python3 python3-full python3-pip python3-pyelftools python3-setuptools python3-venv python3-venv srecord unzip xxd zip openjdk-17-jre wget | |
| - name: Install bazelisk | |
| run: | | |
| wget https://github.com/bazelbuild/bazelisk/releases/download/v1.29.0/bazelisk-amd64.deb | |
| sudo apt-get install -y ./bazelisk-amd64.deb | |
| - name: Clone UVM | |
| run: | | |
| git clone https://github.com/chipsalliance/uvm-verilator.git -b uvm-1.2 | |
| git -C uvm-verilator cherry-pick -n --strategy=recursive -X theirs 5a37baacfed0722b523b05decc9b94fe3e9efbe4 | |
| - name: Generate RTL | |
| run: bazel build //hdl/chisel/src/coralnpu:rvv_core_mini_axi_cc_library_emit_verilog | |
| - name: Run simulation | |
| run: | | |
| chmod +x -R ${{ env.CI_VERILATOR_INSTALL_DIR }}/bin | |
| export PATH=$PATH:${{ github.workspace }}/verilator_install/bin | |
| export UVM=${{ github.workspace }}/uvm-verilator | |
| python3 utils/run_uvm_regression.py --simulator=verilator |