From 1ce6248ecbac5f0f3bdb48ff74b4d3eff0a448f0 Mon Sep 17 00:00:00 2001 From: marton bognar Date: Thu, 19 Mar 2026 12:54:14 +0100 Subject: [PATCH 1/2] Docker setup improvements --- Dockerfile | 6 +++--- README.md | 23 +++++++++++------------ docker-compose.yml | 17 +++++++++++++++-- install-scripts/toolchain.sh | 1 + 4 files changed, 30 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2daa163..0bd2b51 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ ARG DEBIAN_FRONTEND=noninteractive ARG INSTALL_TOOLCHAIN=false ARG INSTALL_EVAL_HD=false ARG INSTALL_PROTEUS=false -ARG INSTALL_RISCV_FORMAL=true +ARG INSTALL_RISCV_FORMAL=false RUN echo "Install RISC-V toolchain: ${INSTALL_TOOLCHAIN}" RUN echo "Install EVAL-HD: ${INSTALL_EVAL_HD}" RUN echo "Setup Proteus core: ${INSTALL_PROTEUS}" @@ -16,7 +16,7 @@ RUN echo "Install riscv-formal: ${INSTALL_RISCV_FORMAL}" # Basic dependencies ################################################################################ -RUN apt-get update && apt-get -yqq install build-essential git openjdk-17-jdk verilator libz-dev gcc-riscv64-unknown-elf python3-pip python3-venv gtkwave scons +RUN apt-get update && apt-get -yqq install build-essential git openjdk-17-jdk verilator libz-dev python3-pip python3-venv gtkwave scons WORKDIR /ecosystem COPY ./benchmarks ./benchmarks @@ -34,7 +34,7 @@ RUN ./install-scripts/sbt.sh RUN ./install-scripts/python-modules.sh WORKDIR /ecosystem -RUN if [ "${INSTALL_TOOLCHAIN}" = "true" ] ; then ./install-scripts/toolchain.sh ; else echo Skipping RISC-V toolchain... ; fi +RUN if [ "${INSTALL_TOOLCHAIN}" = "true" ] ; then ./install-scripts/toolchain.sh ; else echo Skipping RISC-V toolchain, installing apt package...; apt-get -yqq install gcc-riscv64-unknown-elf ; fi RUN if [ "${INSTALL_EVAL_HD}" = "true" ] ; then ./install-scripts/eval-hd.sh ; else echo Skipping EVAL-HD setup... ; fi RUN if [ "${INSTALL_PROTEUS}" = "true" ] ; then ./install-scripts/proteus.sh ; else echo Skipping Proteus core setup... ; fi RUN if [ "${INSTALL_RISCV_FORMAL}" = "true" ] ; then ./install-scripts/riscv-formal.sh ; else echo Skipping riscv-formal setup... ; fi diff --git a/README.md b/README.md index 1da14a9..9128748 100644 --- a/README.md +++ b/README.md @@ -21,29 +21,28 @@ A prebuilt Docker image can be pulled [from GitHub](https://github.com/proteus-c docker pull ghcr.io/proteus-core/ecosystem:latest ``` -### Local container setup - -Alternatively, you can build this image locally with the included [Dockerfile](./Dockerfile). This installs the bare minimum setup for running simulations, with additional flags for installing other components. -The container can be built with the following command: +You can launch this image using the following command: ```shell-session -$ docker compose up +docker compose run --remove-orphans ecosystem-prebuilt ``` -Additional build arguments can be added in `docker-compose.yml`, for example `INSTALL_TOOLCHAIN` to install the RISC-V GNU toolchain, `INSTALL_EVAL_HD` to install the hardware cost evaluation tool and `INSTALL_PROTEUS` to clone and install the Proteus core inside the container (instead of mounting it as a volume). -Note that installing these extra tools will add a substantial amount of time to the build process. - -### Working with the container +### Building the container image -You can launch a container after building: +Alternatively, you can build this image locally with the included [Dockerfile](./Dockerfile). +This installs the bare minimum setup for running simulations, with additional flags for installing other components. +The container can be run (and built on the first run) with the following command: ```shell-session -$ docker compose run --remove-orphans ecosystem +docker compose run --remove-orphans ecosystem ``` +Additional build arguments can be added in `docker-compose.yml`, for example `INSTALL_TOOLCHAIN` to install the RISC-V GNU toolchain, `INSTALL_EVAL_HD` to install the hardware cost evaluation tool and `INSTALL_PROTEUS` to clone and install the Proteus core inside the container (instead of mounting it as a volume). +Note that installing these extra tools will add a substantial amount of time to the build process. + ### Non-container setup -If you want to install the components natively without using Docker, you can follow the steps in the [Dockerfile](./Dockerfile) and the [installation scripts](./install-scripts/) +If you want to install the components natively without using Docker, you can follow the steps in the [Dockerfile](./Dockerfile) and the [installation scripts](./install-scripts/). ## Developing with Proteus diff --git a/docker-compose.yml b/docker-compose.yml index 47d531e..59c2de3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,8 +2,7 @@ services: ecosystem: build: context: . - args: - INSTALL_EVAL_HD: "true" + args: # add more flags here to install EVAL-HD, riscv-formal, ... INSTALL_TOOLCHAIN: "true" container_name: ecosystem restart: "no" @@ -18,3 +17,17 @@ services: - ./install-scripts:/ecosystem/install-scripts - ./formal-verification:/ecosystem/formal-verification command: "/bin/bash" + ecosystem-prebuilt: + image: ghcr.io/proteus-core/ecosystem + restart: "no" + stdin_open: true + tty: true + working_dir: /ecosystem + volumes: + - ./core:/ecosystem/core + - ./synthesis:/ecosystem/synthesis + - ./noninterference-testing:/ecosystem/noninterference-testing + - ./waveform-analysis:/ecosystem/waveform-analysis + - ./install-scripts:/ecosystem/install-scripts + - ./formal-verification:/ecosystem/formal-verification + command: "/bin/bash" diff --git a/install-scripts/toolchain.sh b/install-scripts/toolchain.sh index 9e2325a..6aeded0 100755 --- a/install-scripts/toolchain.sh +++ b/install-scripts/toolchain.sh @@ -11,3 +11,4 @@ git clone --depth 1 --shallow-submodules https://github.com/riscv/riscv-gnu-tool apt-get -yqq install autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev ninja-build ./configure --prefix=/opt/riscv --with-cmodel=medany --with-multilib-generator="rv32im_zicsr_zicond-ilp32--;rv64im_zicsr_zicond-lp64--" --enable-debug-info && make -j$(nproc) && make clean echo 'PATH="/opt/riscv/bin:$PATH"' >> /root/.bashrc +rm -rf /toolchain From e57bae8dfb8fe7c5814b0b164647420157120a1f Mon Sep 17 00:00:00 2001 From: marton bognar Date: Thu, 19 Mar 2026 16:28:46 +0100 Subject: [PATCH 2/2] Install riscv-formal in the published Docker image --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d489d9..cb5fb60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,7 @@ jobs: INSTALL_EVAL_HD=true INSTALL_PROTEUS=true INSTALL_TOOLCHAIN=true + INSTALL_RISCV_FORMAL=true outputs: type=docker,dest=/tmp/ecosystem-docker.tar - name: Upload Docker artifact