From ac99545aa79f8d3649fc1433e11b882e6d576693 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 29 Aug 2024 15:29:33 +0200 Subject: [PATCH 001/130] py: Consolidate python requirements into `pyproject.toml` file --- iis-setup.sh | 10 ++++---- pyproject.toml | 48 +++++++++++++++++++++++++++++++++++++-- util/container/Dockerfile | 5 +--- 3 files changed, 51 insertions(+), 12 deletions(-) diff --git a/iis-setup.sh b/iis-setup.sh index e4cde0480..ad348be21 100755 --- a/iis-setup.sh +++ b/iis-setup.sh @@ -15,12 +15,10 @@ export LLVM_BINROOT=/usr/pack/riscv-1.0-kgf/pulp-llvm-0.12.0/bin # Create Python virtual environment with required packages /usr/local/anaconda3-2022.05/bin/python3 -m venv .venv source .venv/bin/activate -# Unpack packages in a local temporary directory which can be safely cleaned -# after installation. Also protects against "No space left on device" errors +# Install local packages in editable mode and unpack packages in a +# local temporary directory which can be safely cleaned after installation. +# Also protects against "No space left on device" errors # occurring when the /tmp folder is filled by other processes. mkdir tmp -TMPDIR=tmp pip install -r python-requirements.txt +TMPDIR=tmp pip install -e . rm -rf tmp - -# Install local packages in editable mode. -pip install -e . diff --git a/pyproject.toml b/pyproject.toml index 9e1fc9597..d943b57dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ # SPDX-License-Identifier: SHL-0.51 [build-system] -requires = ["setuptools>=42"] +requires = ["setuptools>=64"] build-backend = "setuptools.build_meta" [project] @@ -12,8 +12,52 @@ authors = [ {name = "Luca Colagrande", email = "colluca@iis.ee.ethz.ch"} ] dynamic = ["version"] +dependencies = [ + # Keep sorted. + # General dependencies. + "bin2coe", + "dataclasses", + "editorconfig-checker==2.3.51", + "flake8", + "gitpython", + "hjson", + "humanize", + "json5", + "jsonref", + "jsonschema", + "mako", + "matplotlib", + "mkdocs-material", + "pandas", + "prettytable", + "progressbar2", + "psutil", + "pyelftools", + "pyflexfloat", + "pytablewriter", + "pytest", + "pyyaml", + "scikit-learn", + "tabulate", + "termcolor", + "yamllint", + # DNN lib dependencies. + "numpy", + "torch", + "json5" +] + +[project.optional-dependencies] +docs = [ + "mkdocs", + "mkdocs-material", + "mkdocs-include-markdown-plugin", + "mkdocs-macros-plugin", + "mkdocstrings", + "mkdocstrings-python", +] [tool.setuptools.package-dir] "snitch.dnn" = "sw/dnn" "snitch.blas" = "sw/blas" -"snitch.util" = "util" \ No newline at end of file +"snitch.util" = "util" diff --git a/util/container/Dockerfile b/util/container/Dockerfile index bfef21266..2ae3e89b0 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -162,10 +162,7 @@ ENV VIRTUAL_ENV "/root/.venvs/snitch_cluster" RUN /opt/python/bin/python3 -m venv ${VIRTUAL_ENV} ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" # Install Python requirements -COPY python-requirements.txt /tmp/python-requirements.txt -COPY docs/requirements.txt /tmp/docs/requirements.txt -COPY sw/dnn/requirements.txt /tmp/sw/dnn/requirements.txt -RUN pip install -r /tmp/python-requirements.txt +RUN pip install .[docs] # Add Verilator to PATH ENV PATH "/tools/verilator/bin:${PATH}" From 9eb222a989519ccdaac22ec11a86c3876a5df8cc Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 29 Aug 2024 15:31:36 +0200 Subject: [PATCH 002/130] py: Remove previous requirement files --- docs/requirements.txt | 11 ----------- python-requirements.txt | 34 ---------------------------------- sw/dnn/requirements.txt | 7 ------- 3 files changed, 52 deletions(-) delete mode 100644 docs/requirements.txt delete mode 100644 python-requirements.txt delete mode 100644 sw/dnn/requirements.txt diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index e913931e3..000000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright 2020 ETH Zurich and University of Bologna. -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# SPDX-License-Identifier: Apache-2.0 - -# Keep sorted. -mkdocs -mkdocs-material -mkdocs-include-markdown-plugin -mkdocs-macros-plugin -mkdocstrings -mkdocstrings-python diff --git a/python-requirements.txt b/python-requirements.txt deleted file mode 100644 index d9a7d89a9..000000000 --- a/python-requirements.txt +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2020 ETH Zurich and University of Bologna. -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# SPDX-License-Identifier: Apache-2.0 - -# Keep sorted. -bin2coe -dataclasses -editorconfig-checker==2.3.51 -flake8 -gitpython -hjson -humanize -json5 -jsonref -jsonschema -mako -matplotlib -mkdocs-material -pandas -prettytable -progressbar2 -psutil -pyelftools -pyflexfloat -pytablewriter -pytest -pyyaml -scikit-learn -tabulate -termcolor -yamllint - --r docs/requirements.txt --r sw/dnn/requirements.txt diff --git a/sw/dnn/requirements.txt b/sw/dnn/requirements.txt deleted file mode 100644 index c42e8ddf8..000000000 --- a/sw/dnn/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright 2022 ETH Zurich and University of Bologna. -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# SPDX-License-Identifier: Apache-2.0 - -numpy -torch -json5 From ae5aad937a1d50b92ebf8cdf79611f312174e20a Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 29 Aug 2024 15:45:12 +0200 Subject: [PATCH 003/130] ci: Remove doc generation in internal CI --- .gitlab-ci.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 656558761..492045b22 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,14 +16,6 @@ variables: before_script: source iis-setup.sh -############## -# Build docs # -############## - -docs: - script: - - make docs - ##################### # Python unit tests # ##################### From c0f2809dea0f8bad90b2bd7608eaf628210f01cb Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 29 Aug 2024 18:42:06 +0200 Subject: [PATCH 004/130] docs: Update guide --- docs/ug/documentation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ug/documentation.md b/docs/ug/documentation.md index de61ab105..a8e0147d4 100644 --- a/docs/ug/documentation.md +++ b/docs/ug/documentation.md @@ -7,7 +7,7 @@ theme](https://squidfunk.github.io/mkdocs-material/). Before building the documentation, make sure you have the required dependencies installed: ```shell -pip install -r docs/requirements.txt +pip install .[docs] ``` After everything is installed, you can build a static copy of the `html` documentation by From 1a3e2f3172d2b6d030084ea8932b758379cae05f Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 29 Aug 2024 23:11:52 +0200 Subject: [PATCH 005/130] container: Copy `pyproject.toml` --- util/container/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 2ae3e89b0..230774b04 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -162,6 +162,7 @@ ENV VIRTUAL_ENV "/root/.venvs/snitch_cluster" RUN /opt/python/bin/python3 -m venv ${VIRTUAL_ENV} ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" # Install Python requirements +COPY pyproject.toml . RUN pip install .[docs] # Add Verilator to PATH From ca2bf6f4df389b5ed49e48c99f5ad4e0ae175dbe Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Fri, 30 Aug 2024 07:54:33 +0200 Subject: [PATCH 006/130] container: Only install dependencies --- util/container/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 230774b04..11bfd4ac7 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -162,8 +162,10 @@ ENV VIRTUAL_ENV "/root/.venvs/snitch_cluster" RUN /opt/python/bin/python3 -m venv ${VIRTUAL_ENV} ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" # Install Python requirements -COPY pyproject.toml . -RUN pip install .[docs] +COPY pyproject.toml /tmp/pyproject.toml +RUN pip install pip-tools +RUN pip-compile --extra docs -o /tmp/requirements.txt /tmp/pyproject.toml +RUN pip install -r /tmp/requirements.txt # Add Verilator to PATH ENV PATH "/tools/verilator/bin:${PATH}" From 5172c76d9884a876883b03c5202e908561f8f992 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Fri, 30 Aug 2024 09:19:12 +0200 Subject: [PATCH 007/130] container: Get rid of deprecated `spike-dasm` --- util/container/Dockerfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 11bfd4ac7..6ccf34d22 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -87,10 +87,6 @@ RUN cargo install --path /tmp/banshee RUN wget https://github.com/pulp-platform/bender/releases/download/v${BENDER_VERSION}/bender-${BENDER_VERSION}-x86_64-linux-gnu-ubuntu18.04.tar.gz RUN tar xzf bender-${BENDER_VERSION}-x86_64-linux-gnu-ubuntu18.04.tar.gz -# Install spike-dasm -RUN wget https://github.com/pulp-platform/riscv-isa-sim/releases/download/snitch-v${SPIKE_DASM_VERSION}/snitch-spike-dasm-${SPIKE_DASM_VERSION}-x86_64-linux-gnu-ubuntu18.04.tar.gz -RUN tar xzf snitch-spike-dasm-${SPIKE_DASM_VERSION}-x86_64-linux-gnu-ubuntu18.04.tar.gz - # Install Doxygen RUN wget https://www.doxygen.nl/files/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz RUN tar xzf doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz @@ -151,7 +147,6 @@ RUN apt-get update && apt-get install software-properties-common -y && \ # Copy artifacts from stage 1. COPY --from=builder /tools/bender bin/ -COPY --from=builder /tools/spike-dasm bin/ COPY --from=builder /root/.cargo/bin/banshee bin/ COPY --from=builder /opt/python /opt/python COPY --from=builder /tools/verilator /tools/verilator/ From ebf36c5dcee6a103f561c9dca452c080e64acac4 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Fri, 30 Aug 2024 11:55:12 +0200 Subject: [PATCH 008/130] container: Update actions --- .github/workflows/build-docker.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 5c073ab5d..ef264c89e 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -25,16 +25,16 @@ jobs: - name: Disk usage after freeing up space run: df -h # Actually build the Docker container - - uses: actions/checkout@v2 - - uses: docker/setup-buildx-action@v1 + - uses: actions/checkout@v4 + - uses: docker/setup-buildx-action@v3 - name: GHCR Log-in - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v6 with: context: . file: util/container/Dockerfile From 52614932fb61f6e4e371ba1deb105bea185f4cca Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Fri, 30 Aug 2024 11:55:22 +0200 Subject: [PATCH 009/130] container: Copy necessary sources --- util/container/Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 6ccf34d22..0e80812b9 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -157,10 +157,11 @@ ENV VIRTUAL_ENV "/root/.venvs/snitch_cluster" RUN /opt/python/bin/python3 -m venv ${VIRTUAL_ENV} ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" # Install Python requirements -COPY pyproject.toml /tmp/pyproject.toml -RUN pip install pip-tools -RUN pip-compile --extra docs -o /tmp/requirements.txt /tmp/pyproject.toml -RUN pip install -r /tmp/requirements.txt +COPY pyproject.toml . +COPY sw/dnn ./sw/dnn +COPY sw/blas ./sw/blas +COPY util ./util +RUN pip install -e . # Add Verilator to PATH ENV PATH "/tools/verilator/bin:${PATH}" From 40a87835c5eeaeb6d9a9421a60e4ac75541bc36a Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Fri, 30 Aug 2024 12:32:05 +0200 Subject: [PATCH 010/130] container: Fix minor warnings --- util/container/Dockerfile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 0e80812b9..56d3624af 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -55,7 +55,7 @@ RUN cd Python-${PYTHON_VERSION} && \ # Build Rust tools RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -ENV PATH "/root/.cargo/bin:${PATH}" +ENV PATH="/root/.cargo/bin:${PATH}" RUN rustup install 1.70.0 RUN rustup override set 1.70.0 @@ -75,7 +75,7 @@ WORKDIR /tools RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz && \ tar -x -f cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz --strip-components=1 -C . && \ rm -rf cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz -ENV PATH "/tools/bin:${PATH}" +ENV PATH="/tools/bin:${PATH}" # Install `banshee` (needs cmake) RUN rustup install 1.67.0 @@ -100,7 +100,7 @@ ARG VERIBLE_VERSION=0.0-3318-g8d254167 LABEL version="0.1" LABEL description="Snitch container for hardware and software development." LABEL maintainer="zarubaf@iis.ee.ethz.ch" -LABEL org.opencontainers.image.source https://github.com/pulp-platform/snitch_cluster +LABEL org.opencontainers.image.source=https://github.com/pulp-platform/snitch_cluster WORKDIR /tools @@ -131,13 +131,13 @@ RUN latest_tag=`curl -s -H "Accept: application/vnd.github.v3+json" https://api. echo "SNITCH_LLVM_VERSION=${SNITCH_LLVM_VERSION} LLVM_TAR=${LLVM_TAR} latest_tag=${latest_tag}" && \ wget -qO- https://github.com/pulp-platform/llvm-project/releases/download/${SNITCH_LLVM_VERSION}/${LLVM_TAR} | \ tar xvz --strip-components=1 -C riscv-llvm -ENV LLVM_BINROOT "/tools/riscv-llvm/bin" +ENV LLVM_BINROOT="/tools/riscv-llvm/bin" # Install Verible RUN wget https://github.com/chipsalliance/verible/releases/download/v${VERIBLE_VERSION}/verible-v${VERIBLE_VERSION}-linux-static-x86_64.tar.gz && \ tar -x -f verible-v${VERIBLE_VERSION}-linux-static-x86_64.tar.gz --strip-components=1 -C . && \ rm -rf verible-v${VERIBLE_VERSION}-linux-static-x86_64.tar.gz -ENV PATH "/tools/bin:${PATH}" +ENV PATH="/tools/bin:${PATH}" # Install git>=2.18, required by Github checkout action to recurse submodules RUN apt-get update && apt-get install software-properties-common -y && \ @@ -153,7 +153,7 @@ COPY --from=builder /tools/verilator /tools/verilator/ COPY --from=builder /tools/doxygen/bin/doxygen bin/ # Create and activate virtual environment -ENV VIRTUAL_ENV "/root/.venvs/snitch_cluster" +ENV VIRTUAL_ENV="/root/.venvs/snitch_cluster" RUN /opt/python/bin/python3 -m venv ${VIRTUAL_ENV} ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" # Install Python requirements @@ -164,10 +164,10 @@ COPY util ./util RUN pip install -e . # Add Verilator to PATH -ENV PATH "/tools/verilator/bin:${PATH}" -ENV VLT_ROOT "/tools/verilator/share/verilator/" +ENV PATH="/tools/verilator/bin:${PATH}" +ENV VLT_ROOT="/tools/verilator/share/verilator/" # Set locale to UTF-8, required because Python 3.6 defaults on ASCII encoding. # See https://click.palletsprojects.com/en/8.1.x/unicode-support/ -ENV LC_ALL "C.UTF-8" -ENV LANG "C.UTF-8" +ENV LC_ALL="C.UTF-8" +ENV LANG="C.UTF-8" From 6f9d7e47a386d97068e9a1c721f8f212fed47820 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Fri, 30 Aug 2024 12:34:18 +0200 Subject: [PATCH 011/130] REVERT: Use custom container --- .github/workflows/ci.yml | 8 ++++---- .github/workflows/lint.yml | 2 +- .github/workflows/publish-docs.yml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b486b231..83358381b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: name: Build documentation runs-on: ubuntu-22.04 container: - image: ghcr.io/pulp-platform/snitch_cluster:main + image: ghcr.io/pulp-platform/snitch_cluster:pyproject steps: - uses: actions/checkout@v2 - name: Build docs @@ -29,7 +29,7 @@ jobs: name: Python unit tests runs-on: ubuntu-22.04 container: - image: ghcr.io/pulp-platform/snitch_cluster:main + image: ghcr.io/pulp-platform/snitch_cluster:pyproject steps: - uses: actions/checkout@v2 - name: Run pytest @@ -43,7 +43,7 @@ jobs: name: Simulate SW on Snitch Cluster w/ Verilator runs-on: ubuntu-22.04 container: - image: ghcr.io/pulp-platform/snitch_cluster:main + image: ghcr.io/pulp-platform/snitch_cluster:pyproject steps: - uses: actions/checkout@v2 with: @@ -77,7 +77,7 @@ jobs: name: Simulate SW on Snitch Cluster w/ Banshee runs-on: ubuntu-22.04 container: - image: ghcr.io/pulp-platform/snitch_cluster:main + image: ghcr.io/pulp-platform/snitch_cluster:pyproject steps: - uses: actions/checkout@v2 with: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a2ab4fabc..d003a2fa1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -43,7 +43,7 @@ jobs: name: Check Sources Up-to-Date runs-on: ubuntu-22.04 container: - image: ghcr.io/pulp-platform/snitch_cluster:main + image: ghcr.io/pulp-platform/snitch_cluster:pyproject steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 23a53bf4a..99dd304e1 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -11,7 +11,7 @@ jobs: name: Deploy documentation runs-on: ubuntu-22.04 container: - image: ghcr.io/pulp-platform/snitch_cluster:main + image: ghcr.io/pulp-platform/snitch_cluster:pyproject steps: - uses: actions/checkout@v2 # For some reason, the checkout is done by a different user, From 290193a7683a8adeba434006833f2a803e7720a9 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Fri, 30 Aug 2024 13:41:21 +0200 Subject: [PATCH 012/130] container: Install `docs` dependencies --- util/container/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 56d3624af..4a7120954 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -161,8 +161,7 @@ COPY pyproject.toml . COPY sw/dnn ./sw/dnn COPY sw/blas ./sw/blas COPY util ./util -RUN pip install -e . - +RUN pip install .[docs] # Add Verilator to PATH ENV PATH="/tools/verilator/bin:${PATH}" ENV VLT_ROOT="/tools/verilator/share/verilator/" From c3892d64e2510d0b7386311f054ac3dc2964bb3c Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Fri, 30 Aug 2024 16:58:13 +0200 Subject: [PATCH 013/130] py: Merge dependencies --- docs/ug/documentation.md | 2 +- pyproject.toml | 22 +++++++--------------- util/container/Dockerfile | 2 +- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/docs/ug/documentation.md b/docs/ug/documentation.md index a8e0147d4..24467bc24 100644 --- a/docs/ug/documentation.md +++ b/docs/ug/documentation.md @@ -7,7 +7,7 @@ theme](https://squidfunk.github.io/mkdocs-material/). Before building the documentation, make sure you have the required dependencies installed: ```shell -pip install .[docs] +pip install . ``` After everything is installed, you can build a static copy of the `html` documentation by diff --git a/pyproject.toml b/pyproject.toml index d943b57dc..6488077b3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,6 @@ authors = [ dynamic = ["version"] dependencies = [ # Keep sorted. - # General dependencies. "bin2coe", "dataclasses", "editorconfig-checker==2.3.51", @@ -27,7 +26,13 @@ dependencies = [ "jsonschema", "mako", "matplotlib", + "mkdocs", "mkdocs-material", + "mkdocs-include-markdown-plugin", + "mkdocs-macros-plugin", + "mkdocstrings", + "mkdocstrings-python", + "numpy", "pandas", "prettytable", "progressbar2", @@ -40,21 +45,8 @@ dependencies = [ "scikit-learn", "tabulate", "termcolor", - "yamllint", - # DNN lib dependencies. - "numpy", "torch", - "json5" -] - -[project.optional-dependencies] -docs = [ - "mkdocs", - "mkdocs-material", - "mkdocs-include-markdown-plugin", - "mkdocs-macros-plugin", - "mkdocstrings", - "mkdocstrings-python", + "yamllint" ] [tool.setuptools.package-dir] diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 4a7120954..ab39f86c6 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -161,7 +161,7 @@ COPY pyproject.toml . COPY sw/dnn ./sw/dnn COPY sw/blas ./sw/blas COPY util ./util -RUN pip install .[docs] +RUN pip install . # Add Verilator to PATH ENV PATH="/tools/verilator/bin:${PATH}" ENV VLT_ROOT="/tools/verilator/share/verilator/" From 6993529bb6bf62c2e2be6634baaa7d34dabe6a74 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Fri, 30 Aug 2024 16:58:33 +0200 Subject: [PATCH 014/130] Revert "ci: Remove doc generation in internal CI" This reverts commit ae5aad937a1d50b92ebf8cdf79611f312174e20a. --- .gitlab-ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 492045b22..656558761 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,6 +16,14 @@ variables: before_script: source iis-setup.sh +############## +# Build docs # +############## + +docs: + script: + - make docs + ##################### # Python unit tests # ##################### From f68307daff8ab03cecf516b050a1bfebbfca0af3 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 10:42:51 +0200 Subject: [PATCH 015/130] ci: Don't run CI on draft PRs (twice) --- .github/workflows/ci.yml | 10 +++++++++- .github/workflows/gitlab-ci.yaml | 1 + .github/workflows/lint.yml | 8 ++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83358381b..b57013070 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,11 @@ # Run functional regression checks name: ci -on: [push, pull_request] +on: + push: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + jobs: ######## @@ -14,6 +18,7 @@ jobs: docs: name: Build documentation runs-on: ubuntu-22.04 + if: github.event.pull_request.draft == false container: image: ghcr.io/pulp-platform/snitch_cluster:pyproject steps: @@ -28,6 +33,7 @@ jobs: pytest: name: Python unit tests runs-on: ubuntu-22.04 + if: github.event.pull_request.draft == false container: image: ghcr.io/pulp-platform/snitch_cluster:pyproject steps: @@ -42,6 +48,7 @@ jobs: sw-snitch-cluster-vlt: name: Simulate SW on Snitch Cluster w/ Verilator runs-on: ubuntu-22.04 + if: github.event.pull_request.draft == false container: image: ghcr.io/pulp-platform/snitch_cluster:pyproject steps: @@ -76,6 +83,7 @@ jobs: sw-snitch-cluster-banshee: name: Simulate SW on Snitch Cluster w/ Banshee runs-on: ubuntu-22.04 + if: github.event.pull_request.draft == false container: image: ghcr.io/pulp-platform/snitch_cluster:pyproject steps: diff --git a/.github/workflows/gitlab-ci.yaml b/.github/workflows/gitlab-ci.yaml index e367a594b..5415e8d49 100644 --- a/.github/workflows/gitlab-ci.yaml +++ b/.github/workflows/gitlab-ci.yaml @@ -9,6 +9,7 @@ jobs: gitlab-ci: name: Internal Gitlab CI runs-on: ubuntu-22.04 + if: github.event.pull_request.draft == false steps: - name: Check Gitlab CI uses: pulp-platform/pulp-actions/gitlab-ci@v2.1.0 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d003a2fa1..a6c683739 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,6 +14,7 @@ jobs: verible-lint: name: Lint Verilog sources runs-on: ubuntu-latest + if: github.event.pull_request.draft == false steps: - uses: actions/checkout@v3 - uses: chipsalliance/verible-linter-action@main @@ -32,6 +33,7 @@ jobs: bender-vendor-up-to-date: name: Check bender vendor up-to-date runs-on: ubuntu-latest + if: github.event.pull_request.draft == false steps: - name: Check bender vendor up-to-date uses: pulp-platform/pulp-actions/bender-vendor-up-to-date@v2.1.0 @@ -42,6 +44,7 @@ jobs: sources-up-to-date: name: Check Sources Up-to-Date runs-on: ubuntu-22.04 + if: github.event.pull_request.draft == false container: image: ghcr.io/pulp-platform/snitch_cluster:pyproject steps: @@ -74,6 +77,7 @@ jobs: license-lint: name: Check License headers runs-on: ubuntu-latest + if: github.event.pull_request.draft == false steps: - name: Check License uses: pulp-platform/pulp-actions/lint-license@v2.1.0 @@ -97,6 +101,7 @@ jobs: yaml-lint: name: Lint YAML Sources runs-on: ubuntu-latest + if: github.event.pull_request.draft == false steps: - uses: actions/checkout@v3 - name: yaml-lint @@ -109,6 +114,7 @@ jobs: ######################## python-lint: runs-on: ubuntu-latest + if: github.event.pull_request.draft == false name: Lint Python Sources steps: - name: Check out source repository @@ -130,6 +136,7 @@ jobs: clangfmt: name: Lint C/C++ Sources runs-on: ubuntu-latest + if: github.event.pull_request.draft == false steps: - uses: actions/checkout@v3 - uses: DoozyX/clang-format-lint-action@v0.16.2 @@ -143,6 +150,7 @@ jobs: editorconfig-lint: name: Lint Editorconfig runs-on: ubuntu-latest + if: github.event.pull_request.draft == false steps: - uses: actions/checkout@v3 - uses: editorconfig-checker/action-editorconfig-checker@main From 042263360d7419444d50b3bd4a5e62c930aa655a Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 11:01:51 +0200 Subject: [PATCH 016/130] ci: Build docker container on all branches --- .github/workflows/build-docker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index ef264c89e..001828768 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -6,7 +6,8 @@ name: build-docker on: push: - branches: [main] + branches: + - '**' workflow_dispatch: jobs: build-docker: From b317b159986be1c81a49ff137c95c2f7df3284fb Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 11:01:59 +0200 Subject: [PATCH 017/130] ci: Cache docker container build --- .github/workflows/build-docker.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 001828768..815231a42 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -38,6 +38,8 @@ jobs: uses: docker/build-push-action@v6 with: context: . + cache-from: type=gha + cache-to: type=gha,mode=max` file: util/container/Dockerfile push: true tags: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} From 8a446f322ebc092f07ac1a946e34fe1d1f95d16d Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 11:11:45 +0200 Subject: [PATCH 018/130] container: Install verilator with apt --- util/container/Dockerfile | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index ab39f86c6..9cb8f1a64 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -5,7 +5,7 @@ # Docker container for Snitch development. # 1. Stage -FROM ubuntu:22.04 AS builder +FROM ubuntu:24.04 AS builder ARG CMAKE_VERSION=3.19.4 ARG PYTHON_VERSION=3.9.12 ARG BENDER_VERSION=0.27.1 @@ -59,14 +59,8 @@ ENV PATH="/root/.cargo/bin:${PATH}" RUN rustup install 1.70.0 RUN rustup override set 1.70.0 -# Build Verilator -RUN git clone https://github.com/verilator/verilator && \ - cd verilator && \ - git checkout "v${VERILATOR_VERSION}" && \ - autoconf && \ - ./configure --prefix /tools/verilator && \ - make && \ - make install +# Install Verilator +RUN apt-get install -y verilator=${VERILATOR_VERSION} # Change working directory WORKDIR /tools @@ -93,7 +87,7 @@ RUN tar xzf doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz RUN mv doxygen-${DOXYGEN_VERSION} doxygen # 2. Stage -FROM ubuntu:22.04 AS snitch_cluster +FROM ubuntu:24.04 AS snitch_cluster ARG SNITCH_LLVM_VERSION=latest ARG VERIBLE_VERSION=0.0-3318-g8d254167 From 28ff9b9a9d321a48df36e0e79cd5b8b518b1ce73 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 12:19:44 +0200 Subject: [PATCH 019/130] ci: Don't free up space --- .github/workflows/build-docker.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 815231a42..6d636a06c 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -14,18 +14,6 @@ jobs: name: Deploy Docker image runs-on: ubuntu-22.04 steps: - # Free up disk space on Github-hosted runner - - name: Disk usage - run: df -h - - uses: jlumbroso/free-disk-space@v1.3.1 - with: - android: true - dotnet: true - haskell: true - large-packages: true - - name: Disk usage after freeing up space - run: df -h - # Actually build the Docker container - uses: actions/checkout@v4 - uses: docker/setup-buildx-action@v3 - name: GHCR Log-in From a170979218cf1ad200bc7bf6a31931d7a4e32bca Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 12:19:50 +0200 Subject: [PATCH 020/130] container: Clean up container --- util/container/Dockerfile | 42 +++++---------------------------------- 1 file changed, 5 insertions(+), 37 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 9cb8f1a64..6ae8c3882 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -7,51 +7,19 @@ # 1. Stage FROM ubuntu:24.04 AS builder ARG CMAKE_VERSION=3.19.4 -ARG PYTHON_VERSION=3.9.12 ARG BENDER_VERSION=0.27.1 -ARG SPIKE_DASM_VERSION=0.1.0 ARG VERILATOR_VERSION=5.006 ARG DOXYGEN_VERSION=1.12.0 -# Run dpkg without interactive dialogue -ARG DEBIAN_FRONTEND=noninteractive # Install APT requirements -COPY apt-requirements.txt /tmp/apt-requirements.txt -RUN apt-get update && \ - sed 's/#.*//' /tmp/apt-requirements.txt \ - | xargs apt-get install -y && \ +RUN add-apt-repository ppa:deadsnakes/ppa && \ + apt-get update && \ apt-get install -y \ - build-essential \ curl \ - git \ - gnupg2 \ - lsb-release \ - software-properties-common \ - unzip \ wget \ - zlib1g-dev \ - autoconf \ - help2man \ - flex \ - bison \ - llvm-12-dev \ - libclang-common-12-dev \ - libreadline-dev \ - libncursesw5-dev \ - libssl-dev \ - libsqlite3-dev \ - tk-dev \ - libgdbm-dev \ - libc6-dev \ - libbz2-dev \ - libffi-dev - -# Install Python -RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz -RUN tar xzf Python-${PYTHON_VERSION}.tgz -RUN cd Python-${PYTHON_VERSION} && \ - ./configure --enable-optimizations --prefix=/opt/python/ && \ - make install -j + git \ + tar \ + python3.11 \ # Build Rust tools RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y From 592e769aa78f96144fab938bc3f8228eb5db7744 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 13:08:58 +0200 Subject: [PATCH 021/130] container: Clean up --- util/container/Dockerfile | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 6ae8c3882..fc52fa709 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -13,13 +13,17 @@ ARG DOXYGEN_VERSION=1.12.0 # Install APT requirements RUN add-apt-repository ppa:deadsnakes/ppa && \ - apt-get update && \ - apt-get install -y \ + apt update && \ + apt install -y \ curl \ wget \ git \ tar \ - python3.11 \ + software-properties-common && \ + add-apt-repository ppa:deadsnakes/ppa -y && \ + apt update && \ + # python needs `software-properties-common` to add the deadsnakes PPA + apt install -y python3.11 # Build Rust tools RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y @@ -28,7 +32,7 @@ RUN rustup install 1.70.0 RUN rustup override set 1.70.0 # Install Verilator -RUN apt-get install -y verilator=${VERILATOR_VERSION} +RUN apt install -y verilator=${VERILATOR_VERSION} # Change working directory WORKDIR /tools @@ -71,17 +75,17 @@ WORKDIR /tools # apt-requirements.txt # COPY apt-requirements.txt /tmp/apt-requirements.txt -RUN apt-get update && \ +RUN apt update && \ sed 's/#.*//' /tmp/apt-requirements.txt \ - | xargs apt-get install -y && \ - apt-get install -y --no-install-recommends \ + | xargs apt install -y && \ + apt install -y --no-install-recommends \ ca-certificates \ gnupg2 \ curl \ wget \ build-essential \ git && \ - apt-get clean ; \ + apt clean ; \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* # Get the precompiled LLVM toolchain @@ -101,12 +105,6 @@ RUN wget https://github.com/chipsalliance/verible/releases/download/v${VERIBLE_V rm -rf verible-v${VERIBLE_VERSION}-linux-static-x86_64.tar.gz ENV PATH="/tools/bin:${PATH}" -# Install git>=2.18, required by Github checkout action to recurse submodules -RUN apt-get update && apt-get install software-properties-common -y && \ - add-apt-repository -y ppa:git-core/ppa && \ - apt-get update && \ - apt-get install git -y - # Copy artifacts from stage 1. COPY --from=builder /tools/bender bin/ COPY --from=builder /root/.cargo/bin/banshee bin/ From f80178afa59f072e0b73576327d2fb1d3b7104db Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 13:12:14 +0200 Subject: [PATCH 022/130] container: debug build --- util/container/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index fc52fa709..f5dd3779b 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -19,10 +19,10 @@ RUN add-apt-repository ppa:deadsnakes/ppa && \ wget \ git \ tar \ - software-properties-common && \ - add-apt-repository ppa:deadsnakes/ppa -y && \ + software-properties-common +# python needs `software-properties-common` to add the deadsnakes PPA +RUN add-apt-repository ppa:deadsnakes/ppa -y && \ apt update && \ - # python needs `software-properties-common` to add the deadsnakes PPA apt install -y python3.11 # Build Rust tools From 686a955491d60c24b95354b9ae556df047fd6ddd Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 13:15:45 +0200 Subject: [PATCH 023/130] REVERT: Disable CI --- .github/workflows/ci.yml | 104 -------------------- .github/workflows/gitlab-ci.yaml | 28 ------ .github/workflows/lint.yml | 157 ------------------------------- 3 files changed, 289 deletions(-) delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/gitlab-ci.yaml delete mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index b57013070..000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright 2020 ETH Zurich and University of Bologna. -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# SPDX-License-Identifier: Apache-2.0 - -# Run functional regression checks -name: ci -on: - push: - pull_request: - types: [opened, synchronize, reopened, ready_for_review] - -jobs: - - ######## - # Docs # - ######## - - docs: - name: Build documentation - runs-on: ubuntu-22.04 - if: github.event.pull_request.draft == false - container: - image: ghcr.io/pulp-platform/snitch_cluster:pyproject - steps: - - uses: actions/checkout@v2 - - name: Build docs - run: make docs - - ##################### - # Python unit tests # - ##################### - - pytest: - name: Python unit tests - runs-on: ubuntu-22.04 - if: github.event.pull_request.draft == false - container: - image: ghcr.io/pulp-platform/snitch_cluster:pyproject - steps: - - uses: actions/checkout@v2 - - name: Run pytest - run: pytest - - ############################################## - # Simulate SW on Snitch Cluster w/ Verilator # - ############################################## - - sw-snitch-cluster-vlt: - name: Simulate SW on Snitch Cluster w/ Verilator - runs-on: ubuntu-22.04 - if: github.event.pull_request.draft == false - container: - image: ghcr.io/pulp-platform/snitch_cluster:pyproject - steps: - - uses: actions/checkout@v2 - with: - submodules: 'recursive' - - name: Install local Python packages - run: pip install . - - name: Build Software - working-directory: target/snitch_cluster - run: | - bender vendor init - make CFG_OVERRIDE=cfg/github-ci.hjson sw - - name: Build Hardware - working-directory: target/snitch_cluster - run: | - make CFG_OVERRIDE=cfg/github-ci.hjson VLT_JOBS=1 bin/snitch_cluster.vlt - - name: Run Tests - working-directory: target/snitch_cluster - run: | - ./util/run.py sw/run.yaml --simulator verilator -j - ./util/run.py sw/fdiv.yaml --simulator verilator -j - - name: Annotate traces - working-directory: target/snitch_cluster - run: | - make SIM_DIR=./runs/simple annotate -j - - ######################################### - # Build SW on Snitch Cluster w/ Banshee # - ######################################### - - sw-snitch-cluster-banshee: - name: Simulate SW on Snitch Cluster w/ Banshee - runs-on: ubuntu-22.04 - if: github.event.pull_request.draft == false - container: - image: ghcr.io/pulp-platform/snitch_cluster:pyproject - steps: - - uses: actions/checkout@v2 - with: - submodules: 'recursive' - - name: Install local Python packages - run: pip install . - - name: Build Software - run: | - bender vendor init - make -C target/snitch_cluster SELECT_RUNTIME=banshee sw - - name: Run Tests - env: - SNITCH_LOG: info - working-directory: target/snitch_cluster - run: | - ./util/run.py sw/run.yaml --simulator banshee -j diff --git a/.github/workflows/gitlab-ci.yaml b/.github/workflows/gitlab-ci.yaml deleted file mode 100644 index 5415e8d49..000000000 --- a/.github/workflows/gitlab-ci.yaml +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2023 ETH Zurich and University of Bologna. -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# SPDX-License-Identifier: Apache-2.0 - -# Some CI tests run on our GitLab servers due to licenses and tools -name: gitlab-ci -on: [push, pull_request, workflow_dispatch] -jobs: - gitlab-ci: - name: Internal Gitlab CI - runs-on: ubuntu-22.04 - if: github.event.pull_request.draft == false - steps: - - name: Check Gitlab CI - uses: pulp-platform/pulp-actions/gitlab-ci@v2.1.0 - # Skip on forks or pull requests from forks due to missing secrets. - if: - # yamllint disable rule:line-length - github.repository == 'pulp-platform/snitch_cluster' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) - # yamllint enable rule:line-length - with: - domain: iis-git.ee.ethz.ch - repo: github-mirror/snitch_cluster - token: ${{ secrets.GITLAB_TOKEN }} - poll-period: 20 - poll-count: 1000 - retry-count: 100 - retry-period: 50 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index a6c683739..000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright 2023 ETH Zurich and University of Bologna. -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# SPDX-License-Identifier: Apache-2.0 - -# Run all lint checks -name: lint -on: [push, pull_request] - -jobs: - - ################ - # Verible Lint # - ################ - verible-lint: - name: Lint Verilog sources - runs-on: ubuntu-latest - if: github.event.pull_request.draft == false - steps: - - uses: actions/checkout@v3 - - uses: chipsalliance/verible-linter-action@main - with: - paths: | - ./hw - github_token: ${{ secrets.GITHUB_TOKEN }} - fail_on_error: true - reviewdog_reporter: github-check - extra_args: "--waiver_files util/lint/waiver.verible" - verible_version: "v0.0-3318-g8d254167" - - ##################### - # Vendor Up-to-Date # - ##################### - bender-vendor-up-to-date: - name: Check bender vendor up-to-date - runs-on: ubuntu-latest - if: github.event.pull_request.draft == false - steps: - - name: Check bender vendor up-to-date - uses: pulp-platform/pulp-actions/bender-vendor-up-to-date@v2.1.0 - - ###################### - # Sources Up-to-Date # - ###################### - sources-up-to-date: - name: Check Sources Up-to-Date - runs-on: ubuntu-22.04 - if: github.event.pull_request.draft == false - container: - image: ghcr.io/pulp-platform/snitch_cluster:pyproject - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install local Python packages - run: pip install . - - name: Generate opcodes - run: | - ./util/generate-opcodes.sh - - name: Generate RTL sources - working-directory: target/snitch_cluster - run: | - make rtl - # For some reason, the checkout is done by a different user, - # than that running `git diff` (root, possibly due to Docker). - # So we need to set the repository as a safe directory. - - name: Git config safe.directory - run: | - git config --global --add safe.directory $GITHUB_WORKSPACE - - name: Diff porcelain - uses: mmontes11/diff-porcelain@v0.0.1 - with: - message: Found differences, please update all sources - - ################# - # Check License # - ################# - license-lint: - name: Check License headers - runs-on: ubuntu-latest - if: github.event.pull_request.draft == false - steps: - - name: Check License - uses: pulp-platform/pulp-actions/lint-license@v2.1.0 - with: - patches: 0001-Allow-hash-comments-in-assembly.patch - # We cover ETH Zurich and lowRISC licenses and Apache 2.0 - # (mostly for SW) and Solderpad for the hardware. - # yamllint disable rule:line-length - license: | - Copyright (\d{4}(-\d{4})?\s)?(ETH Zurich and University of Bologna|lowRISC contributors). - (Solderpad Hardware License, Version 0.51|Licensed under the Apache License, Version 2.0), see LICENSE for details. - SPDX-License-Identifier: (SHL-0.51|Apache-2.0) - # yamllint enable rule:line-length - match_regex: true - exclude_paths: | - sw/snRuntime/src/omp/interface.h - - ################## - # Lint YML Files # - ################## - yaml-lint: - name: Lint YAML Sources - runs-on: ubuntu-latest - if: github.event.pull_request.draft == false - steps: - - uses: actions/checkout@v3 - - name: yaml-lint - uses: ibiqlik/action-yamllint@v3 - with: - config_file: util/lint/.yamllint.yml - - ######################## - # Check Python Sources # - ######################## - python-lint: - runs-on: ubuntu-latest - if: github.event.pull_request.draft == false - name: Lint Python Sources - steps: - - name: Check out source repository - uses: actions/checkout@v3 - - name: Set up Python environment - uses: actions/setup-python@v4 - with: - python-version: "3.11" - - name: flake8 Lint - uses: py-actions/flake8@v2 - with: - flake8-version: "6.0.0" - max-line-length: "100" - - ###################### - # Clang-Format Check # - ###################### - # Check C/C++ files for correct formatting. - clangfmt: - name: Lint C/C++ Sources - runs-on: ubuntu-latest - if: github.event.pull_request.draft == false - steps: - - uses: actions/checkout@v3 - - uses: DoozyX/clang-format-lint-action@v0.16.2 - with: - clangFormatVersion: 10 - - ###################### - # Lint Editor Config # - ###################### - # Detect trailing whitespaces, missing new lines and wrong file encodings. - editorconfig-lint: - name: Lint Editorconfig - runs-on: ubuntu-latest - if: github.event.pull_request.draft == false - steps: - - uses: actions/checkout@v3 - - uses: editorconfig-checker/action-editorconfig-checker@main - - run: editorconfig-checker From f9eead16793fd353466a434b4629db51bb99af07 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 13:15:52 +0200 Subject: [PATCH 024/130] container: debug --- util/container/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index f5dd3779b..53185a87d 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -21,7 +21,7 @@ RUN add-apt-repository ppa:deadsnakes/ppa && \ tar \ software-properties-common # python needs `software-properties-common` to add the deadsnakes PPA -RUN add-apt-repository ppa:deadsnakes/ppa -y && \ +RUN add-apt-repository ppa:deadsnakes/ppa && \ apt update && \ apt install -y python3.11 From f389d5e7f6057e10395998c106c03a5b307014dd Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 13:16:59 +0200 Subject: [PATCH 025/130] container: debug --- util/container/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 53185a87d..17d2737c2 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -12,8 +12,7 @@ ARG VERILATOR_VERSION=5.006 ARG DOXYGEN_VERSION=1.12.0 # Install APT requirements -RUN add-apt-repository ppa:deadsnakes/ppa && \ - apt update && \ +RUN apt update && \ apt install -y \ curl \ wget \ From e7f6b5118a1bd0d0e4814a9b229a80c4d109aa07 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 13:21:02 +0200 Subject: [PATCH 026/130] container: debug --- util/container/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 17d2737c2..83bba89f7 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -19,7 +19,8 @@ RUN apt update && \ git \ tar \ software-properties-common -# python needs `software-properties-common` to add the deadsnakes PPA + +# Install python 3.11 RUN add-apt-repository ppa:deadsnakes/ppa && \ apt update && \ apt install -y python3.11 @@ -31,6 +32,7 @@ RUN rustup install 1.70.0 RUN rustup override set 1.70.0 # Install Verilator +RUN apt list -a verilator RUN apt install -y verilator=${VERILATOR_VERSION} # Change working directory From d0b3c6c0358df4edbc6afe158db4a872f42593b4 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 13:29:20 +0200 Subject: [PATCH 027/130] container: Bump `verilator` to `5.020` --- util/container/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 83bba89f7..5b2825ab9 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -8,7 +8,7 @@ FROM ubuntu:24.04 AS builder ARG CMAKE_VERSION=3.19.4 ARG BENDER_VERSION=0.27.1 -ARG VERILATOR_VERSION=5.006 +ARG VERILATOR_VERSION=5.020 ARG DOXYGEN_VERSION=1.12.0 # Install APT requirements @@ -33,7 +33,7 @@ RUN rustup override set 1.70.0 # Install Verilator RUN apt list -a verilator -RUN apt install -y verilator=${VERILATOR_VERSION} +RUN apt install -y verilator=${VERILATOR_VERSION}-1 # Change working directory WORKDIR /tools From eb6f33da79c5bf4e7d2274a82ade4821c500c4c8 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 13:44:51 +0200 Subject: [PATCH 028/130] container: Add `build-essential` again --- util/container/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 5b2825ab9..adf9fe533 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -14,6 +14,7 @@ ARG DOXYGEN_VERSION=1.12.0 # Install APT requirements RUN apt update && \ apt install -y \ + build-essential \ curl \ wget \ git \ From 938ed86a5a3c30f34c07cf41a38c055df7c144f8 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 13:53:58 +0200 Subject: [PATCH 029/130] container: Clean up rust/banshee dependencies --- util/container/Dockerfile | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index adf9fe533..7cc58e2e1 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -10,16 +10,24 @@ ARG CMAKE_VERSION=3.19.4 ARG BENDER_VERSION=0.27.1 ARG VERILATOR_VERSION=5.020 ARG DOXYGEN_VERSION=1.12.0 +ARG RUST_VERSION=1.67.0 # Install APT requirements RUN apt update && \ apt install -y \ - build-essential \ + # General tools curl \ wget \ git \ tar \ - software-properties-common + # Required for rust + build-essential \ + # Required for python 3.11 + software-properties-common \ + # Required for banshee + llvm-12-dev \ + libclang-common-12-dev \ + zlib1g-dev \ # Install python 3.11 RUN add-apt-repository ppa:deadsnakes/ppa && \ @@ -29,8 +37,8 @@ RUN add-apt-repository ppa:deadsnakes/ppa && \ # Build Rust tools RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y ENV PATH="/root/.cargo/bin:${PATH}" -RUN rustup install 1.70.0 -RUN rustup override set 1.70.0 +RUN rustup install ${RUST_VERSION} +RUN rustup override set ${RUST_VERSION} # Install Verilator RUN apt list -a verilator @@ -46,8 +54,6 @@ RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cm ENV PATH="/tools/bin:${PATH}" # Install `banshee` (needs cmake) -RUN rustup install 1.67.0 -RUN rustup override set 1.67.0 RUN git clone https://github.com/pulp-platform/banshee.git /tmp/banshee --recurse-submodules RUN cargo install --path /tmp/banshee From ba5f7dc9a682223e9f53cfff2d44da747b04ff89 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 14:13:09 +0200 Subject: [PATCH 030/130] container: Revert to ubuntu 22.04 again --- util/container/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 7cc58e2e1..33943aa42 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -5,7 +5,7 @@ # Docker container for Snitch development. # 1. Stage -FROM ubuntu:24.04 AS builder +FROM ubuntu:22.04 AS builder ARG CMAKE_VERSION=3.19.4 ARG BENDER_VERSION=0.27.1 ARG VERILATOR_VERSION=5.020 @@ -27,7 +27,7 @@ RUN apt update && \ # Required for banshee llvm-12-dev \ libclang-common-12-dev \ - zlib1g-dev \ + zlib1g-dev # Install python 3.11 RUN add-apt-repository ppa:deadsnakes/ppa && \ @@ -67,7 +67,7 @@ RUN tar xzf doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz RUN mv doxygen-${DOXYGEN_VERSION} doxygen # 2. Stage -FROM ubuntu:24.04 AS snitch_cluster +FROM ubuntu:22.04 AS snitch_cluster ARG SNITCH_LLVM_VERSION=latest ARG VERIBLE_VERSION=0.0-3318-g8d254167 From b3b1cafdccfeb1fa82bdb0beee940cf8be811861 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 14:17:29 +0200 Subject: [PATCH 031/130] container: Install cmake like a normal human being --- util/container/Dockerfile | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 33943aa42..64938f265 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -20,6 +20,7 @@ RUN apt update && \ wget \ git \ tar \ + cmake \ # Required for rust build-essential \ # Required for python 3.11 @@ -47,12 +48,6 @@ RUN apt install -y verilator=${VERILATOR_VERSION}-1 # Change working directory WORKDIR /tools -# Install a newer version of cmake (we need this for banshee) -RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz && \ - tar -x -f cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz --strip-components=1 -C . && \ - rm -rf cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz -ENV PATH="/tools/bin:${PATH}" - # Install `banshee` (needs cmake) RUN git clone https://github.com/pulp-platform/banshee.git /tmp/banshee --recurse-submodules RUN cargo install --path /tmp/banshee From b06e96c338990becb84a9976d58dbb4e18d570cb Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 14:24:01 +0200 Subject: [PATCH 032/130] container: Use `noninteractive` flag again --- util/container/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 64938f265..0de14de07 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -11,6 +11,8 @@ ARG BENDER_VERSION=0.27.1 ARG VERILATOR_VERSION=5.020 ARG DOXYGEN_VERSION=1.12.0 ARG RUST_VERSION=1.67.0 +# Run dpkg without interactive dialogue +ARG DEBIAN_FRONTEND=noninteractive # Install APT requirements RUN apt update && \ From d345b6ac76beef25f098001678dfefaaeb335c77 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 14:24:07 +0200 Subject: [PATCH 033/130] container: Clean up --- util/container/Dockerfile | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 0de14de07..fee2fb249 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -17,17 +17,17 @@ ARG DEBIAN_FRONTEND=noninteractive # Install APT requirements RUN apt update && \ apt install -y \ - # General tools + # General requirements curl \ wget \ git \ tar \ - cmake \ # Required for rust build-essential \ # Required for python 3.11 software-properties-common \ # Required for banshee + cmake \ llvm-12-dev \ libclang-common-12-dev \ zlib1g-dev @@ -44,7 +44,6 @@ RUN rustup install ${RUST_VERSION} RUN rustup override set ${RUST_VERSION} # Install Verilator -RUN apt list -a verilator RUN apt install -y verilator=${VERILATOR_VERSION}-1 # Change working directory @@ -130,8 +129,3 @@ RUN pip install . # Add Verilator to PATH ENV PATH="/tools/verilator/bin:${PATH}" ENV VLT_ROOT="/tools/verilator/share/verilator/" - -# Set locale to UTF-8, required because Python 3.6 defaults on ASCII encoding. -# See https://click.palletsprojects.com/en/8.1.x/unicode-support/ -ENV LC_ALL="C.UTF-8" -ENV LANG="C.UTF-8" From 92939729c4072f746d9dc1dcd2ddfa47272e459e Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 14:32:48 +0200 Subject: [PATCH 034/130] container: Revert back verilator install to source --- util/container/Dockerfile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index fee2fb249..685c314f3 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -24,6 +24,8 @@ RUN apt update && \ tar \ # Required for rust build-essential \ + # Required for verilator + autoconf \ # Required for python 3.11 software-properties-common \ # Required for banshee @@ -43,8 +45,14 @@ ENV PATH="/root/.cargo/bin:${PATH}" RUN rustup install ${RUST_VERSION} RUN rustup override set ${RUST_VERSION} -# Install Verilator -RUN apt install -y verilator=${VERILATOR_VERSION}-1 +# Build Verilator +RUN git clone https://github.com/verilator/verilator && \ + cd verilator && \ + git checkout "v${VERILATOR_VERSION}" && \ + autoconf && \ + ./configure --prefix /tools/verilator && \ + make && \ + make install # Change working directory WORKDIR /tools From 959c4c2f10dee1f78cfdc9c1b083e67364d1dfbe Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 14:36:44 +0200 Subject: [PATCH 035/130] container: Try again with Ubuntu 24.04 --- util/container/Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 685c314f3..e7a43b7a0 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -5,7 +5,7 @@ # Docker container for Snitch development. # 1. Stage -FROM ubuntu:22.04 AS builder +FROM ubuntu:24.04 AS builder ARG CMAKE_VERSION=3.19.4 ARG BENDER_VERSION=0.27.1 ARG VERILATOR_VERSION=5.020 @@ -27,11 +27,11 @@ RUN apt update && \ # Required for verilator autoconf \ # Required for python 3.11 - software-properties-common \ + software-properties-common # Required for banshee - cmake \ - llvm-12-dev \ - libclang-common-12-dev \ +RUN apt install -y cmake \ + llvm-15-dev \ + libclang-common-15-dev \ zlib1g-dev # Install python 3.11 @@ -71,7 +71,7 @@ RUN tar xzf doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz RUN mv doxygen-${DOXYGEN_VERSION} doxygen # 2. Stage -FROM ubuntu:22.04 AS snitch_cluster +FROM ubuntu:24.04 AS snitch_cluster ARG SNITCH_LLVM_VERSION=latest ARG VERIBLE_VERSION=0.0-3318-g8d254167 From 7160b7d8e7c4fafae8864eb01ac36c46c03c6dd8 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 14:43:19 +0200 Subject: [PATCH 036/130] Revert "container: Revert back verilator install to source" This reverts commit 92939729c4072f746d9dc1dcd2ddfa47272e459e. --- util/container/Dockerfile | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index e7a43b7a0..ebc036e1c 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -24,8 +24,6 @@ RUN apt update && \ tar \ # Required for rust build-essential \ - # Required for verilator - autoconf \ # Required for python 3.11 software-properties-common # Required for banshee @@ -45,14 +43,8 @@ ENV PATH="/root/.cargo/bin:${PATH}" RUN rustup install ${RUST_VERSION} RUN rustup override set ${RUST_VERSION} -# Build Verilator -RUN git clone https://github.com/verilator/verilator && \ - cd verilator && \ - git checkout "v${VERILATOR_VERSION}" && \ - autoconf && \ - ./configure --prefix /tools/verilator && \ - make && \ - make install +# Install Verilator +RUN apt install -y verilator=${VERILATOR_VERSION}-1 # Change working directory WORKDIR /tools From 62d9cff94f574ad8bb33f67f923ee6c36c1062a0 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 15:17:36 +0200 Subject: [PATCH 037/130] container: Use LLVM 15 for banshee --- util/container/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index ebc036e1c..f9bad2254 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -50,7 +50,8 @@ RUN apt install -y verilator=${VERILATOR_VERSION}-1 WORKDIR /tools # Install `banshee` (needs cmake) -RUN git clone https://github.com/pulp-platform/banshee.git /tmp/banshee --recurse-submodules +RUN git clone https://github.com/pulp-platform/banshee.git /tmp/banshee --recurse-submodules && \ + cd /tmp/banshee && git checkout llvm-15 RUN cargo install --path /tmp/banshee # Install Bender From b560121efc2ccaf55f5f6a75d06c3315c5636d4c Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 15:30:04 +0200 Subject: [PATCH 038/130] container: Try with env variable --- util/container/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index f9bad2254..390a9b053 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -52,6 +52,7 @@ WORKDIR /tools # Install `banshee` (needs cmake) RUN git clone https://github.com/pulp-platform/banshee.git /tmp/banshee --recurse-submodules && \ cd /tmp/banshee && git checkout llvm-15 +ENV LLVM_SYS_150_PREFIX=$(llvm-configs-15 --prefix) RUN cargo install --path /tmp/banshee # Install Bender From 01ac201a2f4d02a07b06bba0e90fcc20fe77aeac Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 16:48:03 +0200 Subject: [PATCH 039/130] container: Fix banshee dependencies --- util/container/Dockerfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 390a9b053..f25198f70 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -25,12 +25,11 @@ RUN apt update && \ # Required for rust build-essential \ # Required for python 3.11 - software-properties-common + software-properties-common \ # Required for banshee -RUN apt install -y cmake \ + cmake \ llvm-15-dev \ - libclang-common-15-dev \ - zlib1g-dev + libpolly-15-dev # Install python 3.11 RUN add-apt-repository ppa:deadsnakes/ppa && \ @@ -52,7 +51,6 @@ WORKDIR /tools # Install `banshee` (needs cmake) RUN git clone https://github.com/pulp-platform/banshee.git /tmp/banshee --recurse-submodules && \ cd /tmp/banshee && git checkout llvm-15 -ENV LLVM_SYS_150_PREFIX=$(llvm-configs-15 --prefix) RUN cargo install --path /tmp/banshee # Install Bender From 0a16c41ef1f44b6ec2937c4a9ca6b9ae4314f74a Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 17:14:01 +0200 Subject: [PATCH 040/130] container: Try setting environment variable for banshee --- util/container/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index f25198f70..96661b765 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -51,6 +51,7 @@ WORKDIR /tools # Install `banshee` (needs cmake) RUN git clone https://github.com/pulp-platform/banshee.git /tmp/banshee --recurse-submodules && \ cd /tmp/banshee && git checkout llvm-15 +ENV LLVM_SYS_150_PREFIX="/usr/lib/llvm-15" RUN cargo install --path /tmp/banshee # Install Bender From 4d93d6f14c31feb44605b1bd954ee84bc8c53217 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 17:36:29 +0200 Subject: [PATCH 041/130] container: Debug --- util/container/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 96661b765..2742cdd27 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -49,9 +49,10 @@ RUN apt install -y verilator=${VERILATOR_VERSION}-1 WORKDIR /tools # Install `banshee` (needs cmake) -RUN git clone https://github.com/pulp-platform/banshee.git /tmp/banshee --recurse-submodules && \ - cd /tmp/banshee && git checkout llvm-15 ENV LLVM_SYS_150_PREFIX="/usr/lib/llvm-15" +RUN git clone https://github.com/pulp-platform/banshee.git /tmp/banshee --recurse-submodules && \ +cd /tmp/banshee && git checkout llvm-15 +RUN echo $LLVM_SYS_150_PREFIX RUN cargo install --path /tmp/banshee # Install Bender From 6cff79bebd1f1322ba09d20457d4e2450b559e97 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 18:19:59 +0200 Subject: [PATCH 042/130] container: Debug --- util/container/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 2742cdd27..25a96ddd2 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -27,9 +27,9 @@ RUN apt update && \ # Required for python 3.11 software-properties-common \ # Required for banshee - cmake \ llvm-15-dev \ - libpolly-15-dev + libpolly-15-dev \ + zlib1g-dev # Install python 3.11 RUN add-apt-repository ppa:deadsnakes/ppa && \ From f0dd9aaa8325dd25ed0638027250f30b04a709fe Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 18:26:58 +0200 Subject: [PATCH 043/130] container: Try installing cmake --- util/container/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 25a96ddd2..dd23a717a 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -27,6 +27,7 @@ RUN apt update && \ # Required for python 3.11 software-properties-common \ # Required for banshee + cmake \ llvm-15-dev \ libpolly-15-dev \ zlib1g-dev From 7e7a99c2955043de5ca9b81296bb49451c8d2821 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 18:37:18 +0200 Subject: [PATCH 044/130] container: Some more dependencies for banshee --- util/container/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index dd23a717a..31d8ab1af 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -30,7 +30,8 @@ RUN apt update && \ cmake \ llvm-15-dev \ libpolly-15-dev \ - zlib1g-dev + zlib1g-dev \ + libzstd-dev # Install python 3.11 RUN add-apt-repository ppa:deadsnakes/ppa && \ From 9b666b2f8a1e02b12bc5a4d154df8f65cbe9d720 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 18:48:48 +0200 Subject: [PATCH 045/130] container: Debug --- util/container/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 31d8ab1af..ce04637c9 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -38,6 +38,9 @@ RUN add-apt-repository ppa:deadsnakes/ppa && \ apt update && \ apt install -y python3.11 +# Check python installation folder +RUN which python3.11 && which python + # Build Rust tools RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y ENV PATH="/root/.cargo/bin:${PATH}" From 9eb8e97f4f747d07f8c7065a30c339e0628e2e0b Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 18:52:08 +0200 Subject: [PATCH 046/130] container: Clean up --- util/container/Dockerfile | 9 --------- 1 file changed, 9 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index ce04637c9..cda6de84a 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -6,7 +6,6 @@ # 1. Stage FROM ubuntu:24.04 AS builder -ARG CMAKE_VERSION=3.19.4 ARG BENDER_VERSION=0.27.1 ARG VERILATOR_VERSION=5.020 ARG DOXYGEN_VERSION=1.12.0 @@ -57,7 +56,6 @@ WORKDIR /tools ENV LLVM_SYS_150_PREFIX="/usr/lib/llvm-15" RUN git clone https://github.com/pulp-platform/banshee.git /tmp/banshee --recurse-submodules && \ cd /tmp/banshee && git checkout llvm-15 -RUN echo $LLVM_SYS_150_PREFIX RUN cargo install --path /tmp/banshee # Install Bender @@ -81,14 +79,7 @@ LABEL org.opencontainers.image.source=https://github.com/pulp-platform/snitch_cl WORKDIR /tools -# Install (and cleanup) required packages (from apt-requirements.txt) -# The list of extra packages is leftover from before this Dockerfile used -# apt-requirements.txt -# -COPY apt-requirements.txt /tmp/apt-requirements.txt RUN apt update && \ - sed 's/#.*//' /tmp/apt-requirements.txt \ - | xargs apt install -y && \ apt install -y --no-install-recommends \ ca-certificates \ gnupg2 \ From 2eabffc9a78f49ffe47eda73554ac297a8288318 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 19:00:14 +0200 Subject: [PATCH 047/130] container: Try to copy python over --- util/container/Dockerfile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index cda6de84a..4bbf4e157 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -37,9 +37,6 @@ RUN add-apt-repository ppa:deadsnakes/ppa && \ apt update && \ apt install -y python3.11 -# Check python installation folder -RUN which python3.11 && which python - # Build Rust tools RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y ENV PATH="/root/.cargo/bin:${PATH}" @@ -110,7 +107,7 @@ ENV PATH="/tools/bin:${PATH}" # Copy artifacts from stage 1. COPY --from=builder /tools/bender bin/ COPY --from=builder /root/.cargo/bin/banshee bin/ -COPY --from=builder /opt/python /opt/python +COPY --from=builder /usr/bin/python3.11 /usr/bin/python COPY --from=builder /tools/verilator /tools/verilator/ COPY --from=builder /tools/doxygen/bin/doxygen bin/ From 91607836e06afbfd1cc9512945793397bf181c29 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 19:10:26 +0200 Subject: [PATCH 048/130] container: Move stuff around --- util/container/Dockerfile | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 4bbf4e157..aa69483ab 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -23,8 +23,6 @@ RUN apt update && \ tar \ # Required for rust build-essential \ - # Required for python 3.11 - software-properties-common \ # Required for banshee cmake \ llvm-15-dev \ @@ -32,20 +30,12 @@ RUN apt update && \ zlib1g-dev \ libzstd-dev -# Install python 3.11 -RUN add-apt-repository ppa:deadsnakes/ppa && \ - apt update && \ - apt install -y python3.11 - # Build Rust tools RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y ENV PATH="/root/.cargo/bin:${PATH}" RUN rustup install ${RUST_VERSION} RUN rustup override set ${RUST_VERSION} -# Install Verilator -RUN apt install -y verilator=${VERILATOR_VERSION}-1 - # Change working directory WORKDIR /tools @@ -78,15 +68,27 @@ WORKDIR /tools RUN apt update && \ apt install -y --no-install-recommends \ - ca-certificates \ - gnupg2 \ + # General requirements curl \ wget \ build-essential \ - git && \ + git \ + # Required for getting LLVM toolchain + ca-certificates \ + gnupg2 \ + # Required for python 3.11 + software-properties-common && \ apt clean ; \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* +# Install python 3.11 +RUN add-apt-repository ppa:deadsnakes/ppa && \ + apt update && \ + apt install -y python3.11 + +# Install verilator +RUN apt install -y verilator=${VERILATOR_VERSION}-1 + # Get the precompiled LLVM toolchain RUN latest_tag=`curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/pulp-platform/llvm-project/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'` && \ echo "SNITCH_LLVM_VERSION=${SNITCH_LLVM_VERSION} LLVM_TAR=${LLVM_TAR} latest_tag=${latest_tag}" && \ @@ -107,20 +109,16 @@ ENV PATH="/tools/bin:${PATH}" # Copy artifacts from stage 1. COPY --from=builder /tools/bender bin/ COPY --from=builder /root/.cargo/bin/banshee bin/ -COPY --from=builder /usr/bin/python3.11 /usr/bin/python -COPY --from=builder /tools/verilator /tools/verilator/ COPY --from=builder /tools/doxygen/bin/doxygen bin/ # Create and activate virtual environment ENV VIRTUAL_ENV="/root/.venvs/snitch_cluster" RUN /opt/python/bin/python3 -m venv ${VIRTUAL_ENV} ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" + # Install Python requirements COPY pyproject.toml . COPY sw/dnn ./sw/dnn COPY sw/blas ./sw/blas COPY util ./util RUN pip install . -# Add Verilator to PATH -ENV PATH="/tools/verilator/bin:${PATH}" -ENV VLT_ROOT="/tools/verilator/share/verilator/" From 09c299f5696da468743d6dbe15af20b41045bc58 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 19:17:39 +0200 Subject: [PATCH 049/130] container: Move it around again --- util/container/Dockerfile | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index aa69483ab..74ed2b703 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -23,6 +23,8 @@ RUN apt update && \ tar \ # Required for rust build-essential \ + # Required for python 3.11 + software-properties-common\ # Required for banshee cmake \ llvm-15-dev \ @@ -30,6 +32,14 @@ RUN apt update && \ zlib1g-dev \ libzstd-dev +# Install python 3.11 +RUN add-apt-repository ppa:deadsnakes/ppa && \ + apt update && \ + apt install -y python3.11 + +# Install verilator +RUN apt install -y verilator=${VERILATOR_VERSION}-1 + # Build Rust tools RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y ENV PATH="/root/.cargo/bin:${PATH}" @@ -75,20 +85,10 @@ RUN apt update && \ git \ # Required for getting LLVM toolchain ca-certificates \ - gnupg2 \ - # Required for python 3.11 - software-properties-common && \ + gnupg2 && \ apt clean ; \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* -# Install python 3.11 -RUN add-apt-repository ppa:deadsnakes/ppa && \ - apt update && \ - apt install -y python3.11 - -# Install verilator -RUN apt install -y verilator=${VERILATOR_VERSION}-1 - # Get the precompiled LLVM toolchain RUN latest_tag=`curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/pulp-platform/llvm-project/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'` && \ echo "SNITCH_LLVM_VERSION=${SNITCH_LLVM_VERSION} LLVM_TAR=${LLVM_TAR} latest_tag=${latest_tag}" && \ @@ -110,6 +110,8 @@ ENV PATH="/tools/bin:${PATH}" COPY --from=builder /tools/bender bin/ COPY --from=builder /root/.cargo/bin/banshee bin/ COPY --from=builder /tools/doxygen/bin/doxygen bin/ +COPY --from=builder /usr/bin/python3.11 /usr/bin/python +COPY --from=builder /usr/bin/verilator /usr/bin/verilator # Create and activate virtual environment ENV VIRTUAL_ENV="/root/.venvs/snitch_cluster" From ed8d44f9d1f59fc8165a761a176e4256dcc5bba4 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 19:27:19 +0200 Subject: [PATCH 050/130] container: Debug --- util/container/Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 74ed2b703..13b57a97a 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -113,6 +113,10 @@ COPY --from=builder /tools/doxygen/bin/doxygen bin/ COPY --from=builder /usr/bin/python3.11 /usr/bin/python COPY --from=builder /usr/bin/verilator /usr/bin/verilator +RUN which python +RUN python --version +RUN /usr/bin/python --version + # Create and activate virtual environment ENV VIRTUAL_ENV="/root/.venvs/snitch_cluster" RUN /opt/python/bin/python3 -m venv ${VIRTUAL_ENV} From e211e450b776ae969df6dc0ddf60611234beb893 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 19:27:33 +0200 Subject: [PATCH 051/130] container: Use correct python and activate environment --- util/container/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 13b57a97a..3c320b160 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -119,7 +119,7 @@ RUN /usr/bin/python --version # Create and activate virtual environment ENV VIRTUAL_ENV="/root/.venvs/snitch_cluster" -RUN /opt/python/bin/python3 -m venv ${VIRTUAL_ENV} +RUN python -m venv ${VIRTUAL_ENV} && source ${VIRTUAL_ENV}/bin/activate ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" # Install Python requirements From d32f52192d46593c6037ca46cedf3f65eb1d3170 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 19:45:39 +0200 Subject: [PATCH 052/130] container: Use default python version --- util/container/Dockerfile | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 3c320b160..115364f62 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -23,8 +23,6 @@ RUN apt update && \ tar \ # Required for rust build-essential \ - # Required for python 3.11 - software-properties-common\ # Required for banshee cmake \ llvm-15-dev \ @@ -32,11 +30,6 @@ RUN apt update && \ zlib1g-dev \ libzstd-dev -# Install python 3.11 -RUN add-apt-repository ppa:deadsnakes/ppa && \ - apt update && \ - apt install -y python3.11 - # Install verilator RUN apt install -y verilator=${VERILATOR_VERSION}-1 @@ -110,13 +103,8 @@ ENV PATH="/tools/bin:${PATH}" COPY --from=builder /tools/bender bin/ COPY --from=builder /root/.cargo/bin/banshee bin/ COPY --from=builder /tools/doxygen/bin/doxygen bin/ -COPY --from=builder /usr/bin/python3.11 /usr/bin/python COPY --from=builder /usr/bin/verilator /usr/bin/verilator -RUN which python -RUN python --version -RUN /usr/bin/python --version - # Create and activate virtual environment ENV VIRTUAL_ENV="/root/.venvs/snitch_cluster" RUN python -m venv ${VIRTUAL_ENV} && source ${VIRTUAL_ENV}/bin/activate From c539baf410860e8d2ca79545e4e9394930e6321b Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 20:27:56 +0200 Subject: [PATCH 053/130] container: Use `python3` --- util/container/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 115364f62..a8cd11a77 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -107,7 +107,7 @@ COPY --from=builder /usr/bin/verilator /usr/bin/verilator # Create and activate virtual environment ENV VIRTUAL_ENV="/root/.venvs/snitch_cluster" -RUN python -m venv ${VIRTUAL_ENV} && source ${VIRTUAL_ENV}/bin/activate +RUN python3 -m venv ${VIRTUAL_ENV} && source ${VIRTUAL_ENV}/bin/activate ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" # Install Python requirements @@ -115,4 +115,4 @@ COPY pyproject.toml . COPY sw/dnn ./sw/dnn COPY sw/blas ./sw/blas COPY util ./util -RUN pip install . +RUN pip3 install . From 2ca3345da14627bfd76698b6bd5fb2eb815286ab Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 20:54:21 +0200 Subject: [PATCH 054/130] container: Revert back a lot of stuff --- util/container/Dockerfile | 46 +++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index a8cd11a77..351a09193 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -5,9 +5,10 @@ # Docker container for Snitch development. # 1. Stage -FROM ubuntu:24.04 AS builder +FROM ubuntu:22.04 AS builder ARG BENDER_VERSION=0.27.1 ARG VERILATOR_VERSION=5.020 +ARG PYTHON_VERSION=3.11.9 ARG DOXYGEN_VERSION=1.12.0 ARG RUST_VERSION=1.67.0 # Run dpkg without interactive dialogue @@ -28,10 +29,30 @@ RUN apt update && \ llvm-15-dev \ libpolly-15-dev \ zlib1g-dev \ - libzstd-dev - -# Install verilator -RUN apt install -y verilator=${VERILATOR_VERSION}-1 + libzstd-dev \ + # Required for python + libncurses5-dev \ + libgdbm-dev \ + libnss3-dev \ + libssl-dev \ + libreadline-dev \ + libffi-dev + +# Install Python +RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz +RUN tar xzf Python-${PYTHON_VERSION}.tgz +RUN cd Python-${PYTHON_VERSION} && \ + ./configure --enable-optimizations --prefix=/opt/python/ && \ + make install -j + +# Build Verilator +RUN git clone https://github.com/verilator/verilator && \ + cd verilator && \ + git checkout "v${VERILATOR_VERSION}" && \ + autoconf && \ + ./configure --prefix /tools/verilator && \ + make -j && \ + make install # Build Rust tools RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y @@ -58,7 +79,7 @@ RUN tar xzf doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz RUN mv doxygen-${DOXYGEN_VERSION} doxygen # 2. Stage -FROM ubuntu:24.04 AS snitch_cluster +FROM ubuntu:22.04 AS snitch_cluster ARG SNITCH_LLVM_VERSION=latest ARG VERIBLE_VERSION=0.0-3318-g8d254167 @@ -102,12 +123,19 @@ ENV PATH="/tools/bin:${PATH}" # Copy artifacts from stage 1. COPY --from=builder /tools/bender bin/ COPY --from=builder /root/.cargo/bin/banshee bin/ +COPY --from=builder /opt/python /opt/python COPY --from=builder /tools/doxygen/bin/doxygen bin/ -COPY --from=builder /usr/bin/verilator /usr/bin/verilator +COPY --from=builder /tools/verilator /tools/verilator/ + +# Add Verilator to PATH +ENV PATH "/tools/verilator/bin:${PATH}" +ENV VLT_ROOT "/tools/verilator/share/verilator/" + +RUN which python && python --version # Create and activate virtual environment ENV VIRTUAL_ENV="/root/.venvs/snitch_cluster" -RUN python3 -m venv ${VIRTUAL_ENV} && source ${VIRTUAL_ENV}/bin/activate +RUN python -m venv ${VIRTUAL_ENV} && source ${VIRTUAL_ENV}/bin/activate ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" # Install Python requirements @@ -115,4 +143,4 @@ COPY pyproject.toml . COPY sw/dnn ./sw/dnn COPY sw/blas ./sw/blas COPY util ./util -RUN pip3 install . +RUN pip install . From bfe20e2669ce5ba6505609058a6836db21e6f98d Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 20:58:08 +0200 Subject: [PATCH 055/130] container: Clean up --- util/container/Dockerfile | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 351a09193..935915af2 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -26,8 +26,8 @@ RUN apt update && \ build-essential \ # Required for banshee cmake \ - llvm-15-dev \ - libpolly-15-dev \ + llvm-12-dev \ + libpolly-12-dev \ zlib1g-dev \ libzstd-dev \ # Required for python @@ -39,9 +39,9 @@ RUN apt update && \ libffi-dev # Install Python -RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz -RUN tar xzf Python-${PYTHON_VERSION}.tgz -RUN cd Python-${PYTHON_VERSION} && \ +RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \ + tar xzf Python-${PYTHON_VERSION}.tgz && \ + cd Python-${PYTHON_VERSION} && \ ./configure --enable-optimizations --prefix=/opt/python/ && \ make install -j @@ -57,26 +57,24 @@ RUN git clone https://github.com/verilator/verilator && \ # Build Rust tools RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y ENV PATH="/root/.cargo/bin:${PATH}" -RUN rustup install ${RUST_VERSION} -RUN rustup override set ${RUST_VERSION} +RUN rustup install ${RUST_VERSION} && \ + rustup override set ${RUST_VERSION} # Change working directory WORKDIR /tools # Install `banshee` (needs cmake) -ENV LLVM_SYS_150_PREFIX="/usr/lib/llvm-15" RUN git clone https://github.com/pulp-platform/banshee.git /tmp/banshee --recurse-submodules && \ -cd /tmp/banshee && git checkout llvm-15 -RUN cargo install --path /tmp/banshee + cargo install --path /tmp/banshee # Install Bender -RUN wget https://github.com/pulp-platform/bender/releases/download/v${BENDER_VERSION}/bender-${BENDER_VERSION}-x86_64-linux-gnu-ubuntu18.04.tar.gz -RUN tar xzf bender-${BENDER_VERSION}-x86_64-linux-gnu-ubuntu18.04.tar.gz +RUN wget https://github.com/pulp-platform/bender/releases/download/v${BENDER_VERSION}/bender-${BENDER_VERSION}-x86_64-linux-gnu-ubuntu18.04.tar.gz && \ + tar xzf bender-${BENDER_VERSION}-x86_64-linux-gnu-ubuntu18.04.tar.gz # Install Doxygen -RUN wget https://www.doxygen.nl/files/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz -RUN tar xzf doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz -RUN mv doxygen-${DOXYGEN_VERSION} doxygen +RUN wget https://www.doxygen.nl/files/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz && \ + tar xzf doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz && \ + mv doxygen-${DOXYGEN_VERSION} doxygen # 2. Stage FROM ubuntu:22.04 AS snitch_cluster From f3ecc1187eac979b2837d0e12d3dc8751b2ffafc Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 20:59:51 +0200 Subject: [PATCH 056/130] container: banshee deps --- util/container/Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 935915af2..49dececee 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -27,9 +27,8 @@ RUN apt update && \ # Required for banshee cmake \ llvm-12-dev \ - libpolly-12-dev \ - zlib1g-dev \ - libzstd-dev \ + libclang-common-12-dev \ + # zlib1g-dev \ # Required for python libncurses5-dev \ libgdbm-dev \ From 24b497b6ae3efc262c4cbd63022c55b9e08d700d Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 21:10:01 +0200 Subject: [PATCH 057/130] container: python deps --- util/container/Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 49dececee..a5e333c07 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -28,19 +28,22 @@ RUN apt update && \ cmake \ llvm-12-dev \ libclang-common-12-dev \ - # zlib1g-dev \ # Required for python libncurses5-dev \ libgdbm-dev \ libnss3-dev \ libssl-dev \ libreadline-dev \ - libffi-dev + libffi-dev \ + libsqlite3-dev \ + tk-dev \ + libc6-dev \ + libbz2-dev # Install Python RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \ - tar xzf Python-${PYTHON_VERSION}.tgz && \ - cd Python-${PYTHON_VERSION} && \ + tar xzf Python-${PYTHON_VERSION}.tgz +RUN cd Python-${PYTHON_VERSION} && \ ./configure --enable-optimizations --prefix=/opt/python/ && \ make install -j From 02a4e269928bc61ab0e7a45fbde6caa0d34025e6 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 2 Sep 2024 21:21:45 +0200 Subject: [PATCH 058/130] container: More python deps --- util/container/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index a5e333c07..020172bf4 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -31,6 +31,7 @@ RUN apt update && \ # Required for python libncurses5-dev \ libgdbm-dev \ + libgdbm-compat-dev \ libnss3-dev \ libssl-dev \ libreadline-dev \ @@ -38,7 +39,8 @@ RUN apt update && \ libsqlite3-dev \ tk-dev \ libc6-dev \ - libbz2-dev + libbz2-dev \ + liblzma-dev # Install Python RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \ From 1f22ab92f5844b300c0371cc36e1d6f89b2629f0 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 3 Sep 2024 09:29:33 +0200 Subject: [PATCH 059/130] container: Install python with `apt` (again) --- util/container/Dockerfile | 43 ++++++++++++++------------------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 020172bf4..d84dcca76 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -8,7 +8,7 @@ FROM ubuntu:22.04 AS builder ARG BENDER_VERSION=0.27.1 ARG VERILATOR_VERSION=5.020 -ARG PYTHON_VERSION=3.11.9 +ARG PYTHON_VERSION=3.11 ARG DOXYGEN_VERSION=1.12.0 ARG RUST_VERSION=1.67.0 # Run dpkg without interactive dialogue @@ -27,27 +27,7 @@ RUN apt update && \ # Required for banshee cmake \ llvm-12-dev \ - libclang-common-12-dev \ - # Required for python - libncurses5-dev \ - libgdbm-dev \ - libgdbm-compat-dev \ - libnss3-dev \ - libssl-dev \ - libreadline-dev \ - libffi-dev \ - libsqlite3-dev \ - tk-dev \ - libc6-dev \ - libbz2-dev \ - liblzma-dev - -# Install Python -RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \ - tar xzf Python-${PYTHON_VERSION}.tgz -RUN cd Python-${PYTHON_VERSION} && \ - ./configure --enable-optimizations --prefix=/opt/python/ && \ - make install -j + libclang-common-12-dev # Build Verilator RUN git clone https://github.com/verilator/verilator && \ @@ -99,11 +79,11 @@ RUN apt update && \ wget \ build-essential \ git \ + # Required for python + software-properties-common \ # Required for getting LLVM toolchain ca-certificates \ - gnupg2 && \ - apt clean ; \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* + gnupg2 # Get the precompiled LLVM toolchain RUN latest_tag=`curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/pulp-platform/llvm-project/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'` && \ @@ -122,10 +102,17 @@ RUN wget https://github.com/chipsalliance/verible/releases/download/v${VERIBLE_V rm -rf verible-v${VERIBLE_VERSION}-linux-static-x86_64.tar.gz ENV PATH="/tools/bin:${PATH}" +# Install Python +RUN apt-add-repository ppa:deadsnakes/ppa && \ + apt update && \ + apt install -y --no-install-recommends \ + python${PYTHON_VERSION} && \ + apt clean ; \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* + # Copy artifacts from stage 1. COPY --from=builder /tools/bender bin/ COPY --from=builder /root/.cargo/bin/banshee bin/ -COPY --from=builder /opt/python /opt/python COPY --from=builder /tools/doxygen/bin/doxygen bin/ COPY --from=builder /tools/verilator /tools/verilator/ @@ -133,11 +120,11 @@ COPY --from=builder /tools/verilator /tools/verilator/ ENV PATH "/tools/verilator/bin:${PATH}" ENV VLT_ROOT "/tools/verilator/share/verilator/" -RUN which python && python --version +RUN which python${PYTHON_VERSION} && python${PYTHON_VERSION} --version # Create and activate virtual environment ENV VIRTUAL_ENV="/root/.venvs/snitch_cluster" -RUN python -m venv ${VIRTUAL_ENV} && source ${VIRTUAL_ENV}/bin/activate +RUN python${PYTHON_VERSION} -m venv ${VIRTUAL_ENV} && source ${VIRTUAL_ENV}/bin/activate ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" # Install Python requirements From 0299f3257fa674320f24529180a96868d45c4536 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 3 Sep 2024 09:32:09 +0200 Subject: [PATCH 060/130] container: Verilator dependencies --- util/container/Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index d84dcca76..9502dd100 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -22,6 +22,11 @@ RUN apt update && \ wget \ git \ tar \ + # Required for Verilator + autoconf \ + flex \ + bison \ + ccache \ # Required for rust build-essential \ # Required for banshee From 13856ec3d153bfce5c3f81456d5ab2e599a428a1 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 3 Sep 2024 10:08:38 +0200 Subject: [PATCH 061/130] container: More dependencies for verilator --- util/container/Dockerfile | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 9502dd100..f413cfdd0 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -18,21 +18,15 @@ ARG DEBIAN_FRONTEND=noninteractive RUN apt update && \ apt install -y \ # General requirements - curl \ - wget \ - git \ - tar \ + curl wget git tar \ # Required for Verilator - autoconf \ - flex \ - bison \ - ccache \ + autoconf flex bison help2man \ + libfl2 libfl-dev zlib1g zlib1g-dev \ + mold libgoogle-perftools-dev numactl \ # Required for rust build-essential \ # Required for banshee - cmake \ - llvm-12-dev \ - libclang-common-12-dev + cmake llvm-12-dev libclang-common-12-dev # Build Verilator RUN git clone https://github.com/verilator/verilator && \ From be013ac392c4e2e59d82c4fecdac95100d10514a Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 3 Sep 2024 10:13:12 +0200 Subject: [PATCH 062/130] container: Fix python version --- util/container/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index f413cfdd0..be5770e54 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -8,7 +8,6 @@ FROM ubuntu:22.04 AS builder ARG BENDER_VERSION=0.27.1 ARG VERILATOR_VERSION=5.020 -ARG PYTHON_VERSION=3.11 ARG DOXYGEN_VERSION=1.12.0 ARG RUST_VERSION=1.67.0 # Run dpkg without interactive dialogue @@ -63,6 +62,7 @@ RUN wget https://www.doxygen.nl/files/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.g FROM ubuntu:22.04 AS snitch_cluster ARG SNITCH_LLVM_VERSION=latest ARG VERIBLE_VERSION=0.0-3318-g8d254167 +ARG PYTHON_VERSION=3.11 LABEL version="0.1" LABEL description="Snitch container for hardware and software development." From cccc555938e9f409daa5bba5f3b3a915d4906c01 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 3 Sep 2024 11:25:05 +0200 Subject: [PATCH 063/130] ci: Try freeing up disk space before --- .github/workflows/build-docker.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 6d636a06c..fd1ef96a3 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -15,6 +15,10 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + docker-images: false - uses: docker/setup-buildx-action@v3 - name: GHCR Log-in uses: docker/login-action@v3 From b7fe2c010526d030188a4bdbafa91dd1553aa850 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 3 Sep 2024 11:46:37 +0200 Subject: [PATCH 064/130] container: Try verilator container --- util/container/Dockerfile | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index be5770e54..23ef96522 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -4,10 +4,14 @@ # Docker container for Snitch development. +ARG VERILATOR_VERSION=5.020 +FROM verilator/verilator:v${VERILATOR_VERSION} AS verilator + +RUN which verilator && verilator --version + # 1. Stage FROM ubuntu:22.04 AS builder ARG BENDER_VERSION=0.27.1 -ARG VERILATOR_VERSION=5.020 ARG DOXYGEN_VERSION=1.12.0 ARG RUST_VERSION=1.67.0 # Run dpkg without interactive dialogue @@ -19,22 +23,22 @@ RUN apt update && \ # General requirements curl wget git tar \ # Required for Verilator - autoconf flex bison help2man \ - libfl2 libfl-dev zlib1g zlib1g-dev \ - mold libgoogle-perftools-dev numactl \ + # autoconf flex bison help2man \ + # libfl2 libfl-dev zlib1g zlib1g-dev \ + # mold libgoogle-perftools-dev numactl \ # Required for rust build-essential \ # Required for banshee cmake llvm-12-dev libclang-common-12-dev -# Build Verilator -RUN git clone https://github.com/verilator/verilator && \ - cd verilator && \ - git checkout "v${VERILATOR_VERSION}" && \ - autoconf && \ - ./configure --prefix /tools/verilator && \ - make -j && \ - make install +# # Build Verilator +# RUN git clone https://github.com/verilator/verilator && \ +# cd verilator && \ +# git checkout "v${VERILATOR_VERSION}" && \ +# autoconf && \ +# ./configure --prefix /tools/verilator && \ +# make -j && \ +# make install # Build Rust tools RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y @@ -113,7 +117,8 @@ RUN apt-add-repository ppa:deadsnakes/ppa && \ COPY --from=builder /tools/bender bin/ COPY --from=builder /root/.cargo/bin/banshee bin/ COPY --from=builder /tools/doxygen/bin/doxygen bin/ -COPY --from=builder /tools/verilator /tools/verilator/ +# COPY --from=builder /tools/verilator /tools/verilator/ +COPY --from=verilator /usr/local/bin/verilator-wrap.sh /usr/local/bin/verilator-wrap.sh # Add Verilator to PATH ENV PATH "/tools/verilator/bin:${PATH}" From 8b663d097d1b4072658666cc4ad2add889e02e61 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 3 Sep 2024 11:47:15 +0200 Subject: [PATCH 065/130] Revert "ci: Try freeing up disk space before" This reverts commit cccc555938e9f409daa5bba5f3b3a915d4906c01. --- .github/workflows/build-docker.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index fd1ef96a3..6d636a06c 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -15,10 +15,6 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - docker-images: false - uses: docker/setup-buildx-action@v3 - name: GHCR Log-in uses: docker/login-action@v3 From 549df75ac7382dd55348f85f4fb77a6c64f60edf Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 3 Sep 2024 11:59:24 +0200 Subject: [PATCH 066/130] container: Specify ubuntu version --- util/container/Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 23ef96522..89a813f17 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -5,12 +5,13 @@ # Docker container for Snitch development. ARG VERILATOR_VERSION=5.020 +ARG UBUNTU_VERSION=22.04 FROM verilator/verilator:v${VERILATOR_VERSION} AS verilator RUN which verilator && verilator --version # 1. Stage -FROM ubuntu:22.04 AS builder +FROM ubuntu:${UBUNTU_VERSION} AS builder ARG BENDER_VERSION=0.27.1 ARG DOXYGEN_VERSION=1.12.0 ARG RUST_VERSION=1.67.0 @@ -54,8 +55,8 @@ RUN git clone https://github.com/pulp-platform/banshee.git /tmp/banshee --recurs cargo install --path /tmp/banshee # Install Bender -RUN wget https://github.com/pulp-platform/bender/releases/download/v${BENDER_VERSION}/bender-${BENDER_VERSION}-x86_64-linux-gnu-ubuntu18.04.tar.gz && \ - tar xzf bender-${BENDER_VERSION}-x86_64-linux-gnu-ubuntu18.04.tar.gz +RUN wget https://github.com/pulp-platform/bender/releases/download/v${BENDER_VERSION}/bender-${BENDER_VERSION}-x86_64-linux-gnu-ubuntu${UBUNTU_VERSION}.tar.gz && \ + tar xzf bender-${BENDER_VERSION}-x86_64-linux-gnu-ubuntu${UBUNTU_VERSION}.tar.gz # Install Doxygen RUN wget https://www.doxygen.nl/files/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz && \ @@ -63,7 +64,7 @@ RUN wget https://www.doxygen.nl/files/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.g mv doxygen-${DOXYGEN_VERSION} doxygen # 2. Stage -FROM ubuntu:22.04 AS snitch_cluster +FROM ubuntu:${UBUNTU_VERSION} AS snitch_cluster ARG SNITCH_LLVM_VERSION=latest ARG VERIBLE_VERSION=0.0-3318-g8d254167 ARG PYTHON_VERSION=3.11 From 03310f1b3741eb010ebce48a6728f2b632d313fc Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 3 Sep 2024 11:59:48 +0200 Subject: [PATCH 067/130] container: Banshee dependencies --- util/container/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 89a813f17..d47cb8a38 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -25,12 +25,12 @@ RUN apt update && \ curl wget git tar \ # Required for Verilator # autoconf flex bison help2man \ - # libfl2 libfl-dev zlib1g zlib1g-dev \ + # libfl2 libfl-dev zlib1g \ # mold libgoogle-perftools-dev numactl \ # Required for rust build-essential \ # Required for banshee - cmake llvm-12-dev libclang-common-12-dev + cmake llvm-12-dev libclang-common-12-dev zlib1g-dev # # Build Verilator # RUN git clone https://github.com/verilator/verilator && \ From 30de53ed38cd5e0ee932b9430c939dd9b7c4e41c Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 3 Sep 2024 12:00:06 +0200 Subject: [PATCH 068/130] container: Debug verilator --- util/container/Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index d47cb8a38..10d2b9e06 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -9,6 +9,9 @@ ARG UBUNTU_VERSION=22.04 FROM verilator/verilator:v${VERILATOR_VERSION} AS verilator RUN which verilator && verilator --version +RUN ./usr/local/bin/verilator-wrap.sh +RUN which verilator && verilator --version +RUN echo $VERILATOR_ROOT # 1. Stage FROM ubuntu:${UBUNTU_VERSION} AS builder @@ -118,12 +121,11 @@ RUN apt-add-repository ppa:deadsnakes/ppa && \ COPY --from=builder /tools/bender bin/ COPY --from=builder /root/.cargo/bin/banshee bin/ COPY --from=builder /tools/doxygen/bin/doxygen bin/ -# COPY --from=builder /tools/verilator /tools/verilator/ +COPY --from=verilator /usr/local/bin/verilator /usr/local/bin/verilator COPY --from=verilator /usr/local/bin/verilator-wrap.sh /usr/local/bin/verilator-wrap.sh # Add Verilator to PATH -ENV PATH "/tools/verilator/bin:${PATH}" -ENV VLT_ROOT "/tools/verilator/share/verilator/" +ENV VLT_ROOT "/usr/local/bin/verilator/" RUN which python${PYTHON_VERSION} && python${PYTHON_VERSION} --version From c149641b6749b68409baf1358d3b415de3e9dfe4 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 3 Sep 2024 13:59:49 +0200 Subject: [PATCH 069/130] container: Clean up --- util/container/Dockerfile | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 10d2b9e06..2fd7f482a 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -6,44 +6,29 @@ ARG VERILATOR_VERSION=5.020 ARG UBUNTU_VERSION=22.04 + FROM verilator/verilator:v${VERILATOR_VERSION} AS verilator -RUN which verilator && verilator --version -RUN ./usr/local/bin/verilator-wrap.sh -RUN which verilator && verilator --version -RUN echo $VERILATOR_ROOT +RUN which verilator && verilator --version && \ + echo $VERILATOR_ROOT # 1. Stage FROM ubuntu:${UBUNTU_VERSION} AS builder ARG BENDER_VERSION=0.27.1 ARG DOXYGEN_VERSION=1.12.0 -ARG RUST_VERSION=1.67.0 -# Run dpkg without interactive dialogue -ARG DEBIAN_FRONTEND=noninteractive +ARG RUST_VERSION=1.63.0 +ARG UBUNTU_VERSION # Install APT requirements RUN apt update && \ apt install -y \ # General requirements curl wget git tar \ - # Required for Verilator - # autoconf flex bison help2man \ - # libfl2 libfl-dev zlib1g \ - # mold libgoogle-perftools-dev numactl \ # Required for rust build-essential \ # Required for banshee cmake llvm-12-dev libclang-common-12-dev zlib1g-dev -# # Build Verilator -# RUN git clone https://github.com/verilator/verilator && \ -# cd verilator && \ -# git checkout "v${VERILATOR_VERSION}" && \ -# autoconf && \ -# ./configure --prefix /tools/verilator && \ -# make -j && \ -# make install - # Build Rust tools RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y ENV PATH="/root/.cargo/bin:${PATH}" @@ -71,6 +56,8 @@ FROM ubuntu:${UBUNTU_VERSION} AS snitch_cluster ARG SNITCH_LLVM_VERSION=latest ARG VERIBLE_VERSION=0.0-3318-g8d254167 ARG PYTHON_VERSION=3.11 +# Run dpkg without interactive dialogue +ARG DEBIAN_FRONTEND=noninteractive LABEL version="0.1" LABEL description="Snitch container for hardware and software development." From 52dbf68892c94bd93ca6ac4a26ccdad2392e63be Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 3 Sep 2024 14:09:03 +0200 Subject: [PATCH 070/130] container: Install python with `venv` --- util/container/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 2fd7f482a..257e41f9b 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -100,7 +100,7 @@ ENV PATH="/tools/bin:${PATH}" RUN apt-add-repository ppa:deadsnakes/ppa && \ apt update && \ apt install -y --no-install-recommends \ - python${PYTHON_VERSION} && \ + python${PYTHON_VERSION}-venv && \ apt clean ; \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* @@ -118,7 +118,7 @@ RUN which python${PYTHON_VERSION} && python${PYTHON_VERSION} --version # Create and activate virtual environment ENV VIRTUAL_ENV="/root/.venvs/snitch_cluster" -RUN python${PYTHON_VERSION} -m venv ${VIRTUAL_ENV} && source ${VIRTUAL_ENV}/bin/activate +RUN python${PYTHON_VERSION} -m venv ${VIRTUAL_ENV} && ${VIRTUAL_ENV}/bin/activate ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" # Install Python requirements From b2f6f032b6c9f0c18833768e484b217f49732246 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 3 Sep 2024 17:27:26 +0200 Subject: [PATCH 071/130] container: Add additional stage for python files --- util/container/Dockerfile | 47 +++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 257e41f9b..326c2bd6c 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -4,6 +4,7 @@ # Docker container for Snitch development. +# 1. Stage: Use the verilator container to get the Verilator binary. ARG VERILATOR_VERSION=5.020 ARG UBUNTU_VERSION=22.04 @@ -12,7 +13,7 @@ FROM verilator/verilator:v${VERILATOR_VERSION} AS verilator RUN which verilator && verilator --version && \ echo $VERILATOR_ROOT -# 1. Stage +# 2. Stage: Install additional IIS tools FROM ubuntu:${UBUNTU_VERSION} AS builder ARG BENDER_VERSION=0.27.1 ARG DOXYGEN_VERSION=1.12.0 @@ -51,7 +52,17 @@ RUN wget https://www.doxygen.nl/files/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.g tar xzf doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz && \ mv doxygen-${DOXYGEN_VERSION} doxygen -# 2. Stage +# 3. Stage: Filter python files to improve caching of the final container +FROM ubuntu:${UBUNTU_VERSION} AS python_filter + +# Copy all files in `sw` and `util` and remove all non-python files +COPY sw ./sw +COPY util ./util + +RUN find sw -type f ! -name "*.py" -delete && \ + find util -type f ! -name "*.py" -delete + +# 4. Stage: Create the final container FROM ubuntu:${UBUNTU_VERSION} AS snitch_cluster ARG SNITCH_LLVM_VERSION=latest ARG VERIBLE_VERSION=0.0-3318-g8d254167 @@ -104,26 +115,24 @@ RUN apt-add-repository ppa:deadsnakes/ppa && \ apt clean ; \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* -# Copy artifacts from stage 1. +# Create and activate virtual environment +ARG VIRTUAL_ENV="/root/.venvs/snitch_cluster" +RUN python${PYTHON_VERSION} -m venv ${VIRTUAL_ENV} +RUN chmod +x ${VIRTUAL_ENV}/bin/activate +RUN ${VIRTUAL_ENV}/bin/activate + +# Copy all needed files to install the package +COPY pyproject.toml . +COPY --from=python_filter sw ./sw +COPY --from=python_filter util ./util +RUN pip install . + +# Copy the tools from the builder stage COPY --from=builder /tools/bender bin/ COPY --from=builder /root/.cargo/bin/banshee bin/ COPY --from=builder /tools/doxygen/bin/doxygen bin/ -COPY --from=verilator /usr/local/bin/verilator /usr/local/bin/verilator -COPY --from=verilator /usr/local/bin/verilator-wrap.sh /usr/local/bin/verilator-wrap.sh +COPY --from=verilator /usr/local/bin/verilator* /usr/local/bin/ -# Add Verilator to PATH +# Modify environment and path variables ENV VLT_ROOT "/usr/local/bin/verilator/" - -RUN which python${PYTHON_VERSION} && python${PYTHON_VERSION} --version - -# Create and activate virtual environment -ENV VIRTUAL_ENV="/root/.venvs/snitch_cluster" -RUN python${PYTHON_VERSION} -m venv ${VIRTUAL_ENV} && ${VIRTUAL_ENV}/bin/activate ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" - -# Install Python requirements -COPY pyproject.toml . -COPY sw/dnn ./sw/dnn -COPY sw/blas ./sw/blas -COPY util ./util -RUN pip install . From f5ef89a5c423c7762fada6c80e515da8ff532da9 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 3 Sep 2024 17:30:44 +0200 Subject: [PATCH 072/130] container: Also install pip --- util/container/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 326c2bd6c..e1e5886ec 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -112,6 +112,7 @@ RUN apt-add-repository ppa:deadsnakes/ppa && \ apt update && \ apt install -y --no-install-recommends \ python${PYTHON_VERSION}-venv && \ + python3-pip && \ apt clean ; \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* From fd0e4ab36692751567c06fe7f183ab8fceb1088a Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 3 Sep 2024 17:35:26 +0200 Subject: [PATCH 073/130] container: Debug --- util/container/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index e1e5886ec..02c6a58ac 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -111,8 +111,7 @@ ENV PATH="/tools/bin:${PATH}" RUN apt-add-repository ppa:deadsnakes/ppa && \ apt update && \ apt install -y --no-install-recommends \ - python${PYTHON_VERSION}-venv && \ - python3-pip && \ + python${PYTHON_VERSION} && \ apt clean ; \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* From ed15660e8020fa8f73f4d734c6ba8a161484d0ff Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 3 Sep 2024 17:41:16 +0200 Subject: [PATCH 074/130] container: Debug --- util/container/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 02c6a58ac..b36127053 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -112,6 +112,7 @@ RUN apt-add-repository ppa:deadsnakes/ppa && \ apt update && \ apt install -y --no-install-recommends \ python${PYTHON_VERSION} && \ + python3-venv apt clean ; \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* @@ -134,5 +135,5 @@ COPY --from=builder /tools/doxygen/bin/doxygen bin/ COPY --from=verilator /usr/local/bin/verilator* /usr/local/bin/ # Modify environment and path variables -ENV VLT_ROOT "/usr/local/bin/verilator/" +ENV VLT_ROOT="/usr/local/bin/verilator/" ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" From 46dcb25c47ce12e20d1f46169211c0bf61e4dfa2 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 3 Sep 2024 17:43:54 +0200 Subject: [PATCH 075/130] contaienr: Debug --- util/container/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index b36127053..c02fe1913 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -112,7 +112,7 @@ RUN apt-add-repository ppa:deadsnakes/ppa && \ apt update && \ apt install -y --no-install-recommends \ python${PYTHON_VERSION} && \ - python3-venv + python${PYTHON_VERSION}-venv && \ apt clean ; \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* From 45a916c08b16ed96fb8715a71b24a183df88b2dd Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 3 Sep 2024 17:47:13 +0200 Subject: [PATCH 076/130] container: Debug --- util/container/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index c02fe1913..2a85e234a 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -112,7 +112,7 @@ RUN apt-add-repository ppa:deadsnakes/ppa && \ apt update && \ apt install -y --no-install-recommends \ python${PYTHON_VERSION} && \ - python${PYTHON_VERSION}-venv && \ + python3-venv && \ apt clean ; \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* From 5cb109f1cc33d4d798ec1365d57ed3d9f3d160db Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 3 Sep 2024 17:50:13 +0200 Subject: [PATCH 077/130] container: Disable cache for the moment --- .github/workflows/build-docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 6d636a06c..4de8ef9ea 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -26,8 +26,8 @@ jobs: uses: docker/build-push-action@v6 with: context: . - cache-from: type=gha - cache-to: type=gha,mode=max` + # cache-from: type=gha + # cache-to: type=gha,mode=max` file: util/container/Dockerfile push: true tags: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} From 21e3edb0019d150eaee81c754fc936ecc70fe162 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Wed, 4 Sep 2024 09:13:25 +0200 Subject: [PATCH 078/130] container: Debug --- util/container/Dockerfile | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 2a85e234a..ac586cf9b 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -25,6 +25,7 @@ RUN apt update && \ apt install -y \ # General requirements curl wget git tar \ + ca-certificates gnupg2 \ # Required for rust build-essential \ # Required for banshee @@ -47,6 +48,11 @@ RUN git clone https://github.com/pulp-platform/banshee.git /tmp/banshee --recurs RUN wget https://github.com/pulp-platform/bender/releases/download/v${BENDER_VERSION}/bender-${BENDER_VERSION}-x86_64-linux-gnu-ubuntu${UBUNTU_VERSION}.tar.gz && \ tar xzf bender-${BENDER_VERSION}-x86_64-linux-gnu-ubuntu${UBUNTU_VERSION}.tar.gz +# Install Verible +RUN wget https://github.com/chipsalliance/verible/releases/download/v${VERIBLE_VERSION}/verible-v${VERIBLE_VERSION}-linux-static-x86_64.tar.gz && \ + tar -x -f verible-v${VERIBLE_VERSION}-linux-static-x86_64.tar.gz --strip-components=1 -C . && \ + rm -rf verible-v${VERIBLE_VERSION}-linux-static-x86_64.tar.gz + # Install Doxygen RUN wget https://www.doxygen.nl/files/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz && \ tar xzf doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz && \ @@ -101,37 +107,32 @@ RUN latest_tag=`curl -s -H "Accept: application/vnd.github.v3+json" https://api. tar xvz --strip-components=1 -C riscv-llvm ENV LLVM_BINROOT="/tools/riscv-llvm/bin" -# Install Verible -RUN wget https://github.com/chipsalliance/verible/releases/download/v${VERIBLE_VERSION}/verible-v${VERIBLE_VERSION}-linux-static-x86_64.tar.gz && \ - tar -x -f verible-v${VERIBLE_VERSION}-linux-static-x86_64.tar.gz --strip-components=1 -C . && \ - rm -rf verible-v${VERIBLE_VERSION}-linux-static-x86_64.tar.gz -ENV PATH="/tools/bin:${PATH}" - # Install Python RUN apt-add-repository ppa:deadsnakes/ppa && \ apt update && \ apt install -y --no-install-recommends \ - python${PYTHON_VERSION} && \ - python3-venv && \ - apt clean ; \ + python${PYTHON_VERSION}-venv && \ + apt clean && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* -# Create and activate virtual environment -ARG VIRTUAL_ENV="/root/.venvs/snitch_cluster" -RUN python${PYTHON_VERSION} -m venv ${VIRTUAL_ENV} -RUN chmod +x ${VIRTUAL_ENV}/bin/activate -RUN ${VIRTUAL_ENV}/bin/activate - # Copy all needed files to install the package COPY pyproject.toml . COPY --from=python_filter sw ./sw COPY --from=python_filter util ./util -RUN pip install . + +# Create and activate virtual environment +ARG VIRTUAL_ENV="/root/.venvs/snitch_cluster" +RUN python${PYTHON_VERSION} -m venv ${VIRTUAL_ENV} + +# Upgrade pip and install packages using the virtual environment's pip +RUN ${VIRTUAL_ENV}/bin/pip install --upgrade pip && \ + ${VIRTUAL_ENV}/bin/pip install . # Copy the tools from the builder stage COPY --from=builder /tools/bender bin/ COPY --from=builder /root/.cargo/bin/banshee bin/ COPY --from=builder /tools/doxygen/bin/doxygen bin/ +COPY --from=builder /tools/verible* bin/ COPY --from=verilator /usr/local/bin/verilator* /usr/local/bin/ # Modify environment and path variables From 78448d41487d8ab552e79d1b163f4d9138c2ea4d Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Wed, 4 Sep 2024 09:42:17 +0200 Subject: [PATCH 079/130] container: Debug --- util/container/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index ac586cf9b..88cd9291c 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -17,6 +17,7 @@ RUN which verilator && verilator --version && \ FROM ubuntu:${UBUNTU_VERSION} AS builder ARG BENDER_VERSION=0.27.1 ARG DOXYGEN_VERSION=1.12.0 +ARG VERIBLE_VERSION=0.0-3318-g8d254167 ARG RUST_VERSION=1.63.0 ARG UBUNTU_VERSION @@ -71,7 +72,6 @@ RUN find sw -type f ! -name "*.py" -delete && \ # 4. Stage: Create the final container FROM ubuntu:${UBUNTU_VERSION} AS snitch_cluster ARG SNITCH_LLVM_VERSION=latest -ARG VERIBLE_VERSION=0.0-3318-g8d254167 ARG PYTHON_VERSION=3.11 # Run dpkg without interactive dialogue ARG DEBIAN_FRONTEND=noninteractive From d80a42f23f791ad64ec65115cba7ccc1fe0e86a5 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Wed, 4 Sep 2024 15:59:07 +0200 Subject: [PATCH 080/130] Revert "Revert "ci: Try freeing up disk space before"" This reverts commit 8b663d097d1b4072658666cc4ad2add889e02e61. --- .github/workflows/build-docker.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 4de8ef9ea..0c8a2cec8 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -15,6 +15,10 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + docker-images: false - uses: docker/setup-buildx-action@v3 - name: GHCR Log-in uses: docker/login-action@v3 From 5bfca71d5170f0576a51c88d0dea95ce90a0686b Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Wed, 4 Sep 2024 16:53:41 +0200 Subject: [PATCH 081/130] Revert "container: Disable cache for the moment" This reverts commit 5cb109f1cc33d4d798ec1365d57ed3d9f3d160db. --- .github/workflows/build-docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 0c8a2cec8..fd1ef96a3 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -30,8 +30,8 @@ jobs: uses: docker/build-push-action@v6 with: context: . - # cache-from: type=gha - # cache-to: type=gha,mode=max` + cache-from: type=gha + cache-to: type=gha,mode=max` file: util/container/Dockerfile push: true tags: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} From a4ada4c1d469be9f8843aa34c906a8d93d80f3d6 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Wed, 4 Sep 2024 17:24:51 +0200 Subject: [PATCH 082/130] Revert "Revert "Revert "ci: Try freeing up disk space before""" This reverts commit d80a42f23f791ad64ec65115cba7ccc1fe0e86a5. --- .github/workflows/build-docker.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index fd1ef96a3..6d636a06c 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -15,10 +15,6 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - docker-images: false - uses: docker/setup-buildx-action@v3 - name: GHCR Log-in uses: docker/login-action@v3 From fe1686efc1828bdee695d51b697bcba97c6a4ee7 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Wed, 4 Sep 2024 17:25:56 +0200 Subject: [PATCH 083/130] Revert "REVERT: Disable CI" This reverts commit 686a955491d60c24b95354b9ae556df047fd6ddd. --- .github/workflows/ci.yml | 104 ++++++++++++++++++++ .github/workflows/gitlab-ci.yaml | 28 ++++++ .github/workflows/lint.yml | 157 +++++++++++++++++++++++++++++++ 3 files changed, 289 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/gitlab-ci.yaml create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..b57013070 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,104 @@ +# Copyright 2020 ETH Zurich and University of Bologna. +# Licensed under the Apache License, Version 2.0, see LICENSE for details. +# SPDX-License-Identifier: Apache-2.0 + +# Run functional regression checks +name: ci +on: + push: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + + ######## + # Docs # + ######## + + docs: + name: Build documentation + runs-on: ubuntu-22.04 + if: github.event.pull_request.draft == false + container: + image: ghcr.io/pulp-platform/snitch_cluster:pyproject + steps: + - uses: actions/checkout@v2 + - name: Build docs + run: make docs + + ##################### + # Python unit tests # + ##################### + + pytest: + name: Python unit tests + runs-on: ubuntu-22.04 + if: github.event.pull_request.draft == false + container: + image: ghcr.io/pulp-platform/snitch_cluster:pyproject + steps: + - uses: actions/checkout@v2 + - name: Run pytest + run: pytest + + ############################################## + # Simulate SW on Snitch Cluster w/ Verilator # + ############################################## + + sw-snitch-cluster-vlt: + name: Simulate SW on Snitch Cluster w/ Verilator + runs-on: ubuntu-22.04 + if: github.event.pull_request.draft == false + container: + image: ghcr.io/pulp-platform/snitch_cluster:pyproject + steps: + - uses: actions/checkout@v2 + with: + submodules: 'recursive' + - name: Install local Python packages + run: pip install . + - name: Build Software + working-directory: target/snitch_cluster + run: | + bender vendor init + make CFG_OVERRIDE=cfg/github-ci.hjson sw + - name: Build Hardware + working-directory: target/snitch_cluster + run: | + make CFG_OVERRIDE=cfg/github-ci.hjson VLT_JOBS=1 bin/snitch_cluster.vlt + - name: Run Tests + working-directory: target/snitch_cluster + run: | + ./util/run.py sw/run.yaml --simulator verilator -j + ./util/run.py sw/fdiv.yaml --simulator verilator -j + - name: Annotate traces + working-directory: target/snitch_cluster + run: | + make SIM_DIR=./runs/simple annotate -j + + ######################################### + # Build SW on Snitch Cluster w/ Banshee # + ######################################### + + sw-snitch-cluster-banshee: + name: Simulate SW on Snitch Cluster w/ Banshee + runs-on: ubuntu-22.04 + if: github.event.pull_request.draft == false + container: + image: ghcr.io/pulp-platform/snitch_cluster:pyproject + steps: + - uses: actions/checkout@v2 + with: + submodules: 'recursive' + - name: Install local Python packages + run: pip install . + - name: Build Software + run: | + bender vendor init + make -C target/snitch_cluster SELECT_RUNTIME=banshee sw + - name: Run Tests + env: + SNITCH_LOG: info + working-directory: target/snitch_cluster + run: | + ./util/run.py sw/run.yaml --simulator banshee -j diff --git a/.github/workflows/gitlab-ci.yaml b/.github/workflows/gitlab-ci.yaml new file mode 100644 index 000000000..5415e8d49 --- /dev/null +++ b/.github/workflows/gitlab-ci.yaml @@ -0,0 +1,28 @@ +# Copyright 2023 ETH Zurich and University of Bologna. +# Licensed under the Apache License, Version 2.0, see LICENSE for details. +# SPDX-License-Identifier: Apache-2.0 + +# Some CI tests run on our GitLab servers due to licenses and tools +name: gitlab-ci +on: [push, pull_request, workflow_dispatch] +jobs: + gitlab-ci: + name: Internal Gitlab CI + runs-on: ubuntu-22.04 + if: github.event.pull_request.draft == false + steps: + - name: Check Gitlab CI + uses: pulp-platform/pulp-actions/gitlab-ci@v2.1.0 + # Skip on forks or pull requests from forks due to missing secrets. + if: + # yamllint disable rule:line-length + github.repository == 'pulp-platform/snitch_cluster' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) + # yamllint enable rule:line-length + with: + domain: iis-git.ee.ethz.ch + repo: github-mirror/snitch_cluster + token: ${{ secrets.GITLAB_TOKEN }} + poll-period: 20 + poll-count: 1000 + retry-count: 100 + retry-period: 50 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..a6c683739 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,157 @@ +# Copyright 2023 ETH Zurich and University of Bologna. +# Licensed under the Apache License, Version 2.0, see LICENSE for details. +# SPDX-License-Identifier: Apache-2.0 + +# Run all lint checks +name: lint +on: [push, pull_request] + +jobs: + + ################ + # Verible Lint # + ################ + verible-lint: + name: Lint Verilog sources + runs-on: ubuntu-latest + if: github.event.pull_request.draft == false + steps: + - uses: actions/checkout@v3 + - uses: chipsalliance/verible-linter-action@main + with: + paths: | + ./hw + github_token: ${{ secrets.GITHUB_TOKEN }} + fail_on_error: true + reviewdog_reporter: github-check + extra_args: "--waiver_files util/lint/waiver.verible" + verible_version: "v0.0-3318-g8d254167" + + ##################### + # Vendor Up-to-Date # + ##################### + bender-vendor-up-to-date: + name: Check bender vendor up-to-date + runs-on: ubuntu-latest + if: github.event.pull_request.draft == false + steps: + - name: Check bender vendor up-to-date + uses: pulp-platform/pulp-actions/bender-vendor-up-to-date@v2.1.0 + + ###################### + # Sources Up-to-Date # + ###################### + sources-up-to-date: + name: Check Sources Up-to-Date + runs-on: ubuntu-22.04 + if: github.event.pull_request.draft == false + container: + image: ghcr.io/pulp-platform/snitch_cluster:pyproject + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Install local Python packages + run: pip install . + - name: Generate opcodes + run: | + ./util/generate-opcodes.sh + - name: Generate RTL sources + working-directory: target/snitch_cluster + run: | + make rtl + # For some reason, the checkout is done by a different user, + # than that running `git diff` (root, possibly due to Docker). + # So we need to set the repository as a safe directory. + - name: Git config safe.directory + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + - name: Diff porcelain + uses: mmontes11/diff-porcelain@v0.0.1 + with: + message: Found differences, please update all sources + + ################# + # Check License # + ################# + license-lint: + name: Check License headers + runs-on: ubuntu-latest + if: github.event.pull_request.draft == false + steps: + - name: Check License + uses: pulp-platform/pulp-actions/lint-license@v2.1.0 + with: + patches: 0001-Allow-hash-comments-in-assembly.patch + # We cover ETH Zurich and lowRISC licenses and Apache 2.0 + # (mostly for SW) and Solderpad for the hardware. + # yamllint disable rule:line-length + license: | + Copyright (\d{4}(-\d{4})?\s)?(ETH Zurich and University of Bologna|lowRISC contributors). + (Solderpad Hardware License, Version 0.51|Licensed under the Apache License, Version 2.0), see LICENSE for details. + SPDX-License-Identifier: (SHL-0.51|Apache-2.0) + # yamllint enable rule:line-length + match_regex: true + exclude_paths: | + sw/snRuntime/src/omp/interface.h + + ################## + # Lint YML Files # + ################## + yaml-lint: + name: Lint YAML Sources + runs-on: ubuntu-latest + if: github.event.pull_request.draft == false + steps: + - uses: actions/checkout@v3 + - name: yaml-lint + uses: ibiqlik/action-yamllint@v3 + with: + config_file: util/lint/.yamllint.yml + + ######################## + # Check Python Sources # + ######################## + python-lint: + runs-on: ubuntu-latest + if: github.event.pull_request.draft == false + name: Lint Python Sources + steps: + - name: Check out source repository + uses: actions/checkout@v3 + - name: Set up Python environment + uses: actions/setup-python@v4 + with: + python-version: "3.11" + - name: flake8 Lint + uses: py-actions/flake8@v2 + with: + flake8-version: "6.0.0" + max-line-length: "100" + + ###################### + # Clang-Format Check # + ###################### + # Check C/C++ files for correct formatting. + clangfmt: + name: Lint C/C++ Sources + runs-on: ubuntu-latest + if: github.event.pull_request.draft == false + steps: + - uses: actions/checkout@v3 + - uses: DoozyX/clang-format-lint-action@v0.16.2 + with: + clangFormatVersion: 10 + + ###################### + # Lint Editor Config # + ###################### + # Detect trailing whitespaces, missing new lines and wrong file encodings. + editorconfig-lint: + name: Lint Editorconfig + runs-on: ubuntu-latest + if: github.event.pull_request.draft == false + steps: + - uses: actions/checkout@v3 + - uses: editorconfig-checker/action-editorconfig-checker@main + - run: editorconfig-checker From f9c0b5cbc7722f1f89701c836393a48286304238 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Wed, 4 Sep 2024 17:41:53 +0200 Subject: [PATCH 084/130] container: Set PATH variables correctly --- util/container/Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 88cd9291c..45c4a12a8 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -129,12 +129,13 @@ RUN ${VIRTUAL_ENV}/bin/pip install --upgrade pip && \ ${VIRTUAL_ENV}/bin/pip install . # Copy the tools from the builder stage -COPY --from=builder /tools/bender bin/ -COPY --from=builder /root/.cargo/bin/banshee bin/ -COPY --from=builder /tools/doxygen/bin/doxygen bin/ -COPY --from=builder /tools/verible* bin/ +COPY --from=builder /tools/bender /tools/bin/ +COPY --from=builder /root/.cargo/bin/banshee /tools/bin/ +COPY --from=builder /tools/doxygen/bin/doxygen /tools/bin/ +COPY --from=builder /tools/verible* /tools/bin/ COPY --from=verilator /usr/local/bin/verilator* /usr/local/bin/ # Modify environment and path variables ENV VLT_ROOT="/usr/local/bin/verilator/" ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" +ENV PATH="/tools/bin:${PATH}" From 46a08a6e516f53546b4097e396e103c3810a9180 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Wed, 4 Sep 2024 17:46:13 +0200 Subject: [PATCH 085/130] ci: Update clang-lint action --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a6c683739..910434cb5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -139,7 +139,7 @@ jobs: if: github.event.pull_request.draft == false steps: - uses: actions/checkout@v3 - - uses: DoozyX/clang-format-lint-action@v0.16.2 + - uses: DoozyX/clang-format-lint-action@v0.18.1 with: clangFormatVersion: 10 From 48d21da90564306cab9c44bf090970accd5ad433 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Wed, 4 Sep 2024 19:56:22 +0200 Subject: [PATCH 086/130] container: Move LLLM install to previous stage --- util/container/Dockerfile | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 45c4a12a8..9e5600941 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -18,6 +18,7 @@ FROM ubuntu:${UBUNTU_VERSION} AS builder ARG BENDER_VERSION=0.27.1 ARG DOXYGEN_VERSION=1.12.0 ARG VERIBLE_VERSION=0.0-3318-g8d254167 +ARG SNITCH_LLVM_VERSION=latest ARG RUST_VERSION=1.63.0 ARG UBUNTU_VERSION @@ -26,7 +27,6 @@ RUN apt update && \ apt install -y \ # General requirements curl wget git tar \ - ca-certificates gnupg2 \ # Required for rust build-essential \ # Required for banshee @@ -59,6 +59,16 @@ RUN wget https://www.doxygen.nl/files/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.g tar xzf doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz && \ mv doxygen-${DOXYGEN_VERSION} doxygen +# Get the precompiled LLVM toolchain +RUN latest_tag=`curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/pulp-platform/llvm-project/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'` && \ +echo "SNITCH_LLVM_VERSION=${SNITCH_LLVM_VERSION} LLVM_TAR=${LLVM_TAR} latest_tag=${latest_tag}" && \ +test "${SNITCH_LLVM_VERSION}" = "latest" && SNITCH_LLVM_VERSION=${latest_tag} || : ; \ +LLVM_TAR=riscv32-pulp-llvm-ubuntu2004-$(echo $SNITCH_LLVM_VERSION | cut -d '-' -f3-).tar.gz && \ +mkdir -p riscv-llvm && \ +echo "SNITCH_LLVM_VERSION=${SNITCH_LLVM_VERSION} LLVM_TAR=${LLVM_TAR} latest_tag=${latest_tag}" && \ +wget -qO- https://github.com/pulp-platform/llvm-project/releases/download/${SNITCH_LLVM_VERSION}/${LLVM_TAR} | \ +tar xvz --strip-components=1 -C riscv-llvm + # 3. Stage: Filter python files to improve caching of the final container FROM ubuntu:${UBUNTU_VERSION} AS python_filter @@ -71,7 +81,6 @@ RUN find sw -type f ! -name "*.py" -delete && \ # 4. Stage: Create the final container FROM ubuntu:${UBUNTU_VERSION} AS snitch_cluster -ARG SNITCH_LLVM_VERSION=latest ARG PYTHON_VERSION=3.11 # Run dpkg without interactive dialogue ARG DEBIAN_FRONTEND=noninteractive @@ -86,26 +95,9 @@ WORKDIR /tools RUN apt update && \ apt install -y --no-install-recommends \ # General requirements - curl \ - wget \ - build-essential \ - git \ + curl wget build-essential git \ # Required for python - software-properties-common \ - # Required for getting LLVM toolchain - ca-certificates \ - gnupg2 - -# Get the precompiled LLVM toolchain -RUN latest_tag=`curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/pulp-platform/llvm-project/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'` && \ - echo "SNITCH_LLVM_VERSION=${SNITCH_LLVM_VERSION} LLVM_TAR=${LLVM_TAR} latest_tag=${latest_tag}" && \ - test "${SNITCH_LLVM_VERSION}" = "latest" && SNITCH_LLVM_VERSION=${latest_tag} || : ; \ - LLVM_TAR=riscv32-pulp-llvm-ubuntu2004-$(echo $SNITCH_LLVM_VERSION | cut -d '-' -f3-).tar.gz && \ - mkdir -p riscv-llvm && \ - echo "SNITCH_LLVM_VERSION=${SNITCH_LLVM_VERSION} LLVM_TAR=${LLVM_TAR} latest_tag=${latest_tag}" && \ - wget -qO- https://github.com/pulp-platform/llvm-project/releases/download/${SNITCH_LLVM_VERSION}/${LLVM_TAR} | \ - tar xvz --strip-components=1 -C riscv-llvm -ENV LLVM_BINROOT="/tools/riscv-llvm/bin" + software-properties-common gnupg2 # Install Python RUN apt-add-repository ppa:deadsnakes/ppa && \ @@ -133,9 +125,11 @@ COPY --from=builder /tools/bender /tools/bin/ COPY --from=builder /root/.cargo/bin/banshee /tools/bin/ COPY --from=builder /tools/doxygen/bin/doxygen /tools/bin/ COPY --from=builder /tools/verible* /tools/bin/ +COPY --from=builder /tools/riscv-llvm /tools/riscv-llvm COPY --from=verilator /usr/local/bin/verilator* /usr/local/bin/ # Modify environment and path variables ENV VLT_ROOT="/usr/local/bin/verilator/" +ENV LLVM_BINROOT="/tools/riscv-llvm/bin" ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" ENV PATH="/tools/bin:${PATH}" From 3db37c8f5ac266e7210e012b8992e34ba6a647a6 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Wed, 4 Sep 2024 20:14:28 +0200 Subject: [PATCH 087/130] ci: Don't run pip install anymore --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b57013070..2431ab852 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,8 +55,6 @@ jobs: - uses: actions/checkout@v2 with: submodules: 'recursive' - - name: Install local Python packages - run: pip install . - name: Build Software working-directory: target/snitch_cluster run: | @@ -90,8 +88,6 @@ jobs: - uses: actions/checkout@v2 with: submodules: 'recursive' - - name: Install local Python packages - run: pip install . - name: Build Software run: | bender vendor init From 4d0b2b6304626241291e064eaecb12086c4434ee Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Wed, 4 Sep 2024 20:14:41 +0200 Subject: [PATCH 088/130] ci: Build container before running verilator CI --- .github/workflows/build-docker.yml | 35 --------------------------- .github/workflows/ci.yml | 38 ++++++++++++++++++++++++++---- 2 files changed, 34 insertions(+), 39 deletions(-) delete mode 100644 .github/workflows/build-docker.yml diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml deleted file mode 100644 index 6d636a06c..000000000 --- a/.github/workflows/build-docker.yml +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright 2020 ETH Zurich and University of Bologna. -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# SPDX-License-Identifier: Apache-2.0 - -# Build Docker image and publish to pulp-platform's GHCR. -name: build-docker -on: - push: - branches: - - '**' - workflow_dispatch: -jobs: - build-docker: - name: Deploy Docker image - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - uses: docker/setup-buildx-action@v3 - - name: GHCR Log-in - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v6 - with: - context: . - cache-from: type=gha - cache-to: type=gha,mode=max` - file: util/container/Dockerfile - push: true - tags: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} - build-args: |- - SNITCH_LLVM_VERSION=latest diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2431ab852..12b646bd6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,32 @@ on: jobs: + ########################## + # Build Docker Container # + ########################## + + build-docker: + name: Deploy Docker image + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: docker/setup-buildx-action@v3 + - name: GHCR Log-in + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + cache-from: type=gha + cache-to: type=gha,mode=max` + file: util/container/Dockerfile + push: true + tags: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} + ######## # Docs # ######## @@ -18,9 +44,10 @@ jobs: docs: name: Build documentation runs-on: ubuntu-22.04 + needs: build-docker if: github.event.pull_request.draft == false container: - image: ghcr.io/pulp-platform/snitch_cluster:pyproject + image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} steps: - uses: actions/checkout@v2 - name: Build docs @@ -33,9 +60,10 @@ jobs: pytest: name: Python unit tests runs-on: ubuntu-22.04 + needs: build-docker if: github.event.pull_request.draft == false container: - image: ghcr.io/pulp-platform/snitch_cluster:pyproject + image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} steps: - uses: actions/checkout@v2 - name: Run pytest @@ -48,9 +76,10 @@ jobs: sw-snitch-cluster-vlt: name: Simulate SW on Snitch Cluster w/ Verilator runs-on: ubuntu-22.04 + needs: build-docker if: github.event.pull_request.draft == false container: - image: ghcr.io/pulp-platform/snitch_cluster:pyproject + image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} steps: - uses: actions/checkout@v2 with: @@ -81,9 +110,10 @@ jobs: sw-snitch-cluster-banshee: name: Simulate SW on Snitch Cluster w/ Banshee runs-on: ubuntu-22.04 + needs: build-docker if: github.event.pull_request.draft == false container: - image: ghcr.io/pulp-platform/snitch_cluster:pyproject + image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} steps: - uses: actions/checkout@v2 with: From d8eabaa301575a0635d458cd726374ab0dd7193f Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Wed, 4 Sep 2024 20:14:56 +0200 Subject: [PATCH 089/130] ci: Don't use container for linting --- .github/workflows/lint.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 910434cb5..e69d01899 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -45,14 +45,19 @@ jobs: name: Check Sources Up-to-Date runs-on: ubuntu-22.04 if: github.event.pull_request.draft == false - container: - image: ghcr.io/pulp-platform/snitch_cluster:pyproject steps: - uses: actions/checkout@v4 with: submodules: true - - name: Install local Python packages - run: pip install . + - name: Install bender + uses: pulp-platform/pulp-actions/bender-install@v2 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + cache: 'pip' + - name: Install pip dependencies + run: | + pip install . - name: Generate opcodes run: | ./util/generate-opcodes.sh @@ -60,12 +65,6 @@ jobs: working-directory: target/snitch_cluster run: | make rtl - # For some reason, the checkout is done by a different user, - # than that running `git diff` (root, possibly due to Docker). - # So we need to set the repository as a safe directory. - - name: Git config safe.directory - run: | - git config --global --add safe.directory $GITHUB_WORKSPACE - name: Diff porcelain uses: mmontes11/diff-porcelain@v0.0.1 with: From e7a4839897aed1968e7ea1b5dae11b40ab32302e Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Wed, 4 Sep 2024 20:33:07 +0200 Subject: [PATCH 090/130] ci: Cache verilator build --- .github/workflows/ci.yml | 18 ++++++++++++++++++ target/common/verilator.mk | 8 ++++++++ 2 files changed, 26 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 12b646bd6..55ab9424d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,7 +89,25 @@ jobs: run: | bender vendor init make CFG_OVERRIDE=cfg/github-ci.hjson sw + - name: Generate the RTL + working-directory: target/snitch_cluster + run: | + make CFG_OVERRIDE=cfg/github-ci.hjson rtl + - name: Extract file list for Verilator build + run: | + echo "VLT_SOURCES=$(make echo-vlt-flist) >> $GITHUB_ENV + echo $VLT_SOURCES + echo $GITHUB_ENV + - name: Set up cache for Verilator build + id: verilator-cache + uses: actions/cache@v3 + with: + path: target/snitch_cluster/bin # Cache the directory where the simulator binary is stored + key: verilator-${{ hashFiles(env.VLT_SOURCES) }} + restore-keys: | + verilator- - name: Build Hardware + if: steps.verilator-cache.outputs.cache-hit != 'true' working-directory: target/snitch_cluster run: | make CFG_OVERRIDE=cfg/github-ci.hjson VLT_JOBS=1 bin/snitch_cluster.vlt diff --git a/target/common/verilator.mk b/target/common/verilator.mk index b5e86a19b..dac342907 100644 --- a/target/common/verilator.mk +++ b/target/common/verilator.mk @@ -2,6 +2,14 @@ # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 +VLT_FLIST = $(VLT_SOURCES) +VLT_FLIST += $(TB_CC_SOURCES) +VLT_FLIST += $(VLT_CC_SOURCES) + +.PHONY: vlt-flist +vlt-flist: + @echo $(VLT_FLIST) + $(BIN_DIR)/$(TARGET).vlt: $(VLT_SOURCES) $(TB_CC_SOURCES) $(VLT_CC_SOURCES) $(VLT_BUILDDIR)/lib/libfesvr.a | $(BIN_DIR) $(VLT) $(shell $(BENDER) script verilator $(VLT_BENDER)) \ $(VLT_FLAGS) -Mdir $(VLT_BUILDDIR) \ From a7efc6500de69f463b57aac88497571e75c81bdd Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Wed, 4 Sep 2024 20:35:26 +0200 Subject: [PATCH 091/130] ci: Free up disk space when building the container --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 55ab9424d..c5c7497b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,10 @@ jobs: name: Deploy Docker image runs-on: ubuntu-22.04 steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + docker-images: false - uses: actions/checkout@v4 - uses: docker/setup-buildx-action@v3 - name: GHCR Log-in From a4d029b7d75abaa3b56861d8f092be7a87e36fba Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Wed, 4 Sep 2024 20:39:10 +0200 Subject: [PATCH 092/130] ci: Don't run for draft requests --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5c7497b9..77d7f1b9e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,7 @@ jobs: build-docker: name: Deploy Docker image runs-on: ubuntu-22.04 + if: github.event.pull_request.draft == false steps: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main From bdf23f8f5e645b842641c0a7c2396c0e71a9f836 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Wed, 4 Sep 2024 20:39:20 +0200 Subject: [PATCH 093/130] lint: YAML sources --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77d7f1b9e..65d775e69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -107,7 +107,7 @@ jobs: id: verilator-cache uses: actions/cache@v3 with: - path: target/snitch_cluster/bin # Cache the directory where the simulator binary is stored + path: target/snitch_cluster/bin key: verilator-${{ hashFiles(env.VLT_SOURCES) }} restore-keys: | verilator- From dd1315fb8e3b88543d846a3a3e0bf49388ba200c Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Wed, 4 Sep 2024 21:56:00 +0200 Subject: [PATCH 094/130] ci: Remove unused `bender vendor init` --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65d775e69..c9423a12f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,7 +92,6 @@ jobs: - name: Build Software working-directory: target/snitch_cluster run: | - bender vendor init make CFG_OVERRIDE=cfg/github-ci.hjson sw - name: Generate the RTL working-directory: target/snitch_cluster From b0d400143b30d99301a604d2cc3edd3c2683a735 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Wed, 4 Sep 2024 21:56:05 +0200 Subject: [PATCH 095/130] Revert "ci: Don't run pip install anymore" This reverts commit 3db37c8f5ac266e7210e012b8992e34ba6a647a6. --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9423a12f..ff487d3a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,6 +89,8 @@ jobs: - uses: actions/checkout@v2 with: submodules: 'recursive' + - name: Install local Python packages + run: pip install . - name: Build Software working-directory: target/snitch_cluster run: | @@ -140,6 +142,8 @@ jobs: - uses: actions/checkout@v2 with: submodules: 'recursive' + - name: Install local Python packages + run: pip install . - name: Build Software run: | bender vendor init From 2ef9503ea17f5b2547e1aa7aaba2bec23874c3c3 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 5 Sep 2024 09:30:57 +0200 Subject: [PATCH 096/130] container: Add LLVM to path for `clang-format` --- util/container/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 9e5600941..fc4a1e207 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -133,3 +133,4 @@ ENV VLT_ROOT="/usr/local/bin/verilator/" ENV LLVM_BINROOT="/tools/riscv-llvm/bin" ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" ENV PATH="/tools/bin:${PATH}" +ENV PATH="/tools/riscv-llvm/bin:${PATH}" From eb4079028692ec6c0bff0af67a61f252f340da02 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 5 Sep 2024 09:31:18 +0200 Subject: [PATCH 097/130] container: Don't set `tools` as workdir --- util/container/Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index fc4a1e207..b6b530dd5 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -90,8 +90,6 @@ LABEL description="Snitch container for hardware and software development." LABEL maintainer="zarubaf@iis.ee.ethz.ch" LABEL org.opencontainers.image.source=https://github.com/pulp-platform/snitch_cluster -WORKDIR /tools - RUN apt update && \ apt install -y --no-install-recommends \ # General requirements From 533696fe1bdd6d9fcfd4dfdaf883e824a79867f1 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 5 Sep 2024 09:36:53 +0200 Subject: [PATCH 098/130] ci: Bump python and verilator version for IIS setup --- iis-setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iis-setup.sh b/iis-setup.sh index ad348be21..37b47414f 100755 --- a/iis-setup.sh +++ b/iis-setup.sh @@ -8,12 +8,12 @@ export BENDER=bender-0.27.1 export CC=gcc-9.2.0 export CXX=g++-9.2.0 export VCS_SEPP=vcs-2020.12 -export VERILATOR_SEPP=verilator-5.006 +export VERILATOR_SEPP=verilator-5.020 export QUESTA_SEPP=questa-2022.3 export LLVM_BINROOT=/usr/pack/riscv-1.0-kgf/pulp-llvm-0.12.0/bin # Create Python virtual environment with required packages -/usr/local/anaconda3-2022.05/bin/python3 -m venv .venv +/usr/local/anaconda3/bin/python -m venv .venv source .venv/bin/activate # Install local packages in editable mode and unpack packages in a # local temporary directory which can be safely cleaned after installation. From 05e9fdd05c37d8b7fee49708c9ac001f39ff7ca2 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 5 Sep 2024 09:51:09 +0200 Subject: [PATCH 099/130] ci: fix syntax mistake --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff487d3a8..1925b25bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,7 +101,7 @@ jobs: make CFG_OVERRIDE=cfg/github-ci.hjson rtl - name: Extract file list for Verilator build run: | - echo "VLT_SOURCES=$(make echo-vlt-flist) >> $GITHUB_ENV + echo "VLT_SOURCES=$(make echo-vlt-flist)" >> $GITHUB_ENV echo $VLT_SOURCES echo $GITHUB_ENV - name: Set up cache for Verilator build From 4a35a9ccad609c5d7775977ba64f133f3af35366 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 5 Sep 2024 10:11:46 +0200 Subject: [PATCH 100/130] container: Install `device-tree-compiler` --- util/container/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index b6b530dd5..7e550630b 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -95,7 +95,9 @@ RUN apt update && \ # General requirements curl wget build-essential git \ # Required for python - software-properties-common gnupg2 + software-properties-common gnupg2 \ + # Required for fesvr + device-tree-compiler # Install Python RUN apt-add-repository ppa:deadsnakes/ppa && \ From 923b15be5e9218be770d696d4be34ba2e99a3bf7 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 5 Sep 2024 13:26:06 +0200 Subject: [PATCH 101/130] container: Use verilator as base image for last stage --- util/container/Dockerfile | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 7e550630b..0f8eff287 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -8,12 +8,7 @@ ARG VERILATOR_VERSION=5.020 ARG UBUNTU_VERSION=22.04 -FROM verilator/verilator:v${VERILATOR_VERSION} AS verilator - -RUN which verilator && verilator --version && \ - echo $VERILATOR_ROOT - -# 2. Stage: Install additional IIS tools +# 1. Stage: Install additional IIS tools FROM ubuntu:${UBUNTU_VERSION} AS builder ARG BENDER_VERSION=0.27.1 ARG DOXYGEN_VERSION=1.12.0 @@ -69,7 +64,7 @@ echo "SNITCH_LLVM_VERSION=${SNITCH_LLVM_VERSION} LLVM_TAR=${LLVM_TAR} latest_tag wget -qO- https://github.com/pulp-platform/llvm-project/releases/download/${SNITCH_LLVM_VERSION}/${LLVM_TAR} | \ tar xvz --strip-components=1 -C riscv-llvm -# 3. Stage: Filter python files to improve caching of the final container +# 2. Stage: Filter python files to improve caching of the final container FROM ubuntu:${UBUNTU_VERSION} AS python_filter # Copy all files in `sw` and `util` and remove all non-python files @@ -79,8 +74,8 @@ COPY util ./util RUN find sw -type f ! -name "*.py" -delete && \ find util -type f ! -name "*.py" -delete -# 4. Stage: Create the final container -FROM ubuntu:${UBUNTU_VERSION} AS snitch_cluster +# 3. Stage: Create the final container +FROM verilator/verilator:v${VERILATOR_VERSION} AS snitch_cluster ARG PYTHON_VERSION=3.11 # Run dpkg without interactive dialogue ARG DEBIAN_FRONTEND=noninteractive @@ -126,10 +121,9 @@ COPY --from=builder /root/.cargo/bin/banshee /tools/bin/ COPY --from=builder /tools/doxygen/bin/doxygen /tools/bin/ COPY --from=builder /tools/verible* /tools/bin/ COPY --from=builder /tools/riscv-llvm /tools/riscv-llvm -COPY --from=verilator /usr/local/bin/verilator* /usr/local/bin/ # Modify environment and path variables -ENV VLT_ROOT="/usr/local/bin/verilator/" +ENV VLT="verilator-wrap.sh" ENV LLVM_BINROOT="/tools/riscv-llvm/bin" ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" ENV PATH="/tools/bin:${PATH}" From f33109ca8c8df7bc912eb91cf0ff34cbc38b0ab5 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 5 Sep 2024 13:26:18 +0200 Subject: [PATCH 102/130] sim: Fix verilator flags --- target/common/common.mk | 4 ++-- target/common/verilator.mk | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target/common/common.mk b/target/common/common.mk index 54a39bd77..c54dff0fd 100644 --- a/target/common/common.mk +++ b/target/common/common.mk @@ -89,9 +89,9 @@ VLT_FLAGS += -Wno-UNSIGNED VLT_FLAGS += -Wno-UNOPTFLAT VLT_FLAGS += -Wno-fatal VLT_FLAGS += --unroll-count 1024 -VLT_FLAGS += --threads $(VLT_NUM_THREADS) +VLT_FLAGS += --threads $(VLT_NUM_THREADS) VLT_CFLAGS += -std=c++20 -pthread -VLT_CFLAGS += -I $(VLT_ROOT)/include -I $(VLT_ROOT)/include/vltstd -I $(VLT_FESVR)/include -I $(TB_DIR) -I ${MKFILE_DIR}test +VLT_CFLAGS += -I $(VLT_FESVR)/include -I $(TB_DIR) -I ${MKFILE_DIR}test RISCV_MC_FLAGS ?= -disassemble -mcpu=snitch ANNOTATE_FLAGS ?= -q --keep-time --addr2line=$(ADDR2LINE) diff --git a/target/common/verilator.mk b/target/common/verilator.mk index dac342907..cd711afea 100644 --- a/target/common/verilator.mk +++ b/target/common/verilator.mk @@ -12,7 +12,7 @@ vlt-flist: $(BIN_DIR)/$(TARGET).vlt: $(VLT_SOURCES) $(TB_CC_SOURCES) $(VLT_CC_SOURCES) $(VLT_BUILDDIR)/lib/libfesvr.a | $(BIN_DIR) $(VLT) $(shell $(BENDER) script verilator $(VLT_BENDER)) \ - $(VLT_FLAGS) -Mdir $(VLT_BUILDDIR) \ + $(VLT_FLAGS) --Mdir $(VLT_BUILDDIR) \ -CFLAGS "$(VLT_CFLAGS)" \ -LDFLAGS "$(VLT_LDFLAGS)" \ -j $(VLT_JOBS) \ From 87578a9baf8a3583a11a5a5a12bf4940379898cb Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 5 Sep 2024 13:59:05 +0200 Subject: [PATCH 103/130] ci: Fix typo --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1925b25bc..97206d86c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,7 +101,7 @@ jobs: make CFG_OVERRIDE=cfg/github-ci.hjson rtl - name: Extract file list for Verilator build run: | - echo "VLT_SOURCES=$(make echo-vlt-flist)" >> $GITHUB_ENV + echo "VLT_SOURCES=$(make vlt-flist)" >> $GITHUB_ENV echo $VLT_SOURCES echo $GITHUB_ENV - name: Set up cache for Verilator build From 9a6f4c807795301ddbe6aadb65c74284d776afdb Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 5 Sep 2024 14:09:56 +0200 Subject: [PATCH 104/130] ci: Fix working directory --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97206d86c..6c54c49ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -100,6 +100,7 @@ jobs: run: | make CFG_OVERRIDE=cfg/github-ci.hjson rtl - name: Extract file list for Verilator build + working-directory: target/snitch_cluster run: | echo "VLT_SOURCES=$(make vlt-flist)" >> $GITHUB_ENV echo $VLT_SOURCES From 2db8af9a8fec036838ad239aa547e1ba28ffaa1d Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 5 Sep 2024 14:11:39 +0200 Subject: [PATCH 105/130] container: Remove unused `apt-requirements.txt` --- apt-requirements.txt | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 apt-requirements.txt diff --git a/apt-requirements.txt b/apt-requirements.txt deleted file mode 100644 index 15f12e8b7..000000000 --- a/apt-requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright 2020 ETH Zurich and University of Bologna. -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# SPDX-License-Identifier: Apache-2.0 - -# Keep sorted. -clang-format -device-tree-compiler -graphviz -tar From 4c599d471a934846f1304b7a0c570ea49d1c654f Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 5 Sep 2024 14:14:11 +0200 Subject: [PATCH 106/130] ci: Remove pip installs again --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c54c49ec..b9e009773 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,8 +89,6 @@ jobs: - uses: actions/checkout@v2 with: submodules: 'recursive' - - name: Install local Python packages - run: pip install . - name: Build Software working-directory: target/snitch_cluster run: | @@ -143,8 +141,6 @@ jobs: - uses: actions/checkout@v2 with: submodules: 'recursive' - - name: Install local Python packages - run: pip install . - name: Build Software run: | bender vendor init From 2cbfa203a006a4632a2967125a6d522836ae2912 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 5 Sep 2024 14:34:02 +0200 Subject: [PATCH 107/130] ci: Separate `vlt-flist` with commas --- target/common/verilator.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/common/verilator.mk b/target/common/verilator.mk index cd711afea..0740c1a0f 100644 --- a/target/common/verilator.mk +++ b/target/common/verilator.mk @@ -8,7 +8,7 @@ VLT_FLIST += $(VLT_CC_SOURCES) .PHONY: vlt-flist vlt-flist: - @echo $(VLT_FLIST) + @echo $(subst $(space),$(comma),$(VLT_FLIST)) $(BIN_DIR)/$(TARGET).vlt: $(VLT_SOURCES) $(TB_CC_SOURCES) $(VLT_CC_SOURCES) $(VLT_BUILDDIR)/lib/libfesvr.a | $(BIN_DIR) $(VLT) $(shell $(BENDER) script verilator $(VLT_BENDER)) \ From c85749907126214c726f3bc8f52351c551845210 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 5 Sep 2024 14:53:23 +0200 Subject: [PATCH 108/130] ci: Correct flist for verilator build caching --- target/common/verilator.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/common/verilator.mk b/target/common/verilator.mk index 0740c1a0f..92968bf3b 100644 --- a/target/common/verilator.mk +++ b/target/common/verilator.mk @@ -6,6 +6,9 @@ VLT_FLIST = $(VLT_SOURCES) VLT_FLIST += $(TB_CC_SOURCES) VLT_FLIST += $(VLT_CC_SOURCES) +space := $(subst ,, ) +comma := , +# Dumps file list separated by commas, for Github caching of verilator build .PHONY: vlt-flist vlt-flist: @echo $(subst $(space),$(comma),$(VLT_FLIST)) From c15ca10b473da63ee5aa123c2ca37b2369174b23 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 5 Sep 2024 16:18:57 +0200 Subject: [PATCH 109/130] ci: Try stripping --- target/common/verilator.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/common/verilator.mk b/target/common/verilator.mk index 92968bf3b..0894b8ee7 100644 --- a/target/common/verilator.mk +++ b/target/common/verilator.mk @@ -11,7 +11,7 @@ comma := , # Dumps file list separated by commas, for Github caching of verilator build .PHONY: vlt-flist vlt-flist: - @echo $(subst $(space),$(comma),$(VLT_FLIST)) + @echo $(subst $(space),$(comma),$(strip $(VLT_FLIST))) $(BIN_DIR)/$(TARGET).vlt: $(VLT_SOURCES) $(TB_CC_SOURCES) $(VLT_CC_SOURCES) $(VLT_BUILDDIR)/lib/libfesvr.a | $(BIN_DIR) $(VLT) $(shell $(BENDER) script verilator $(VLT_BENDER)) \ From a4129829dd5a2f9a12fcfb313084686718bd32c3 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 5 Sep 2024 16:59:27 +0200 Subject: [PATCH 110/130] ci: Debug --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b9e009773..f051f7ebc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,8 +101,7 @@ jobs: working-directory: target/snitch_cluster run: | echo "VLT_SOURCES=$(make vlt-flist)" >> $GITHUB_ENV - echo $VLT_SOURCES - echo $GITHUB_ENV + echo $(make vlt-flist) - name: Set up cache for Verilator build id: verilator-cache uses: actions/cache@v3 From 3dfdbfc268a143e2807037998036daf9d7d4155c Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 5 Sep 2024 17:15:47 +0200 Subject: [PATCH 111/130] ci: Use simpler file hashing for caching --- .github/workflows/ci.yml | 7 +------ target/common/verilator.mk | 11 ----------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f051f7ebc..4660131fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,17 +97,12 @@ jobs: working-directory: target/snitch_cluster run: | make CFG_OVERRIDE=cfg/github-ci.hjson rtl - - name: Extract file list for Verilator build - working-directory: target/snitch_cluster - run: | - echo "VLT_SOURCES=$(make vlt-flist)" >> $GITHUB_ENV - echo $(make vlt-flist) - name: Set up cache for Verilator build id: verilator-cache uses: actions/cache@v3 with: path: target/snitch_cluster/bin - key: verilator-${{ hashFiles(env.VLT_SOURCES) }} + key: verilator-${{ hashFiles('Bender.lock', 'hw/**/*.sv', 'target/**/*.sv') }} restore-keys: | verilator- - name: Build Hardware diff --git a/target/common/verilator.mk b/target/common/verilator.mk index 0894b8ee7..eb02ee346 100644 --- a/target/common/verilator.mk +++ b/target/common/verilator.mk @@ -2,17 +2,6 @@ # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 -VLT_FLIST = $(VLT_SOURCES) -VLT_FLIST += $(TB_CC_SOURCES) -VLT_FLIST += $(VLT_CC_SOURCES) - -space := $(subst ,, ) -comma := , -# Dumps file list separated by commas, for Github caching of verilator build -.PHONY: vlt-flist -vlt-flist: - @echo $(subst $(space),$(comma),$(strip $(VLT_FLIST))) - $(BIN_DIR)/$(TARGET).vlt: $(VLT_SOURCES) $(TB_CC_SOURCES) $(VLT_CC_SOURCES) $(VLT_BUILDDIR)/lib/libfesvr.a | $(BIN_DIR) $(VLT) $(shell $(BENDER) script verilator $(VLT_BENDER)) \ $(VLT_FLAGS) --Mdir $(VLT_BUILDDIR) \ From 4381f4438619eacf9c8246c44e3bf37bcc5d53ef Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 5 Sep 2024 17:42:18 +0200 Subject: [PATCH 112/130] doc: Update container documentation --- util/container/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/container/README.md b/util/container/README.md index ffc8305eb..714e55a13 100644 --- a/util/container/README.md +++ b/util/container/README.md @@ -28,7 +28,7 @@ In case you cannot use the pre-built container, e.g. if you need to make changes container locally by running the following command in the root of the repository: ```shell -$ sudo docker build -t ghcr.io/pulp-platform/snitch_cluster:main -f util/container/Dockerfile . +$ sudo docker buildx build -t ghcr.io/pulp-platform/snitch_cluster:main -f util/container/Dockerfile . ``` ## Usage From 73510b56a33794b560e1078aaa2403aee3acb3c1 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 5 Sep 2024 18:12:28 +0200 Subject: [PATCH 113/130] ci: Revert publish doc --- .github/workflows/publish-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 99dd304e1..23a53bf4a 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -11,7 +11,7 @@ jobs: name: Deploy documentation runs-on: ubuntu-22.04 container: - image: ghcr.io/pulp-platform/snitch_cluster:pyproject + image: ghcr.io/pulp-platform/snitch_cluster:main steps: - uses: actions/checkout@v2 # For some reason, the checkout is done by a different user, From 51dcd8ed19bc22f26c7d636d888c9c3aaf650b40 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 5 Sep 2024 18:22:04 +0200 Subject: [PATCH 114/130] ci: Also run on draft pull requests --- .github/workflows/ci.yml | 10 +--------- .github/workflows/gitlab-ci.yaml | 1 - .github/workflows/lint.yml | 8 -------- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4660131fd..760acbed5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,10 +4,7 @@ # Run functional regression checks name: ci -on: - push: - pull_request: - types: [opened, synchronize, reopened, ready_for_review] +on: [push, pull_request] jobs: @@ -18,7 +15,6 @@ jobs: build-docker: name: Deploy Docker image runs-on: ubuntu-22.04 - if: github.event.pull_request.draft == false steps: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main @@ -50,7 +46,6 @@ jobs: name: Build documentation runs-on: ubuntu-22.04 needs: build-docker - if: github.event.pull_request.draft == false container: image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} steps: @@ -66,7 +61,6 @@ jobs: name: Python unit tests runs-on: ubuntu-22.04 needs: build-docker - if: github.event.pull_request.draft == false container: image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} steps: @@ -82,7 +76,6 @@ jobs: name: Simulate SW on Snitch Cluster w/ Verilator runs-on: ubuntu-22.04 needs: build-docker - if: github.event.pull_request.draft == false container: image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} steps: @@ -128,7 +121,6 @@ jobs: name: Simulate SW on Snitch Cluster w/ Banshee runs-on: ubuntu-22.04 needs: build-docker - if: github.event.pull_request.draft == false container: image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} steps: diff --git a/.github/workflows/gitlab-ci.yaml b/.github/workflows/gitlab-ci.yaml index 5415e8d49..e367a594b 100644 --- a/.github/workflows/gitlab-ci.yaml +++ b/.github/workflows/gitlab-ci.yaml @@ -9,7 +9,6 @@ jobs: gitlab-ci: name: Internal Gitlab CI runs-on: ubuntu-22.04 - if: github.event.pull_request.draft == false steps: - name: Check Gitlab CI uses: pulp-platform/pulp-actions/gitlab-ci@v2.1.0 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e69d01899..7e2a552d1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,7 +14,6 @@ jobs: verible-lint: name: Lint Verilog sources runs-on: ubuntu-latest - if: github.event.pull_request.draft == false steps: - uses: actions/checkout@v3 - uses: chipsalliance/verible-linter-action@main @@ -33,7 +32,6 @@ jobs: bender-vendor-up-to-date: name: Check bender vendor up-to-date runs-on: ubuntu-latest - if: github.event.pull_request.draft == false steps: - name: Check bender vendor up-to-date uses: pulp-platform/pulp-actions/bender-vendor-up-to-date@v2.1.0 @@ -44,7 +42,6 @@ jobs: sources-up-to-date: name: Check Sources Up-to-Date runs-on: ubuntu-22.04 - if: github.event.pull_request.draft == false steps: - uses: actions/checkout@v4 with: @@ -76,7 +73,6 @@ jobs: license-lint: name: Check License headers runs-on: ubuntu-latest - if: github.event.pull_request.draft == false steps: - name: Check License uses: pulp-platform/pulp-actions/lint-license@v2.1.0 @@ -100,7 +96,6 @@ jobs: yaml-lint: name: Lint YAML Sources runs-on: ubuntu-latest - if: github.event.pull_request.draft == false steps: - uses: actions/checkout@v3 - name: yaml-lint @@ -113,7 +108,6 @@ jobs: ######################## python-lint: runs-on: ubuntu-latest - if: github.event.pull_request.draft == false name: Lint Python Sources steps: - name: Check out source repository @@ -135,7 +129,6 @@ jobs: clangfmt: name: Lint C/C++ Sources runs-on: ubuntu-latest - if: github.event.pull_request.draft == false steps: - uses: actions/checkout@v3 - uses: DoozyX/clang-format-lint-action@v0.18.1 @@ -149,7 +142,6 @@ jobs: editorconfig-lint: name: Lint Editorconfig runs-on: ubuntu-latest - if: github.event.pull_request.draft == false steps: - uses: actions/checkout@v3 - uses: editorconfig-checker/action-editorconfig-checker@main From a8d9358b28be9150b815e34953b18157e9f4a462 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 5 Sep 2024 18:22:33 +0200 Subject: [PATCH 115/130] ci: Run on internal push and external pull requests --- .github/workflows/ci.yml | 15 +++++++++++++++ .github/workflows/lint.yml | 24 ++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 760acbed5..2b07ac928 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,9 @@ jobs: build-docker: name: Deploy Docker image runs-on: ubuntu-22.04 + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository steps: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main @@ -46,6 +49,9 @@ jobs: name: Build documentation runs-on: ubuntu-22.04 needs: build-docker + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository container: image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} steps: @@ -61,6 +67,9 @@ jobs: name: Python unit tests runs-on: ubuntu-22.04 needs: build-docker + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository container: image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} steps: @@ -76,6 +85,9 @@ jobs: name: Simulate SW on Snitch Cluster w/ Verilator runs-on: ubuntu-22.04 needs: build-docker + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository container: image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} steps: @@ -121,6 +133,9 @@ jobs: name: Simulate SW on Snitch Cluster w/ Banshee runs-on: ubuntu-22.04 needs: build-docker + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository container: image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} steps: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7e2a552d1..f36145f0b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,6 +14,9 @@ jobs: verible-lint: name: Lint Verilog sources runs-on: ubuntu-latest + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository steps: - uses: actions/checkout@v3 - uses: chipsalliance/verible-linter-action@main @@ -32,6 +35,9 @@ jobs: bender-vendor-up-to-date: name: Check bender vendor up-to-date runs-on: ubuntu-latest + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository steps: - name: Check bender vendor up-to-date uses: pulp-platform/pulp-actions/bender-vendor-up-to-date@v2.1.0 @@ -42,6 +48,9 @@ jobs: sources-up-to-date: name: Check Sources Up-to-Date runs-on: ubuntu-22.04 + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository steps: - uses: actions/checkout@v4 with: @@ -73,6 +82,9 @@ jobs: license-lint: name: Check License headers runs-on: ubuntu-latest + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository steps: - name: Check License uses: pulp-platform/pulp-actions/lint-license@v2.1.0 @@ -96,6 +108,9 @@ jobs: yaml-lint: name: Lint YAML Sources runs-on: ubuntu-latest + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository steps: - uses: actions/checkout@v3 - name: yaml-lint @@ -108,6 +123,9 @@ jobs: ######################## python-lint: runs-on: ubuntu-latest + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository name: Lint Python Sources steps: - name: Check out source repository @@ -129,6 +147,9 @@ jobs: clangfmt: name: Lint C/C++ Sources runs-on: ubuntu-latest + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository steps: - uses: actions/checkout@v3 - uses: DoozyX/clang-format-lint-action@v0.18.1 @@ -142,6 +163,9 @@ jobs: editorconfig-lint: name: Lint Editorconfig runs-on: ubuntu-latest + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository steps: - uses: actions/checkout@v3 - uses: editorconfig-checker/action-editorconfig-checker@main From fa2b1d617ac433974de0b80da6accd01cb50020b Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 5 Sep 2024 18:22:42 +0200 Subject: [PATCH 116/130] ci: Linting --- .github/workflows/gitlab-ci.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gitlab-ci.yaml b/.github/workflows/gitlab-ci.yaml index e367a594b..237b6af31 100644 --- a/.github/workflows/gitlab-ci.yaml +++ b/.github/workflows/gitlab-ci.yaml @@ -13,10 +13,10 @@ jobs: - name: Check Gitlab CI uses: pulp-platform/pulp-actions/gitlab-ci@v2.1.0 # Skip on forks or pull requests from forks due to missing secrets. - if: - # yamllint disable rule:line-length - github.repository == 'pulp-platform/snitch_cluster' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) - # yamllint enable rule:line-length + if: > + github.repository == 'pulp-platform/snitch_cluster' && + (github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name == github.repository) with: domain: iis-git.ee.ethz.ch repo: github-mirror/snitch_cluster From aae1a89e2cf9496efb23217db57a812c57210c91 Mon Sep 17 00:00:00 2001 From: Luca Colagrande Date: Fri, 6 Sep 2024 14:12:04 +0200 Subject: [PATCH 117/130] ci: Hash exact requirements of `bin/snitch_cluster.vlt` --- .github/workflows/ci.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b07ac928..c242c686b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,20 +94,22 @@ jobs: - uses: actions/checkout@v2 with: submodules: 'recursive' - - name: Build Software - working-directory: target/snitch_cluster - run: | - make CFG_OVERRIDE=cfg/github-ci.hjson sw - - name: Generate the RTL + - name: Get Verilator simulation binary hash + id: verilator-hash working-directory: target/snitch_cluster + # yamllint disable rule:line-length run: | - make CFG_OVERRIDE=cfg/github-ci.hjson rtl + wget https://raw.githubusercontent.com/colluca/list-make-prerequisites/main/list-make-prerequisites.py + chmod +x list-make-prerequisites.py + VLT_HASH=$(./list-make-prerequisites.py bin/snitch_cluster.vlt --recursive --hash 2>/dev/null) + echo "VLT_HASH=$VLT_HASH" >> $GITHUB_ENV + # yamllint enable rule:line-length - name: Set up cache for Verilator build id: verilator-cache uses: actions/cache@v3 with: path: target/snitch_cluster/bin - key: verilator-${{ hashFiles('Bender.lock', 'hw/**/*.sv', 'target/**/*.sv') }} + key: verilator-${{ env.VLT_HASH }} restore-keys: | verilator- - name: Build Hardware @@ -115,6 +117,10 @@ jobs: working-directory: target/snitch_cluster run: | make CFG_OVERRIDE=cfg/github-ci.hjson VLT_JOBS=1 bin/snitch_cluster.vlt + - name: Build Software + working-directory: target/snitch_cluster + run: | + make CFG_OVERRIDE=cfg/github-ci.hjson sw - name: Run Tests working-directory: target/snitch_cluster run: | From c6ef3689beaad16719ade3adce794541c87b5c7b Mon Sep 17 00:00:00 2001 From: Luca Colagrande Date: Fri, 6 Sep 2024 14:19:38 +0200 Subject: [PATCH 118/130] ci: Temporarily run `list-make-prerequisites` in debug mode --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c242c686b..4e2fa05de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,6 +101,7 @@ jobs: run: | wget https://raw.githubusercontent.com/colluca/list-make-prerequisites/main/list-make-prerequisites.py chmod +x list-make-prerequisites.py + ./list-make-prerequisites.py bin/snitch_cluster.vlt --recursive --hash --debug VLT_HASH=$(./list-make-prerequisites.py bin/snitch_cluster.vlt --recursive --hash 2>/dev/null) echo "VLT_HASH=$VLT_HASH" >> $GITHUB_ENV # yamllint enable rule:line-length From 01661e5a20fe12837b5124d6be4064d77ccd6a50 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Fri, 6 Sep 2024 13:59:34 +0200 Subject: [PATCH 119/130] env: Fix python version --- iis-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iis-setup.sh b/iis-setup.sh index 37b47414f..c77be7bec 100755 --- a/iis-setup.sh +++ b/iis-setup.sh @@ -13,7 +13,7 @@ export QUESTA_SEPP=questa-2022.3 export LLVM_BINROOT=/usr/pack/riscv-1.0-kgf/pulp-llvm-0.12.0/bin # Create Python virtual environment with required packages -/usr/local/anaconda3/bin/python -m venv .venv +/usr/local/anaconda3-2023.07/bin/python -m venv .venv source .venv/bin/activate # Install local packages in editable mode and unpack packages in a # local temporary directory which can be safely cleaned after installation. From f68bfaea12431c4355baf05041f7cef45fbf0812 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Fri, 6 Sep 2024 14:28:32 +0200 Subject: [PATCH 120/130] container: Merge run commands --- util/container/Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 0f8eff287..12ec58a6b 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -92,10 +92,9 @@ RUN apt update && \ # Required for python software-properties-common gnupg2 \ # Required for fesvr - device-tree-compiler - -# Install Python -RUN apt-add-repository ppa:deadsnakes/ppa && \ + device-tree-compiler && \ + # Install Python + apt-add-repository ppa:deadsnakes/ppa && \ apt update && \ apt install -y --no-install-recommends \ python${PYTHON_VERSION}-venv && \ From 08f4840678fc0f30530b5de56799c6e2158d8972 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Fri, 6 Sep 2024 14:36:05 +0200 Subject: [PATCH 121/130] container: Use `.dockerignore` to filter python files --- .dockerignore | 4 ++++ util/container/Dockerfile | 16 +++------------- 2 files changed, 7 insertions(+), 13 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..9b6a1acdf --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +* +!sw/**/*.py +!util/**/*.py +!pyproject.toml diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 12ec58a6b..0bf25ac8b 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -64,17 +64,7 @@ echo "SNITCH_LLVM_VERSION=${SNITCH_LLVM_VERSION} LLVM_TAR=${LLVM_TAR} latest_tag wget -qO- https://github.com/pulp-platform/llvm-project/releases/download/${SNITCH_LLVM_VERSION}/${LLVM_TAR} | \ tar xvz --strip-components=1 -C riscv-llvm -# 2. Stage: Filter python files to improve caching of the final container -FROM ubuntu:${UBUNTU_VERSION} AS python_filter - -# Copy all files in `sw` and `util` and remove all non-python files -COPY sw ./sw -COPY util ./util - -RUN find sw -type f ! -name "*.py" -delete && \ - find util -type f ! -name "*.py" -delete - -# 3. Stage: Create the final container +# 2. Stage: Create the final container FROM verilator/verilator:v${VERILATOR_VERSION} AS snitch_cluster ARG PYTHON_VERSION=3.11 # Run dpkg without interactive dialogue @@ -103,8 +93,8 @@ RUN apt update && \ # Copy all needed files to install the package COPY pyproject.toml . -COPY --from=python_filter sw ./sw -COPY --from=python_filter util ./util +COPY sw ./sw +COPY util ./util # Create and activate virtual environment ARG VIRTUAL_ENV="/root/.venvs/snitch_cluster" From 4f89a6f9fb4052b8cceaab57e1a5ab9d530d7795 Mon Sep 17 00:00:00 2001 From: Luca Colagrande Date: Fri, 6 Sep 2024 16:47:28 +0200 Subject: [PATCH 122/130] ci: Use `list-make-prerequisites` action --- .github/workflows/ci.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e2fa05de..07a0be0d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,23 +94,19 @@ jobs: - uses: actions/checkout@v2 with: submodules: 'recursive' - - name: Get Verilator simulation binary hash + - name: Hash Verilator prerequisites id: verilator-hash - working-directory: target/snitch_cluster - # yamllint disable rule:line-length - run: | - wget https://raw.githubusercontent.com/colluca/list-make-prerequisites/main/list-make-prerequisites.py - chmod +x list-make-prerequisites.py - ./list-make-prerequisites.py bin/snitch_cluster.vlt --recursive --hash --debug - VLT_HASH=$(./list-make-prerequisites.py bin/snitch_cluster.vlt --recursive --hash 2>/dev/null) - echo "VLT_HASH=$VLT_HASH" >> $GITHUB_ENV - # yamllint enable rule:line-length + uses: colluca/list-make-prerequisites@v1.0.1 + with: + working-directory: target/snitch_cluster + target: bin/snitch_cluster.vlt + flags: --recursive - name: Set up cache for Verilator build id: verilator-cache uses: actions/cache@v3 with: path: target/snitch_cluster/bin - key: verilator-${{ env.VLT_HASH }} + key: verilator-${{ steps.verilator-hash.outputs.hash }} restore-keys: | verilator- - name: Build Hardware From 79a03dffed611c947287a06ed038a4f6e31d9424 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 10 Sep 2024 09:05:53 +0200 Subject: [PATCH 123/130] container: Use `non-interactive` in every stage --- util/container/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 0bf25ac8b..28910e6a5 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -16,6 +16,8 @@ ARG VERIBLE_VERSION=0.0-3318-g8d254167 ARG SNITCH_LLVM_VERSION=latest ARG RUST_VERSION=1.63.0 ARG UBUNTU_VERSION +# Run dpkg without interactive dialogue +ARG DEBIAN_FRONTEND=noninteractive # Install APT requirements RUN apt update && \ From 25fc2942865c0901c8dce6cb5223355e2ebb871e Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 10 Sep 2024 09:06:20 +0200 Subject: [PATCH 124/130] container: Replace `apt` with `apt-get` --- util/container/Dockerfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 28910e6a5..3c1afffc1 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -20,8 +20,8 @@ ARG UBUNTU_VERSION ARG DEBIAN_FRONTEND=noninteractive # Install APT requirements -RUN apt update && \ - apt install -y \ +RUN apt-get update && \ + apt-get install -y \ # General requirements curl wget git tar \ # Required for rust @@ -77,8 +77,8 @@ LABEL description="Snitch container for hardware and software development." LABEL maintainer="zarubaf@iis.ee.ethz.ch" LABEL org.opencontainers.image.source=https://github.com/pulp-platform/snitch_cluster -RUN apt update && \ - apt install -y --no-install-recommends \ +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ # General requirements curl wget build-essential git \ # Required for python @@ -87,10 +87,10 @@ RUN apt update && \ device-tree-compiler && \ # Install Python apt-add-repository ppa:deadsnakes/ppa && \ - apt update && \ - apt install -y --no-install-recommends \ + apt-get update && \ + apt-get install -y --no-install-recommends \ python${PYTHON_VERSION}-venv && \ - apt clean && \ + apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* # Copy all needed files to install the package From 3ce30482a3765072701b0dfdcad9fdfd9e50905b Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 10 Sep 2024 09:27:23 +0200 Subject: [PATCH 125/130] ci: Use `build-docker` workflow as dependency for other workflows --- .github/workflows/build-docker.yml | 42 ++++++++++++++++++++++ .github/workflows/ci.yml | 58 +++++------------------------- .github/workflows/lint.yml | 41 ++++----------------- 3 files changed, 57 insertions(+), 84 deletions(-) create mode 100644 .github/workflows/build-docker.yml diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml new file mode 100644 index 000000000..6ece706ac --- /dev/null +++ b/.github/workflows/build-docker.yml @@ -0,0 +1,42 @@ +# Copyright 2020 ETH Zurich and University of Bologna. +# Licensed under the Apache License, Version 2.0, see LICENSE for details. +# SPDX-License-Identifier: Apache-2.0 + +name: build-docker +on: [push, pull_request] + +jobs: + + ########################## + # Build Docker Container # + ########################## + + build-docker: + name: Deploy Docker image + runs-on: ubuntu-22.04 + # Skip pull requests from internal contributors. + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository + steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + docker-images: false + - uses: actions/checkout@v4 + - uses: docker/setup-buildx-action@v3 + - name: GHCR Log-in + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + cache-from: type=gha + cache-to: type=gha,mode=max` + file: util/container/Dockerfile + push: true + tags: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07a0be0d7..2b4d3ffde 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,43 +4,13 @@ # Run functional regression checks name: ci -on: [push, pull_request] +on: + workflow_run: + workflows: [build-docker] + types: [completed] jobs: - ########################## - # Build Docker Container # - ########################## - - build-docker: - name: Deploy Docker image - runs-on: ubuntu-22.04 - if: > - github.event_name != 'pull_request' || - github.event.pull_request.head.repo.full_name != github.repository - steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - docker-images: false - - uses: actions/checkout@v4 - - uses: docker/setup-buildx-action@v3 - - name: GHCR Log-in - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v6 - with: - context: . - cache-from: type=gha - cache-to: type=gha,mode=max` - file: util/container/Dockerfile - push: true - tags: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} - ######## # Docs # ######## @@ -48,12 +18,9 @@ jobs: docs: name: Build documentation runs-on: ubuntu-22.04 - needs: build-docker - if: > - github.event_name != 'pull_request' || - github.event.pull_request.head.repo.full_name != github.repository container: image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} + if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - uses: actions/checkout@v2 - name: Build docs @@ -66,12 +33,9 @@ jobs: pytest: name: Python unit tests runs-on: ubuntu-22.04 - needs: build-docker - if: > - github.event_name != 'pull_request' || - github.event.pull_request.head.repo.full_name != github.repository container: image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} + if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - uses: actions/checkout@v2 - name: Run pytest @@ -84,12 +48,9 @@ jobs: sw-snitch-cluster-vlt: name: Simulate SW on Snitch Cluster w/ Verilator runs-on: ubuntu-22.04 - needs: build-docker - if: > - github.event_name != 'pull_request' || - github.event.pull_request.head.repo.full_name != github.repository container: image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} + if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - uses: actions/checkout@v2 with: @@ -135,12 +96,9 @@ jobs: sw-snitch-cluster-banshee: name: Simulate SW on Snitch Cluster w/ Banshee runs-on: ubuntu-22.04 - needs: build-docker - if: > - github.event_name != 'pull_request' || - github.event.pull_request.head.repo.full_name != github.repository container: image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} + if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - uses: actions/checkout@v2 with: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f36145f0b..67518f30c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,7 +4,10 @@ # Run all lint checks name: lint -on: [push, pull_request] +on: + workflow_run: + workflows: [build-docker] + types: [completed] jobs: @@ -14,9 +17,6 @@ jobs: verible-lint: name: Lint Verilog sources runs-on: ubuntu-latest - if: > - github.event_name != 'pull_request' || - github.event.pull_request.head.repo.full_name != github.repository steps: - uses: actions/checkout@v3 - uses: chipsalliance/verible-linter-action@main @@ -35,9 +35,6 @@ jobs: bender-vendor-up-to-date: name: Check bender vendor up-to-date runs-on: ubuntu-latest - if: > - github.event_name != 'pull_request' || - github.event.pull_request.head.repo.full_name != github.repository steps: - name: Check bender vendor up-to-date uses: pulp-platform/pulp-actions/bender-vendor-up-to-date@v2.1.0 @@ -48,22 +45,13 @@ jobs: sources-up-to-date: name: Check Sources Up-to-Date runs-on: ubuntu-22.04 - if: > - github.event_name != 'pull_request' || - github.event.pull_request.head.repo.full_name != github.repository + container: + image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} + if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - uses: actions/checkout@v4 with: submodules: true - - name: Install bender - uses: pulp-platform/pulp-actions/bender-install@v2 - - uses: actions/setup-python@v5 - with: - python-version: '3.10' - cache: 'pip' - - name: Install pip dependencies - run: | - pip install . - name: Generate opcodes run: | ./util/generate-opcodes.sh @@ -82,9 +70,6 @@ jobs: license-lint: name: Check License headers runs-on: ubuntu-latest - if: > - github.event_name != 'pull_request' || - github.event.pull_request.head.repo.full_name != github.repository steps: - name: Check License uses: pulp-platform/pulp-actions/lint-license@v2.1.0 @@ -108,9 +93,6 @@ jobs: yaml-lint: name: Lint YAML Sources runs-on: ubuntu-latest - if: > - github.event_name != 'pull_request' || - github.event.pull_request.head.repo.full_name != github.repository steps: - uses: actions/checkout@v3 - name: yaml-lint @@ -123,9 +105,6 @@ jobs: ######################## python-lint: runs-on: ubuntu-latest - if: > - github.event_name != 'pull_request' || - github.event.pull_request.head.repo.full_name != github.repository name: Lint Python Sources steps: - name: Check out source repository @@ -147,9 +126,6 @@ jobs: clangfmt: name: Lint C/C++ Sources runs-on: ubuntu-latest - if: > - github.event_name != 'pull_request' || - github.event.pull_request.head.repo.full_name != github.repository steps: - uses: actions/checkout@v3 - uses: DoozyX/clang-format-lint-action@v0.18.1 @@ -163,9 +139,6 @@ jobs: editorconfig-lint: name: Lint Editorconfig runs-on: ubuntu-latest - if: > - github.event_name != 'pull_request' || - github.event.pull_request.head.repo.full_name != github.repository steps: - uses: actions/checkout@v3 - uses: editorconfig-checker/action-editorconfig-checker@main From d1cf2d03224d225ef3497aa6341ddc7a9a152e82 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 10 Sep 2024 10:22:33 +0200 Subject: [PATCH 126/130] ci: Don't run `build-docker` for `pull_requests` Otherwise it doesn't report as complete if skipped --- .github/workflows/build-docker.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 6ece706ac..d37bc3a69 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 name: build-docker -on: [push, pull_request] +on: [push, workflow_dispatch] jobs: @@ -14,10 +14,6 @@ jobs: build-docker: name: Deploy Docker image runs-on: ubuntu-22.04 - # Skip pull requests from internal contributors. - if: > - github.event_name != 'pull_request' || - github.event.pull_request.head.repo.full_name != github.repository steps: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main From c48bc105149ae40b390c9c56eec58257852d241f Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 10 Sep 2024 12:04:01 +0200 Subject: [PATCH 127/130] Revert "ci: Don't run `build-docker` for `pull_requests`" This reverts commit d1cf2d03224d225ef3497aa6341ddc7a9a152e82. --- .github/workflows/build-docker.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index d37bc3a69..6ece706ac 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 name: build-docker -on: [push, workflow_dispatch] +on: [push, pull_request] jobs: @@ -14,6 +14,10 @@ jobs: build-docker: name: Deploy Docker image runs-on: ubuntu-22.04 + # Skip pull requests from internal contributors. + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository steps: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main From e78d17b551e15a2efb6dc08ed33287770ad9ca52 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 10 Sep 2024 12:04:06 +0200 Subject: [PATCH 128/130] Revert "ci: Use `build-docker` workflow as dependency for other workflows" This reverts commit 3ce30482a3765072701b0dfdcad9fdfd9e50905b. --- .github/workflows/build-docker.yml | 42 ---------------------- .github/workflows/ci.yml | 58 +++++++++++++++++++++++++----- .github/workflows/lint.yml | 41 +++++++++++++++++---- 3 files changed, 84 insertions(+), 57 deletions(-) delete mode 100644 .github/workflows/build-docker.yml diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml deleted file mode 100644 index 6ece706ac..000000000 --- a/.github/workflows/build-docker.yml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2020 ETH Zurich and University of Bologna. -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# SPDX-License-Identifier: Apache-2.0 - -name: build-docker -on: [push, pull_request] - -jobs: - - ########################## - # Build Docker Container # - ########################## - - build-docker: - name: Deploy Docker image - runs-on: ubuntu-22.04 - # Skip pull requests from internal contributors. - if: > - github.event_name != 'pull_request' || - github.event.pull_request.head.repo.full_name != github.repository - steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - docker-images: false - - uses: actions/checkout@v4 - - uses: docker/setup-buildx-action@v3 - - name: GHCR Log-in - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v6 - with: - context: . - cache-from: type=gha - cache-to: type=gha,mode=max` - file: util/container/Dockerfile - push: true - tags: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b4d3ffde..07a0be0d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,13 +4,43 @@ # Run functional regression checks name: ci -on: - workflow_run: - workflows: [build-docker] - types: [completed] +on: [push, pull_request] jobs: + ########################## + # Build Docker Container # + ########################## + + build-docker: + name: Deploy Docker image + runs-on: ubuntu-22.04 + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository + steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + docker-images: false + - uses: actions/checkout@v4 + - uses: docker/setup-buildx-action@v3 + - name: GHCR Log-in + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + cache-from: type=gha + cache-to: type=gha,mode=max` + file: util/container/Dockerfile + push: true + tags: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} + ######## # Docs # ######## @@ -18,9 +48,12 @@ jobs: docs: name: Build documentation runs-on: ubuntu-22.04 + needs: build-docker + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository container: image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} - if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - uses: actions/checkout@v2 - name: Build docs @@ -33,9 +66,12 @@ jobs: pytest: name: Python unit tests runs-on: ubuntu-22.04 + needs: build-docker + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository container: image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} - if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - uses: actions/checkout@v2 - name: Run pytest @@ -48,9 +84,12 @@ jobs: sw-snitch-cluster-vlt: name: Simulate SW on Snitch Cluster w/ Verilator runs-on: ubuntu-22.04 + needs: build-docker + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository container: image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} - if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - uses: actions/checkout@v2 with: @@ -96,9 +135,12 @@ jobs: sw-snitch-cluster-banshee: name: Simulate SW on Snitch Cluster w/ Banshee runs-on: ubuntu-22.04 + needs: build-docker + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository container: image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} - if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - uses: actions/checkout@v2 with: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 67518f30c..f36145f0b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,10 +4,7 @@ # Run all lint checks name: lint -on: - workflow_run: - workflows: [build-docker] - types: [completed] +on: [push, pull_request] jobs: @@ -17,6 +14,9 @@ jobs: verible-lint: name: Lint Verilog sources runs-on: ubuntu-latest + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository steps: - uses: actions/checkout@v3 - uses: chipsalliance/verible-linter-action@main @@ -35,6 +35,9 @@ jobs: bender-vendor-up-to-date: name: Check bender vendor up-to-date runs-on: ubuntu-latest + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository steps: - name: Check bender vendor up-to-date uses: pulp-platform/pulp-actions/bender-vendor-up-to-date@v2.1.0 @@ -45,13 +48,22 @@ jobs: sources-up-to-date: name: Check Sources Up-to-Date runs-on: ubuntu-22.04 - container: - image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} - if: ${{ github.event.workflow_run.conclusion == 'success' }} + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository steps: - uses: actions/checkout@v4 with: submodules: true + - name: Install bender + uses: pulp-platform/pulp-actions/bender-install@v2 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + cache: 'pip' + - name: Install pip dependencies + run: | + pip install . - name: Generate opcodes run: | ./util/generate-opcodes.sh @@ -70,6 +82,9 @@ jobs: license-lint: name: Check License headers runs-on: ubuntu-latest + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository steps: - name: Check License uses: pulp-platform/pulp-actions/lint-license@v2.1.0 @@ -93,6 +108,9 @@ jobs: yaml-lint: name: Lint YAML Sources runs-on: ubuntu-latest + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository steps: - uses: actions/checkout@v3 - name: yaml-lint @@ -105,6 +123,9 @@ jobs: ######################## python-lint: runs-on: ubuntu-latest + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository name: Lint Python Sources steps: - name: Check out source repository @@ -126,6 +147,9 @@ jobs: clangfmt: name: Lint C/C++ Sources runs-on: ubuntu-latest + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository steps: - uses: actions/checkout@v3 - uses: DoozyX/clang-format-lint-action@v0.18.1 @@ -139,6 +163,9 @@ jobs: editorconfig-lint: name: Lint Editorconfig runs-on: ubuntu-latest + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository steps: - uses: actions/checkout@v3 - uses: editorconfig-checker/action-editorconfig-checker@main From 8add9318d20578453ef4b53386a7e57e065bad8b Mon Sep 17 00:00:00 2001 From: Luca Colagrande Date: Thu, 26 Sep 2024 14:17:08 +0200 Subject: [PATCH 129/130] ci: Move sources-up-to-date job from lint to ci Allows us to encode the dependency to the build-docker job --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ .github/workflows/lint.yml | 34 ---------------------------------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07a0be0d7..03c43f15f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -155,3 +155,37 @@ jobs: working-directory: target/snitch_cluster run: | ./util/run.py sw/run.yaml --simulator banshee -j + + ###################### + # Sources Up-to-Date # + ###################### + sources-up-to-date: + name: Check Sources Up-to-Date + runs-on: ubuntu-22.04 + needs: build-docker + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name != github.repository + container: + image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Generate opcodes + run: | + ./util/generate-opcodes.sh + - name: Generate RTL sources + working-directory: target/snitch_cluster + run: | + make rtl + # For some reason, the checkout is done by a different user, + # than that running `git diff` (root, possibly due to Docker). + # So we need to set the repository as a safe directory. + - name: Git config safe.directory + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + - name: Diff porcelain + uses: mmontes11/diff-porcelain@v0.0.1 + with: + message: Found differences, please update all sources diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f36145f0b..152446d3d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -42,40 +42,6 @@ jobs: - name: Check bender vendor up-to-date uses: pulp-platform/pulp-actions/bender-vendor-up-to-date@v2.1.0 - ###################### - # Sources Up-to-Date # - ###################### - sources-up-to-date: - name: Check Sources Up-to-Date - runs-on: ubuntu-22.04 - if: > - github.event_name != 'pull_request' || - github.event.pull_request.head.repo.full_name != github.repository - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install bender - uses: pulp-platform/pulp-actions/bender-install@v2 - - uses: actions/setup-python@v5 - with: - python-version: '3.10' - cache: 'pip' - - name: Install pip dependencies - run: | - pip install . - - name: Generate opcodes - run: | - ./util/generate-opcodes.sh - - name: Generate RTL sources - working-directory: target/snitch_cluster - run: | - make rtl - - name: Diff porcelain - uses: mmontes11/diff-porcelain@v0.0.1 - with: - message: Found differences, please update all sources - ################# # Check License # ################# From f46b68da5f26c087857384cbba4bfa1bca2c8bc8 Mon Sep 17 00:00:00 2001 From: Luca Colagrande Date: Fri, 27 Sep 2024 10:59:28 +0200 Subject: [PATCH 130/130] ci: Temporarily remove Banshee due to dependency error --- .github/workflows/ci.yml | 52 +++++++++++++++++++-------------------- util/container/Dockerfile | 25 ++++++++++--------- 2 files changed, 39 insertions(+), 38 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03c43f15f..d3d44586f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -128,33 +128,33 @@ jobs: run: | make SIM_DIR=./runs/simple annotate -j - ######################################### - # Build SW on Snitch Cluster w/ Banshee # - ######################################### + # ######################################### + # # Build SW on Snitch Cluster w/ Banshee # + # ######################################### - sw-snitch-cluster-banshee: - name: Simulate SW on Snitch Cluster w/ Banshee - runs-on: ubuntu-22.04 - needs: build-docker - if: > - github.event_name != 'pull_request' || - github.event.pull_request.head.repo.full_name != github.repository - container: - image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} - steps: - - uses: actions/checkout@v2 - with: - submodules: 'recursive' - - name: Build Software - run: | - bender vendor init - make -C target/snitch_cluster SELECT_RUNTIME=banshee sw - - name: Run Tests - env: - SNITCH_LOG: info - working-directory: target/snitch_cluster - run: | - ./util/run.py sw/run.yaml --simulator banshee -j + # sw-snitch-cluster-banshee: + # name: Simulate SW on Snitch Cluster w/ Banshee + # runs-on: ubuntu-22.04 + # needs: build-docker + # if: > + # github.event_name != 'pull_request' || + # github.event.pull_request.head.repo.full_name != github.repository + # container: + # image: ghcr.io/pulp-platform/snitch_cluster:${{ github.ref_name }} + # steps: + # - uses: actions/checkout@v2 + # with: + # submodules: 'recursive' + # - name: Build Software + # run: | + # bender vendor init + # make -C target/snitch_cluster SELECT_RUNTIME=banshee sw + # - name: Run Tests + # env: + # SNITCH_LOG: info + # working-directory: target/snitch_cluster + # run: | + # ./util/run.py sw/run.yaml --simulator banshee -j ###################### # Sources Up-to-Date # diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 3c1afffc1..65670487f 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -25,22 +25,23 @@ RUN apt-get update && \ # General requirements curl wget git tar \ # Required for rust - build-essential \ - # Required for banshee - cmake llvm-12-dev libclang-common-12-dev zlib1g-dev + build-essential + #\ + # # Required for banshee + # cmake llvm-12-dev libclang-common-12-dev zlib1g-dev -# Build Rust tools -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -ENV PATH="/root/.cargo/bin:${PATH}" -RUN rustup install ${RUST_VERSION} && \ - rustup override set ${RUST_VERSION} +# # Build Rust tools +# RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +# ENV PATH="/root/.cargo/bin:${PATH}" +# RUN rustup install ${RUST_VERSION} && \ +# rustup override set ${RUST_VERSION} # Change working directory WORKDIR /tools -# Install `banshee` (needs cmake) -RUN git clone https://github.com/pulp-platform/banshee.git /tmp/banshee --recurse-submodules && \ - cargo install --path /tmp/banshee +# # Install `banshee` (needs cmake) +# RUN git clone https://github.com/pulp-platform/banshee.git /tmp/banshee --recurse-submodules && \ +# cargo install --path /tmp/banshee # Install Bender RUN wget https://github.com/pulp-platform/bender/releases/download/v${BENDER_VERSION}/bender-${BENDER_VERSION}-x86_64-linux-gnu-ubuntu${UBUNTU_VERSION}.tar.gz && \ @@ -108,7 +109,7 @@ RUN ${VIRTUAL_ENV}/bin/pip install --upgrade pip && \ # Copy the tools from the builder stage COPY --from=builder /tools/bender /tools/bin/ -COPY --from=builder /root/.cargo/bin/banshee /tools/bin/ +# COPY --from=builder /root/.cargo/bin/banshee /tools/bin/ COPY --from=builder /tools/doxygen/bin/doxygen /tools/bin/ COPY --from=builder /tools/verible* /tools/bin/ COPY --from=builder /tools/riscv-llvm /tools/riscv-llvm