diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ccfdb00..ee1c35a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,9 +3,12 @@ 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' + - '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 }} diff --git a/README.md b/README.md index 75b14d4..25fbcc2 100644 --- a/README.md +++ b/README.md @@ -13,15 +13,18 @@ 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) +* [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. 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.langutils b/dockerfiles/Dockerfile.langutils similarity index 66% rename from recipes/Dockerfile.langutils rename to dockerfiles/Dockerfile.langutils index a94bb41..120fa5d 100644 --- a/recipes/Dockerfile.langutils +++ b/dockerfiles/Dockerfile.langutils @@ -5,48 +5,61 @@ 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 +70,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,17 +84,23 @@ 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 # -# 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.nextpnr-apicula b/dockerfiles/Dockerfile.nextpnr-apicula new file mode 100644 index 0000000..0fbd67f --- /dev/null +++ b/dockerfiles/Dockerfile.nextpnr-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/dockerfiles/Dockerfile.nextpnr-icestorm b/dockerfiles/Dockerfile.nextpnr-icestorm new file mode 100644 index 0000000..11af780 --- /dev/null +++ b/dockerfiles/Dockerfile.nextpnr-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/dockerfiles/Dockerfile.nextpnr-trellis b/dockerfiles/Dockerfile.nextpnr-trellis new file mode 100644 index 0000000..59439fb --- /dev/null +++ b/dockerfiles/Dockerfile.nextpnr-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 diff --git a/recipes/Dockerfile.simulation b/dockerfiles/Dockerfile.simulation similarity index 78% rename from recipes/Dockerfile.simulation rename to dockerfiles/Dockerfile.simulation index a85b8c6..1c992a3 100644 --- a/recipes/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/recipes/Dockerfile.synthesis b/dockerfiles/Dockerfile.synthesis similarity index 84% rename from recipes/Dockerfile.synthesis rename to dockerfiles/Dockerfile.synthesis index 97f3cfa..c83c08e 100644 --- a/recipes/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/recipes/Dockerfile.ghdl b/recipes/Dockerfile.ghdl deleted file mode 100644 index 418f50e..0000000 --- a/recipes/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/recipes/Dockerfile.iverilog b/recipes/Dockerfile.iverilog deleted file mode 100644 index 6cdcfdc..0000000 --- a/recipes/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/recipes/Dockerfile.slang b/recipes/Dockerfile.slang deleted file mode 100644 index aa237e8..0000000 --- a/recipes/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/recipes/Dockerfile.surelog b/recipes/Dockerfile.surelog deleted file mode 100644 index 123bc71..0000000 --- a/recipes/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/recipes/Dockerfile.sv2v b/recipes/Dockerfile.sv2v deleted file mode 100644 index 3525752..0000000 --- a/recipes/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/recipes/Dockerfile.svlint b/recipes/Dockerfile.svlint deleted file mode 100644 index ce0a726..0000000 --- a/recipes/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/recipes/Dockerfile.synlig b/recipes/Dockerfile.synlig deleted file mode 100644 index af58541..0000000 --- a/recipes/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/recipes/Dockerfile.verible b/recipes/Dockerfile.verible deleted file mode 100644 index dcd5766..0000000 --- a/recipes/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/recipes/Dockerfile.verilator b/recipes/Dockerfile.verilator deleted file mode 100644 index a06f006..0000000 --- a/recipes/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/recipes/Dockerfile.vhd2vl b/recipes/Dockerfile.vhd2vl deleted file mode 100644 index f3a955b..0000000 --- a/recipes/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/recipes/Dockerfile.yosys b/recipes/Dockerfile.yosys deleted file mode 100644 index 01eb070..0000000 --- a/recipes/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 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}" 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