From bcd7fbcdae52b91d1dd409a9158c3f9396d70871 Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Fri, 2 Oct 2026 00:06:43 -0300 Subject: [PATCH 1/7] Add dockerfiles for apicula, icestorm and trellis --- README.md | 12 ++++++-- recipes/Dockerfile.apicula | 57 +++++++++++++++++++++++++++++++++++++ recipes/Dockerfile.icestorm | 50 ++++++++++++++++++++++++++++++++ recipes/Dockerfile.trellis | 52 +++++++++++++++++++++++++++++++++ 4 files changed, 169 insertions(+), 2 deletions(-) create mode 100644 recipes/Dockerfile.apicula create mode 100644 recipes/Dockerfile.icestorm create mode 100644 recipes/Dockerfile.trellis diff --git a/README.md b/README.md index 75b14d4..d1491d7 100644 --- a/README.md +++ b/README.md @@ -13,15 +13,23 @@ Below is a list of the available containers and their included tools. * [Surelog](https://github.com/chipsalliance/Surelog) * `synthesis`: tools for logic synthesis * [GHDL](https://github.com/ghdl/ghdl) - * [Yosys](https://github.com/YosysHQ/yosys) + * [Yosys](https://github.com/YosysHQ/yosys) (now including [sv-elab](https://github.com/povik/sv-elab)) * [ghdl-yosys-plugin](https://github.com/ghdl/ghdl-yosys-plugin) - * [sv-elab](https://github.com/povik/sv-elab) * [synlig](https://github.com/chipsalliance/synlig) * `simulation`: tools for simulation * [GHDL](https://github.com/ghdl/ghdl) * [iVerilog](https://github.com/steveicarus/iverilog) * [Verilator](https://github.com/verilator/verilator) * [cocotb](https://github.com/cocotb/cocotb) +`icestorm`: place & route and bitstream generation for Lattice iCE40 FPGAs +* [icestrom](https://github.com/YosysHQ/icestorm) +* [nextpnr](https://github.com/YosysHQ/nextpnr) +`trellis`:place & route and bitstream generation for Lattice ECP5 FPGAs +* [trellis](https://github.com/YosysHQ/prjtrellis) +* [nextpnr](https://github.com/YosysHQ/nextpnr) +`apicula`: place & route and bitstream generation for Gowin FPGAs +* [apicula](https://github.com/yosyshq/apicula) +* [nextpnr](https://github.com/YosysHQ/nextpnr) In the CI pipeline, the Dockerfile is used to build a Docker image, which is then pushed to the GitHub Container Registry. From there, it can be pulled and run as a container whenever needed. diff --git a/recipes/Dockerfile.apicula b/recipes/Dockerfile.apicula new file mode 100644 index 0000000..0fbd67f --- /dev/null +++ b/recipes/Dockerfile.apicula @@ -0,0 +1,57 @@ +# https://github.com/yosyshq/apicula +# https://github.com/YosysHQ/nextpnr + +FROM ubuntu:latest AS builder + +WORKDIR /tmp + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update -qq +RUN apt-get install -y --no-install-recommends \ + ca-certificates \ + git +RUN apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + libboost-all-dev \ + libeigen3-dev \ + python3-dev + +# +# Apicula +# + +RUN apt-get install -y --no-install-recommends python3 python3-pip +RUN pip3 install --no-cache-dir --break-system-packages \ + apycula \ + msgpack \ + cattrs + +# +# NextPNR +# + +RUN git clone --depth 1 https://github.com/YosysHQ/nextpnr +RUN cd nextpnr && git submodule update --init --recursive \ + && mkdir -p build && cd build \ + && cmake .. -DARCH="himbaechel" -DHIMBAECHEL_UARCH="gowin" -DTRELLIS_INSTALL_PREFIX=/usr/local \ + && make -j$(nproc) && make install + +# +# Optimization +# + +RUN strip /usr/local/bin/* 2>/dev/null || true + +#------------------------------------------------------------------------------ + +FROM ubuntu:latest AS runtime + +RUN apt-get update -qq && apt-get install -y --no-install-recommends \ + python3 \ + && rm -rf /var/lib/apt/lists/* + +COPY --from=builder /usr/local /usr/local + +RUN ldconfig diff --git a/recipes/Dockerfile.icestorm b/recipes/Dockerfile.icestorm new file mode 100644 index 0000000..11af780 --- /dev/null +++ b/recipes/Dockerfile.icestorm @@ -0,0 +1,50 @@ +# https://github.com/YosysHQ/icestorm +# https://github.com/YosysHQ/nextpnr + +FROM ubuntu:latest AS builder + +WORKDIR /tmp + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update -qq +RUN apt-get install -y --no-install-recommends \ + ca-certificates \ + git +RUN apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + libboost-all-dev \ + libeigen3-dev \ + libftdi-dev + +# +# IceStorm +# + +RUN git clone --depth 1 https://github.com/YosysHQ/icestorm.git +RUN cd icestorm && make -j$(nproc) && make install + +# +# NextPNR +# + +RUN git clone --depth 1 https://github.com/YosysHQ/nextpnr +RUN cd nextpnr && git submodule update --init --recursive \ + && mkdir -p build && cd build \ + && cmake .. -DARCH=ice40 -DTRELLIS_INSTALL_PREFIX=/usr/local \ + && make -j$(nproc) && make install + +# +# Optimization +# + +RUN strip /usr/local/bin/* 2>/dev/null || true + +#------------------------------------------------------------------------------ + +FROM ubuntu:latest AS runtime + +COPY --from=builder /usr/local /usr/local + +RUN ldconfig diff --git a/recipes/Dockerfile.trellis b/recipes/Dockerfile.trellis new file mode 100644 index 0000000..59439fb --- /dev/null +++ b/recipes/Dockerfile.trellis @@ -0,0 +1,52 @@ +# https://github.com/YosysHQ/prjtrellis +# https://github.com/YosysHQ/nextpnr + +FROM ubuntu:latest AS builder + +WORKDIR /tmp + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update -qq +RUN apt-get install -y --no-install-recommends \ + ca-certificates \ + git +RUN apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + libboost-all-dev \ + libeigen3-dev \ + openocd \ + python3-dev + +# +# Trellis +# + +RUN git clone --depth 1 --recursive https://github.com/YosysHQ/prjtrellis +RUN cd prjtrellis/libtrellis && cmake -DCMAKE_INSTALL_PREFIX=/usr/local . \ + && make -j$(nproc) && make install + +# +# NextPNR +# + +RUN git clone --depth 1 https://github.com/YosysHQ/nextpnr +RUN cd nextpnr && git submodule update --init --recursive \ + && mkdir -p build && cd build \ + && cmake .. -DARCH=ecp5 -DTRELLIS_INSTALL_PREFIX=/usr/local \ + && make -j$(nproc) && make install + +# +# Optimization +# + +RUN strip /usr/local/bin/* 2>/dev/null || true + +#------------------------------------------------------------------------------ + +FROM ubuntu:latest AS runtime + +COPY --from=builder /usr/local /usr/local + +RUN ldconfig From 95a8fd3fc53f1aa16cd7458a52e989eb114de672 Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Fri, 2 Oct 2026 19:34:07 -0300 Subject: [PATCH 2/7] Update README --- README.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index d1491d7..25fbcc2 100644 --- a/README.md +++ b/README.md @@ -21,15 +21,10 @@ Below is a list of the available containers and their included tools. * [iVerilog](https://github.com/steveicarus/iverilog) * [Verilator](https://github.com/verilator/verilator) * [cocotb](https://github.com/cocotb/cocotb) -`icestorm`: place & route and bitstream generation for Lattice iCE40 FPGAs -* [icestrom](https://github.com/YosysHQ/icestorm) -* [nextpnr](https://github.com/YosysHQ/nextpnr) -`trellis`:place & route and bitstream generation for Lattice ECP5 FPGAs -* [trellis](https://github.com/YosysHQ/prjtrellis) -* [nextpnr](https://github.com/YosysHQ/nextpnr) -`apicula`: place & route and bitstream generation for Gowin FPGAs -* [apicula](https://github.com/yosyshq/apicula) -* [nextpnr](https://github.com/YosysHQ/nextpnr) +* [nextpnr](https://github.com/YosysHQ/nextpnr) based containers: place and route + bitstream manipulation + * `nextpnr-apicula`: for gowin FPGAs ([apicula](https://github.com/yosyshq/apicula)) + * `nextpnr-icestorm`: for Lattice iCe40 FPGAs ([icestrom](https://github.com/YosysHQ/icestorm)) + * `nextpnr-trellis`: for Lattice ecp5 FPGAs ([trellis](https://github.com/YosysHQ/prjtrellis)) In the CI pipeline, the Dockerfile is used to build a Docker image, which is then pushed to the GitHub Container Registry. From there, it can be pulled and run as a container whenever needed. From b137abe753cadce05329ed245c06514737181252 Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Fri, 2 Oct 2026 19:37:23 -0300 Subject: [PATCH 3/7] Rename recipes directory as dockerfiles --- .github/workflows/deploy.yml | 6 +++--- build.sh | 2 +- {recipes => dockerfiles}/Dockerfile.apicula | 0 {recipes => dockerfiles}/Dockerfile.ghdl | 0 {recipes => dockerfiles}/Dockerfile.icestorm | 0 {recipes => dockerfiles}/Dockerfile.iverilog | 0 {recipes => dockerfiles}/Dockerfile.langutils | 0 {recipes => dockerfiles}/Dockerfile.simulation | 0 {recipes => dockerfiles}/Dockerfile.slang | 0 {recipes => dockerfiles}/Dockerfile.surelog | 0 {recipes => dockerfiles}/Dockerfile.sv2v | 0 {recipes => dockerfiles}/Dockerfile.svlint | 0 {recipes => dockerfiles}/Dockerfile.synlig | 0 {recipes => dockerfiles}/Dockerfile.synthesis | 0 {recipes => dockerfiles}/Dockerfile.trellis | 0 {recipes => dockerfiles}/Dockerfile.verible | 0 {recipes => dockerfiles}/Dockerfile.verilator | 0 {recipes => dockerfiles}/Dockerfile.vhd2vl | 0 {recipes => dockerfiles}/Dockerfile.yosys | 0 sanity.sh | 2 +- 20 files changed, 5 insertions(+), 5 deletions(-) rename {recipes => dockerfiles}/Dockerfile.apicula (100%) rename {recipes => dockerfiles}/Dockerfile.ghdl (100%) rename {recipes => dockerfiles}/Dockerfile.icestorm (100%) rename {recipes => dockerfiles}/Dockerfile.iverilog (100%) rename {recipes => dockerfiles}/Dockerfile.langutils (100%) rename {recipes => dockerfiles}/Dockerfile.simulation (100%) rename {recipes => dockerfiles}/Dockerfile.slang (100%) rename {recipes => dockerfiles}/Dockerfile.surelog (100%) rename {recipes => dockerfiles}/Dockerfile.sv2v (100%) rename {recipes => dockerfiles}/Dockerfile.svlint (100%) rename {recipes => dockerfiles}/Dockerfile.synlig (100%) rename {recipes => dockerfiles}/Dockerfile.synthesis (100%) rename {recipes => dockerfiles}/Dockerfile.trellis (100%) rename {recipes => dockerfiles}/Dockerfile.verible (100%) rename {recipes => dockerfiles}/Dockerfile.verilator (100%) rename {recipes => dockerfiles}/Dockerfile.vhd2vl (100%) rename {recipes => dockerfiles}/Dockerfile.yosys (100%) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ccfdb00..72a2fab 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,9 +3,9 @@ name: Deploy Docker Images on: push: paths: - - 'recipes/Dockerfile.langutils' - - 'recipes/Dockerfile.synthesis' - - 'recipes/Dockerfile.simulation' + - 'dockerfiles/Dockerfile.langutils' + - 'dockerfiles/Dockerfile.synthesis' + - 'dockerfiles/Dockerfile.simulation' schedule: - cron: '0 21 * * 5' diff --git a/build.sh b/build.sh index 66bec49..e8d333e 100644 --- a/build.sh +++ b/build.sh @@ -1,4 +1,4 @@ #!/bin/bash set -e IMAGE=$1 -docker build -f recipes/Dockerfile.$IMAGE --network=host -t ghcr.io/pyfpga/$IMAGE . +docker build -f dockerfiles/Dockerfile.$IMAGE --network=host -t ghcr.io/pyfpga/$IMAGE . diff --git a/recipes/Dockerfile.apicula b/dockerfiles/Dockerfile.apicula similarity index 100% rename from recipes/Dockerfile.apicula rename to dockerfiles/Dockerfile.apicula diff --git a/recipes/Dockerfile.ghdl b/dockerfiles/Dockerfile.ghdl similarity index 100% rename from recipes/Dockerfile.ghdl rename to dockerfiles/Dockerfile.ghdl diff --git a/recipes/Dockerfile.icestorm b/dockerfiles/Dockerfile.icestorm similarity index 100% rename from recipes/Dockerfile.icestorm rename to dockerfiles/Dockerfile.icestorm diff --git a/recipes/Dockerfile.iverilog b/dockerfiles/Dockerfile.iverilog similarity index 100% rename from recipes/Dockerfile.iverilog rename to dockerfiles/Dockerfile.iverilog diff --git a/recipes/Dockerfile.langutils b/dockerfiles/Dockerfile.langutils similarity index 100% rename from recipes/Dockerfile.langutils rename to dockerfiles/Dockerfile.langutils diff --git a/recipes/Dockerfile.simulation b/dockerfiles/Dockerfile.simulation similarity index 100% rename from recipes/Dockerfile.simulation rename to dockerfiles/Dockerfile.simulation diff --git a/recipes/Dockerfile.slang b/dockerfiles/Dockerfile.slang similarity index 100% rename from recipes/Dockerfile.slang rename to dockerfiles/Dockerfile.slang diff --git a/recipes/Dockerfile.surelog b/dockerfiles/Dockerfile.surelog similarity index 100% rename from recipes/Dockerfile.surelog rename to dockerfiles/Dockerfile.surelog diff --git a/recipes/Dockerfile.sv2v b/dockerfiles/Dockerfile.sv2v similarity index 100% rename from recipes/Dockerfile.sv2v rename to dockerfiles/Dockerfile.sv2v diff --git a/recipes/Dockerfile.svlint b/dockerfiles/Dockerfile.svlint similarity index 100% rename from recipes/Dockerfile.svlint rename to dockerfiles/Dockerfile.svlint diff --git a/recipes/Dockerfile.synlig b/dockerfiles/Dockerfile.synlig similarity index 100% rename from recipes/Dockerfile.synlig rename to dockerfiles/Dockerfile.synlig diff --git a/recipes/Dockerfile.synthesis b/dockerfiles/Dockerfile.synthesis similarity index 100% rename from recipes/Dockerfile.synthesis rename to dockerfiles/Dockerfile.synthesis diff --git a/recipes/Dockerfile.trellis b/dockerfiles/Dockerfile.trellis similarity index 100% rename from recipes/Dockerfile.trellis rename to dockerfiles/Dockerfile.trellis diff --git a/recipes/Dockerfile.verible b/dockerfiles/Dockerfile.verible similarity index 100% rename from recipes/Dockerfile.verible rename to dockerfiles/Dockerfile.verible diff --git a/recipes/Dockerfile.verilator b/dockerfiles/Dockerfile.verilator similarity index 100% rename from recipes/Dockerfile.verilator rename to dockerfiles/Dockerfile.verilator diff --git a/recipes/Dockerfile.vhd2vl b/dockerfiles/Dockerfile.vhd2vl similarity index 100% rename from recipes/Dockerfile.vhd2vl rename to dockerfiles/Dockerfile.vhd2vl diff --git a/recipes/Dockerfile.yosys b/dockerfiles/Dockerfile.yosys similarity index 100% rename from recipes/Dockerfile.yosys rename to dockerfiles/Dockerfile.yosys diff --git a/sanity.sh b/sanity.sh index 9dbdb17..697dbbd 100644 --- a/sanity.sh +++ b/sanity.sh @@ -2,7 +2,7 @@ set -e -for dockerfile in "recipes"/Dockerfile.*; do +for dockerfile in "dockerfiles"/Dockerfile.*; do name="${dockerfile##*Dockerfile.}" echo "Processing target: ${name}" bash build.sh "${name}" From ecb8ca8ca351c4dec0ee62418bd3746610db805f Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Fri, 2 Oct 2026 19:39:11 -0300 Subject: [PATCH 4/7] Add the prefix nextpnr to apicula, icestorm and trellis --- dockerfiles/{Dockerfile.apicula => Dockerfile.nextpnr-apicula} | 0 dockerfiles/{Dockerfile.icestorm => Dockerfile.nextpnr-icestorm} | 0 dockerfiles/{Dockerfile.trellis => Dockerfile.nextpnr-trellis} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename dockerfiles/{Dockerfile.apicula => Dockerfile.nextpnr-apicula} (100%) rename dockerfiles/{Dockerfile.icestorm => Dockerfile.nextpnr-icestorm} (100%) rename dockerfiles/{Dockerfile.trellis => Dockerfile.nextpnr-trellis} (100%) diff --git a/dockerfiles/Dockerfile.apicula b/dockerfiles/Dockerfile.nextpnr-apicula similarity index 100% rename from dockerfiles/Dockerfile.apicula rename to dockerfiles/Dockerfile.nextpnr-apicula diff --git a/dockerfiles/Dockerfile.icestorm b/dockerfiles/Dockerfile.nextpnr-icestorm similarity index 100% rename from dockerfiles/Dockerfile.icestorm rename to dockerfiles/Dockerfile.nextpnr-icestorm diff --git a/dockerfiles/Dockerfile.trellis b/dockerfiles/Dockerfile.nextpnr-trellis similarity index 100% rename from dockerfiles/Dockerfile.trellis rename to dockerfiles/Dockerfile.nextpnr-trellis From 90fd9808c5e90fa3c0ab64492dce89d7807341be Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Fri, 2 Oct 2026 19:43:24 -0300 Subject: [PATCH 5/7] ci: add nextpnr-apicula, nextpnr-icestorm and nextpnr-trellis --- .github/workflows/deploy.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 72a2fab..ee1c35a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -6,6 +6,9 @@ on: - 'dockerfiles/Dockerfile.langutils' - 'dockerfiles/Dockerfile.synthesis' - 'dockerfiles/Dockerfile.simulation' + - 'dockerfiles/Dockerfile.nextpnr-apicula' + - 'dockerfiles/Dockerfile.nextpnr-icestorm' + - 'dockerfiles/Dockerfile.nextpnr-trellis' schedule: - cron: '0 21 * * 5' @@ -19,6 +22,9 @@ jobs: - langutils - synthesis - simulation + - nextpnr-apicula + - nextpnr-icestorm + - nextpnr-trellis steps: - uses: actions/checkout@v2 - name: Login to GitHub Container Registry @@ -28,6 +34,6 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build Docker image for ${{ matrix.name }} - run: docker build -f recipes/Dockerfile.${{ matrix.name }} -t ghcr.io/pyfpga/${{ matrix.name }} . + run: docker build -f dockerfiles/Dockerfile.${{ matrix.name }} -t ghcr.io/pyfpga/${{ matrix.name }} . - name: Push Docker image for ${{ matrix.name }} run: docker push ghcr.io/pyfpga/${{ matrix.name }} From 9f202ac98cbb6e755b76a67ea96339709a8c443f Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Fri, 2 Oct 2026 19:56:39 -0300 Subject: [PATCH 6/7] Remove independent dockerfiles already included by langutils --- dockerfiles/Dockerfile.langutils | 48 ++++++++++++++++++++++++++------ dockerfiles/Dockerfile.slang | 28 ------------------- dockerfiles/Dockerfile.surelog | 35 ----------------------- dockerfiles/Dockerfile.sv2v | 29 ------------------- dockerfiles/Dockerfile.svlint | 24 ---------------- dockerfiles/Dockerfile.verible | 32 --------------------- dockerfiles/Dockerfile.vhd2vl | 27 ------------------ tests/langutils.sh | 13 +-------- 8 files changed, 40 insertions(+), 196 deletions(-) delete mode 100644 dockerfiles/Dockerfile.slang delete mode 100644 dockerfiles/Dockerfile.surelog delete mode 100644 dockerfiles/Dockerfile.sv2v delete mode 100644 dockerfiles/Dockerfile.svlint delete mode 100644 dockerfiles/Dockerfile.verible delete mode 100644 dockerfiles/Dockerfile.vhd2vl diff --git a/dockerfiles/Dockerfile.langutils b/dockerfiles/Dockerfile.langutils index a94bb41..c320f4f 100644 --- a/dockerfiles/Dockerfile.langutils +++ b/dockerfiles/Dockerfile.langutils @@ -5,48 +5,69 @@ WORKDIR /tmp ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq + RUN apt-get install -y --no-install-recommends \ ca-certificates \ git + RUN apt-get install -y --no-install-recommends \ - bison \ - build-essential \ cargo \ cmake \ curl \ default-jre \ - flex \ python3 \ python3-orderedmultidict # -# vhd2vl +# vhd2vl (https://github.com/ldoolitt/vhd2vl) # +RUN apt-get install -y --no-install-recommends \ + bison \ + build-essential \ + flex + RUN git clone --depth 1 https://github.com/ldoolitt/vhd2vl RUN cd vhd2vl && make -j$(nproc) && make install # -# sv2v +# sv2v (https://github.com/zachjs/sv2v) # +RUN apt-get install -y --no-install-recommends \ + curl + RUN curl -sSL https://get.haskellstack.org/ | sh RUN git clone --depth 1 https://github.com/zachjs/sv2v.git RUN cd sv2v && make -j$(nproc) && cp bin/sv2v /usr/local/bin +RUN rm -f /usr/local/bin/stack + # -# Slang +# Slang (https://github.com/MikePopoloski/slang) # +RUN apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + python3 + RUN git clone --depth 1 https://github.com/MikePopoloski/slang.git RUN cd slang && cmake -B build && cmake --build build -j$(nproc) \ && cmake --install build --strip # -# Surelog +# Surelog (https://github.com/chipsalliance/Surelog) # +RUN apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + default-jre \ + python3 \ + python3-orderedmultidict + RUN git clone --depth 1 https://github.com/alainmarcel/Surelog.git RUN cd Surelog && git submodule update --init --depth 1 --recursive \ && cmake -B build \ @@ -57,9 +78,13 @@ RUN cd Surelog && git submodule update --init --depth 1 --recursive \ && cmake --install build --strip # -# Verible +# Verible (https://github.com/chipsalliance/verible) # +RUN apt-get install -y --no-install-recommends \ + build-essential \ + curl + RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 \ -o /usr/local/bin/bazel && chmod +x /usr/local/bin/bazel @@ -67,10 +92,15 @@ RUN git clone --depth 1 https://github.com/chipsalliance/verible.git RUN cd verible && bazel build -c opt :install-binaries \ && .github/bin/simple-install.sh /usr/local/bin +RUN rm -f /usr/local/bin/bazel + # -# svlint +# svlint (https://github.com/dalance/svlint) # +RUN apt-get install -y --no-install-recommends \ + cargo + RUN cargo install --root /usr/local --git https://github.com/dalance/svlint.git svlint # diff --git a/dockerfiles/Dockerfile.slang b/dockerfiles/Dockerfile.slang deleted file mode 100644 index aa237e8..0000000 --- a/dockerfiles/Dockerfile.slang +++ /dev/null @@ -1,28 +0,0 @@ -# https://github.com/MikePopoloski/slang - -FROM ubuntu:latest AS builder - -WORKDIR /tmp - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends \ - ca-certificates \ - git -RUN apt-get install -y --no-install-recommends \ - build-essential \ - cmake \ - python3 - -RUN git clone --depth 1 https://github.com/MikePopoloski/slang.git -RUN cd slang && cmake -B build && cmake --build build -j$(nproc) \ - && cmake --install build --strip - -#------------------------------------------------------------------------------ - -FROM ubuntu:latest AS runtime - -COPY --from=builder /usr/local /usr/local - -RUN ldconfig diff --git a/dockerfiles/Dockerfile.surelog b/dockerfiles/Dockerfile.surelog deleted file mode 100644 index 123bc71..0000000 --- a/dockerfiles/Dockerfile.surelog +++ /dev/null @@ -1,35 +0,0 @@ -# https://github.com/chipsalliance/Surelog - -FROM ubuntu:latest AS builder - -WORKDIR /tmp - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends \ - ca-certificates \ - git -RUN apt-get install -y --no-install-recommends \ - build-essential \ - cmake \ - default-jre \ - python3 \ - python3-orderedmultidict - -RUN git clone --depth 1 https://github.com/alainmarcel/Surelog.git -RUN cd Surelog && git submodule update --init --depth 1 --recursive \ - && cmake -B build \ - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr/local \ - && cmake --build build -j$(nproc) \ - && cmake --install build --strip - -#------------------------------------------------------------------------------ - -FROM ubuntu:latest AS runtime - -COPY --from=builder /usr/local /usr/local - -RUN ldconfig diff --git a/dockerfiles/Dockerfile.sv2v b/dockerfiles/Dockerfile.sv2v deleted file mode 100644 index 3525752..0000000 --- a/dockerfiles/Dockerfile.sv2v +++ /dev/null @@ -1,29 +0,0 @@ -# https://github.com/zachjs/sv2v - -FROM ubuntu:latest AS builder - -WORKDIR /tmp - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends \ - ca-certificates \ - git -RUN apt-get install -y --no-install-recommends \ - curl - -RUN curl -sSL https://get.haskellstack.org/ | sh - -RUN git clone --depth 1 https://github.com/zachjs/sv2v.git -RUN cd sv2v && make -j$(nproc) && cp bin/sv2v /usr/local/bin - -RUN rm -f /usr/local/bin/stack - -#------------------------------------------------------------------------------ - -FROM ubuntu:latest AS runtime - -COPY --from=builder /usr/local /usr/local - -RUN ldconfig diff --git a/dockerfiles/Dockerfile.svlint b/dockerfiles/Dockerfile.svlint deleted file mode 100644 index ce0a726..0000000 --- a/dockerfiles/Dockerfile.svlint +++ /dev/null @@ -1,24 +0,0 @@ -# https://github.com/dalance/svlint - -FROM ubuntu:latest AS builder - -WORKDIR /tmp - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends \ - ca-certificates \ - git -RUN apt-get install -y --no-install-recommends \ - cargo - -RUN cargo install --root /usr/local --git https://github.com/dalance/svlint.git svlint - -#------------------------------------------------------------------------------ - -FROM ubuntu:latest AS runtime - -COPY --from=builder /usr/local /usr/local - -RUN ldconfig diff --git a/dockerfiles/Dockerfile.verible b/dockerfiles/Dockerfile.verible deleted file mode 100644 index dcd5766..0000000 --- a/dockerfiles/Dockerfile.verible +++ /dev/null @@ -1,32 +0,0 @@ -# https://github.com/chipsalliance/verible - -FROM ubuntu:latest AS builder - -WORKDIR /tmp - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends \ - ca-certificates \ - git -RUN apt-get install -y --no-install-recommends \ - build-essential \ - curl - -RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 \ - -o /usr/local/bin/bazel && chmod +x /usr/local/bin/bazel - -RUN git clone --depth 1 https://github.com/chipsalliance/verible.git -RUN cd verible && bazel build -c opt :install-binaries \ - && .github/bin/simple-install.sh /usr/local/bin - -RUN rm -f /usr/local/bin/bazel - -#------------------------------------------------------------------------------ - -FROM ubuntu:latest AS runtime - -COPY --from=builder /usr/local /usr/local - -RUN ldconfig diff --git a/dockerfiles/Dockerfile.vhd2vl b/dockerfiles/Dockerfile.vhd2vl deleted file mode 100644 index f3a955b..0000000 --- a/dockerfiles/Dockerfile.vhd2vl +++ /dev/null @@ -1,27 +0,0 @@ -# https://github.com/ldoolitt/vhd2vl - -FROM ubuntu:latest AS builder - -WORKDIR /tmp - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends \ - ca-certificates \ - git -RUN apt-get install -y --no-install-recommends \ - bison \ - build-essential \ - flex - -RUN git clone --depth 1 https://github.com/ldoolitt/vhd2vl -RUN cd vhd2vl && make -j$(nproc) && make install - -#------------------------------------------------------------------------------ - -FROM ubuntu:latest AS runtime - -COPY --from=builder /usr/local /usr/local - -RUN ldconfig diff --git a/tests/langutils.sh b/tests/langutils.sh index 5096769..ee110d8 100644 --- a/tests/langutils.sh +++ b/tests/langutils.sh @@ -2,39 +2,28 @@ set -e -POC=$1 - -# [[ -z "$POC" ]] && echo "POC is unset" -# [[ -n "$POC" ]] && echo "POC is set" - -[[ -z "$POC" ]] && DOCKER="docker run --rm -v $HOME:$HOME -w $PWD --user $(id -u):$(id -g) ghcr.io/pyfpga/langutils" +DOCKER="docker run --rm -v $HOME:$HOME -w $PWD --user $(id -u):$(id -g) ghcr.io/pyfpga/langutils" mkdir -p results -[[ -n "$POC" ]] && DOCKER="docker run --rm -v $HOME:$HOME -w $PWD --user $(id -u):$(id -g) ghcr.io/pyfpga/vhd2vl" $DOCKER vhd2vl --version $DOCKER vhd2vl --quiet hdl/counter.vhdl results/vhd2vl.v test -f results/vhd2vl.v -[[ -n "$POC" ]] && DOCKER="docker run --rm -v $HOME:$HOME -w $PWD --user $(id -u):$(id -g) ghcr.io/pyfpga/sv2v" $DOCKER sv2v --version $DOCKER sv2v hdl/counter.sv --write=results/sv2v.v test -f results/sv2v.v -[[ -n "$POC" ]] && DOCKER="docker run --rm -v $HOME:$HOME -w $PWD --user $(id -u):$(id -g) ghcr.io/pyfpga/slang" $DOCKER slang --version $DOCKER slang hdl/counter.sv --lint-only -[[ -n "$POC" ]] && DOCKER="docker run --rm -v $HOME:$HOME -w $PWD --user $(id -u):$(id -g) ghcr.io/pyfpga/surelog" $DOCKER surelog --version $DOCKER surelog -parse hdl/counter.sv rm -fr slpp_all -[[ -n "$POC" ]] && DOCKER="docker run --rm -v $HOME:$HOME -w $PWD --user $(id -u):$(id -g) ghcr.io/pyfpga/verible" $DOCKER verible-verilog-syntax --version $DOCKER verible-verilog-lint hdl/counter.sv -[[ -n "$POC" ]] && DOCKER="docker run --rm -v $HOME:$HOME -w $PWD --user $(id -u):$(id -g) ghcr.io/pyfpga/svlint" $DOCKER svlint --version $DOCKER svlint hdl/counter.sv From b2c3774c40d78e41332db172f7a025737e62b839 Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Sat, 3 Oct 2026 09:27:01 -0300 Subject: [PATCH 7/7] Remove independent dockerfiles already included by synthesis and simulation --- dockerfiles/Dockerfile.ghdl | 28 ------------------- dockerfiles/Dockerfile.iverilog | 30 -------------------- dockerfiles/Dockerfile.langutils | 13 ++------- dockerfiles/Dockerfile.simulation | 46 +++++++++++++++++++------------ dockerfiles/Dockerfile.synlig | 38 ------------------------- dockerfiles/Dockerfile.synthesis | 43 +++++++++++++++++++---------- dockerfiles/Dockerfile.verilator | 32 --------------------- dockerfiles/Dockerfile.yosys | 42 ---------------------------- 8 files changed, 60 insertions(+), 212 deletions(-) delete mode 100644 dockerfiles/Dockerfile.ghdl delete mode 100644 dockerfiles/Dockerfile.iverilog delete mode 100644 dockerfiles/Dockerfile.synlig delete mode 100644 dockerfiles/Dockerfile.verilator delete mode 100644 dockerfiles/Dockerfile.yosys diff --git a/dockerfiles/Dockerfile.ghdl b/dockerfiles/Dockerfile.ghdl deleted file mode 100644 index 418f50e..0000000 --- a/dockerfiles/Dockerfile.ghdl +++ /dev/null @@ -1,28 +0,0 @@ -# https://github.com/ghdl/ghdl - -FROM ubuntu:latest AS builder - -WORKDIR /tmp - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends \ - ca-certificates \ - git -RUN apt-get install -y --no-install-recommends \ - build-essential \ - gnat \ - zlib1g-dev - -RUN git clone --depth 1 https://github.com/ghdl/ghdl -RUN mkdir ghdl/build && cd ghdl/build && ../configure --prefix=/usr/local \ - && make -j$(nproc) && make install - -#------------------------------------------------------------------------------ - -FROM ubuntu:latest AS runtime - -COPY --from=builder /usr/local /usr/local - -RUN ldconfig diff --git a/dockerfiles/Dockerfile.iverilog b/dockerfiles/Dockerfile.iverilog deleted file mode 100644 index 6cdcfdc..0000000 --- a/dockerfiles/Dockerfile.iverilog +++ /dev/null @@ -1,30 +0,0 @@ -# https://github.com/steveicarus/iverilog - -FROM ubuntu:latest AS builder - -WORKDIR /tmp - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends \ - ca-certificates \ - git -RUN apt-get install -y --no-install-recommends \ - autoconf \ - bison \ - build-essential \ - flex \ - gperf - -RUN git clone --depth 1 https://github.com/steveicarus/iverilog -RUN cd iverilog && autoconf && ./configure \ - && make -j$(nproc) && make install - -#------------------------------------------------------------------------------ - -FROM ubuntu:latest AS runtime - -COPY --from=builder /usr/local /usr/local - -RUN ldconfig diff --git a/dockerfiles/Dockerfile.langutils b/dockerfiles/Dockerfile.langutils index c320f4f..120fa5d 100644 --- a/dockerfiles/Dockerfile.langutils +++ b/dockerfiles/Dockerfile.langutils @@ -10,14 +10,6 @@ RUN apt-get install -y --no-install-recommends \ ca-certificates \ git -RUN apt-get install -y --no-install-recommends \ - cargo \ - cmake \ - curl \ - default-jre \ - python3 \ - python3-orderedmultidict - # # vhd2vl (https://github.com/ldoolitt/vhd2vl) # @@ -104,10 +96,11 @@ RUN apt-get install -y --no-install-recommends \ RUN cargo install --root /usr/local --git https://github.com/dalance/svlint.git svlint # -# clean-up +# Optimization # -RUN rm -f /usr/local/bin/stack /usr/local/bin/bazel +RUN strip /usr/local/bin/* 2>/dev/null || true +RUN find /usr/local/lib -name "*.so*" -exec strip --strip-unneeded {} + 2>/dev/null || true #------------------------------------------------------------------------------ diff --git a/dockerfiles/Dockerfile.simulation b/dockerfiles/Dockerfile.simulation index a85b8c6..1c992a3 100644 --- a/dockerfiles/Dockerfile.simulation +++ b/dockerfiles/Dockerfile.simulation @@ -5,44 +5,52 @@ WORKDIR /tmp ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq + RUN apt-get install -y --no-install-recommends \ ca-certificates \ git + +# +# GHDL (https://github.com/ghdl/ghdl) +# + RUN apt-get install -y --no-install-recommends \ - autoconf \ - bison \ build-essential \ - flex \ gnat \ - gperf \ - help2man \ - libfl-dev \ - python3 \ - python3-dev \ - python3-pip \ - python3-venv \ zlib1g-dev -# -# ghdl -# - RUN git clone --depth 1 https://github.com/ghdl/ghdl RUN mkdir ghdl/build && cd ghdl/build && ../configure --prefix=/usr/local \ && make -j$(nproc) && make install # -# iVerilog +# iVerilog (https://github.com/steveicarus/iverilog) # +RUN apt-get install -y --no-install-recommends \ + autoconf \ + bison \ + build-essential \ + flex \ + gperf + RUN git clone --depth 1 https://github.com/steveicarus/iverilog RUN cd iverilog && autoconf && ./configure \ && make -j$(nproc) && make install # -# Verilator +# Verilator (https://github.com/verilator/verilator) # +RUN apt-get install -y --no-install-recommends \ + autoconf \ + bison \ + build-essential \ + flex \ + help2man \ + libfl-dev \ + python3 + RUN git clone --depth 1 https://github.com/verilator/verilator RUN cd verilator && autoconf && ./configure \ && make -j$(nproc) && make install @@ -51,7 +59,11 @@ RUN cd verilator && autoconf && ./configure \ # cocotb # -# RUN pip install cocotb --break-system-packages +RUN apt-get install -y --no-install-recommends \ + python3 \ + python3-dev \ + python3-pip \ + python3-venv RUN python3 -m venv /opt/venv && /opt/venv/bin/pip install --no-cache-dir cocotb diff --git a/dockerfiles/Dockerfile.synlig b/dockerfiles/Dockerfile.synlig deleted file mode 100644 index af58541..0000000 --- a/dockerfiles/Dockerfile.synlig +++ /dev/null @@ -1,38 +0,0 @@ -# https://github.com/chipsalliance/synlig - -FROM ubuntu:latest AS builder - -WORKDIR /tmp - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends \ - ca-certificates \ - git -RUN apt-get install -y --no-install-recommends \ - build-essential \ - cmake \ - default-jre \ - libffi-dev \ - libreadline-dev \ - python3 \ - python3-orderedmultidict \ - tcl-dev -RUN apt-get install -y --no-install-recommends bison flex pkg-config - -RUN git clone --depth 1 https://github.com/chipsalliance/synlig -RUN cd synlig \ - && git submodule update --init --depth 1 --recursive third_party/surelog \ - && git submodule update --init --depth 1 --recursive third_party/yosys \ - && find third_party -name "CMakeLists.txt" -exec sed -i -E 's/cmake_minimum_required\s*\([^)]+\)/cmake_minimum_required(VERSION 3.5)/gI' {} + \ - && sed -i '1s/^/#include \n/' third_party/yosys/libs/json11/json11.cpp \ - && make install -j$(nproc) - -#------------------------------------------------------------------------------ - -FROM ubuntu:latest AS runtime - -COPY --from=builder /usr/local /usr/local - -RUN ldconfig diff --git a/dockerfiles/Dockerfile.synthesis b/dockerfiles/Dockerfile.synthesis index 97f3cfa..c83c08e 100644 --- a/dockerfiles/Dockerfile.synthesis +++ b/dockerfiles/Dockerfile.synthesis @@ -5,35 +5,35 @@ WORKDIR /tmp ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq + RUN apt-get install -y --no-install-recommends \ ca-certificates \ git + +# +# GHDL (https://github.com/ghdl/ghdl) +# + RUN apt-get install -y --no-install-recommends \ - bison \ build-essential \ - cmake \ - default-jre \ - flex \ gnat \ - libffi-dev \ - libreadline-dev \ - pkg-config \ - python3-orderedmultidict \ - tcl-dev \ zlib1g-dev -# -# GHDL -# - RUN git clone --depth 1 https://github.com/ghdl/ghdl RUN mkdir ghdl/build && cd ghdl/build && ../configure --prefix=/usr/local \ && make -j$(nproc) && make install # -# Yosys +# Yosys (https://github.com/yosyshq/yosys) # +RUN apt-get install -y --no-install-recommends \ + bison \ + build-essential \ + cmake \ + flex \ + python3 + RUN git clone --depth 1 https://github.com/YosysHQ/yosys RUN cd yosys && git submodule update --init --depth 1 \ && cmake -B build . -DCMAKE_BUILD_TYPE=Release \ @@ -49,9 +49,22 @@ RUN cd ghdl-yosys-plugin && git submodule update --init --depth 1 \ && make -j$(nproc) && make install # -# Synlig +# Synlig (https://github.com/chipsalliance/synlig) # +RUN apt-get install -y --no-install-recommends \ + bison \ + build-essential \ + cmake \ + default-jre \ + flex \ + libffi-dev \ + libreadline-dev \ + pkg-config \ + python3 \ + python3-orderedmultidict \ + tcl-dev + RUN git clone --depth 1 https://github.com/chipsalliance/synlig RUN cd synlig \ && git submodule update --init --depth 1 --recursive third_party/surelog \ diff --git a/dockerfiles/Dockerfile.verilator b/dockerfiles/Dockerfile.verilator deleted file mode 100644 index a06f006..0000000 --- a/dockerfiles/Dockerfile.verilator +++ /dev/null @@ -1,32 +0,0 @@ -# https://github.com/verilator/verilator - -FROM ubuntu:latest AS builder - -WORKDIR /tmp - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends \ - ca-certificates \ - git -RUN apt-get install -y --no-install-recommends \ - autoconf \ - bison \ - build-essential \ - flex \ - help2man \ - libfl-dev \ - python3 - -RUN git clone --depth 1 https://github.com/verilator/verilator -RUN cd verilator && autoconf && ./configure \ - && make -j$(nproc) && make install - -#------------------------------------------------------------------------------ - -FROM ubuntu:latest AS runtime - -COPY --from=builder /usr/local /usr/local - -RUN ldconfig diff --git a/dockerfiles/Dockerfile.yosys b/dockerfiles/Dockerfile.yosys deleted file mode 100644 index 01eb070..0000000 --- a/dockerfiles/Dockerfile.yosys +++ /dev/null @@ -1,42 +0,0 @@ -# https://github.com/yosyshq/yosys - -FROM ubuntu:latest AS builder - -WORKDIR /tmp - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends \ - ca-certificates \ - git -RUN apt-get install -y --no-install-recommends \ - bison \ - build-essential \ - cmake \ - flex \ - gnat \ - python3 \ - zlib1g-dev - -RUN git clone --depth 1 https://github.com/ghdl/ghdl -RUN mkdir ghdl/build && cd ghdl/build && ../configure --prefix=/usr/local \ - && make -j$(nproc) && make install - -RUN git clone --depth 1 https://github.com/YosysHQ/yosys -RUN cd yosys && git submodule update --init --depth 1 \ - && cmake -B build . -DCMAKE_BUILD_TYPE=Release \ - && cmake --build build --config Release -j$(nproc) \ - && cmake --install build --strip - -RUN git clone --depth 1 https://github.com/ghdl/ghdl-yosys-plugin -RUN cd ghdl-yosys-plugin && git submodule update --init --depth 1 \ - && make -j$(nproc) && make install - -#------------------------------------------------------------------------------ - -FROM ubuntu:latest AS runtime - -COPY --from=builder /usr/local /usr/local/bin - -RUN ldconfig