Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5a96507
Add basic documentation
rodrigomelo9 Sep 27, 2026
f11aa3f
Add svlint into the langutils container
rodrigomelo9 Sep 27, 2026
625ce40
langutils rewritten, to fix surelog compilation and reduce final weight
rodrigomelo9 Sep 27, 2026
7eb7c67
Add langutils tests
rodrigomelo9 Sep 27, 2026
72d43b2
Add purge script, to remove Docker containers related things
rodrigomelo9 Sep 27, 2026
0e4eca7
Modify build script to use host network and avoid VPN errors
rodrigomelo9 Sep 27, 2026
128d018
Add the 'Dockerfile.' prefix. update langutils
rodrigomelo9 Sep 27, 2026
4a7f957
Add individual dockerfiles for slang, surelog, sv2v, svlint, verible …
rodrigomelo9 Sep 27, 2026
a79c8b3
Update README - yosys-slang was renamed as sv-elab
rodrigomelo9 Sep 27, 2026
7a89a08
Ignore slpp_all
rodrigomelo9 Sep 28, 2026
361df27
Update langutils test to be able of using PoC recipes
rodrigomelo9 Sep 28, 2026
fe1d3c6
ci: add paths on push
rodrigomelo9 Sep 28, 2026
9670af3
Add dockerfiles for ghdl, yosys and synlig, update synthesis
rodrigomelo9 Sep 28, 2026
b8da457
Simplify final COPY on all the dockerfiles
rodrigomelo9 Sep 28, 2026
7420ed6
Add dockerfiles for iverilog and verilator, update simulation
rodrigomelo9 Sep 29, 2026
aa2d247
Install missing dependencies for synthesis
rodrigomelo9 Sep 29, 2026
d60269b
Add a script to check the needed dynamic libraries
rodrigomelo9 Sep 29, 2026
ef354ec
Reorder packages
rodrigomelo9 Sep 29, 2026
0fbc1b1
Install cocotb using a venv
rodrigomelo9 Sep 29, 2026
e7fcefe
Modify how libgnat is installed
rodrigomelo9 Sep 29, 2026
3c47d8c
Add ldconfig when missing
rodrigomelo9 Sep 29, 2026
df0f226
Remove to load the slang plugin, not needed anymore
rodrigomelo9 Sep 29, 2026
a7307d5
Add the sanity script to build and test all
rodrigomelo9 Sep 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Deploy Docker Images

on:
push:
paths:
- 'recipes/Dockerfile.langutils'
- 'recipes/Dockerfile.synthesis'
- 'recipes/Dockerfile.simulation'
schedule:
- cron: '0 21 * * 5'

Expand All @@ -24,6 +28,6 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image for ${{ matrix.name }}
run: docker build -f recipes/${{ matrix.name }} -t ghcr.io/pyfpga/${{ matrix.name }} .
run: docker build -f recipes/Dockerfile.${{ matrix.name }} -t ghcr.io/pyfpga/${{ matrix.name }} .
- name: Push Docker image for ${{ matrix.name }}
run: docker push ghcr.io/pyfpga/${{ matrix.name }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
results
slpp_all
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
# PyFPGA containers

A collection of Docker containers featuring a curated selection of Free/Libre and Open-Source Software (FLOSS) tools for FPGA development.
They streamline the setup process, ensuring consistency and easy access across diverse environments.
Below is a list of the available containers and their included tools.

* `langutils`: utilities for processing and analyzing HDL languages
* [vhd2vl](https://github.com/ldoolitt/vhd2vl)
* [Slang](https://github.com/MikePopoloski/slang)
* [sv2v](https://github.com/zachjs/sv2v)
* [svlint](https://github.com/dalance/svlint)
* [Verible](https://github.com/chipsalliance/verible)
* [Surelog](https://github.com/chipsalliance/Surelog)
* `synthesis`: tools for logic synthesis
* [GHDL](https://github.com/ghdl/ghdl)
* [Yosys](https://github.com/YosysHQ/yosys)
* [ghdl-yosys-plugin](https://github.com/ghdl/ghdl-yosys-plugin)
* [yosys-slang](https://github.com/povik/yosys-slang)
* [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)

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.

```bash
docker run --user $(id -u):$(id -g) --rm -v $PWD:$PWD -w $PWD ghcr.io/pyfpga/<image> <command>
```

Replace `<image>` with the appropriate image name and `<command>` with the command you want to execute inside the container.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
set -e
IMAGE=$1
docker build -f recipes/$IMAGE -t ghcr.io/pyfpga/$IMAGE .
docker build -f recipes/Dockerfile.$IMAGE --network=host -t ghcr.io/pyfpga/$IMAGE .
4 changes: 4 additions & 0 deletions purge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -e
docker rmi -f $(docker images -q)
docker system prune -a --volumes -f
28 changes: 28 additions & 0 deletions recipes/Dockerfile.ghdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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
30 changes: 30 additions & 0 deletions recipes/Dockerfile.iverilog
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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
88 changes: 88 additions & 0 deletions recipes/Dockerfile.langutils
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
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 \
cargo \
cmake \
curl \
default-jre \
flex \
python3 \
python3-orderedmultidict

#
# vhd2vl
#

RUN git clone --depth 1 https://github.com/ldoolitt/vhd2vl
RUN cd vhd2vl && make -j$(nproc) && make install

#
# sv2v
#

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

#
# Slang
#

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
#

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

#
# Verible
#

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

#
# svlint
#

RUN cargo install --root /usr/local --git https://github.com/dalance/svlint.git svlint

#
# clean-up
#

RUN rm -f /usr/local/bin/stack /usr/local/bin/bazel

#------------------------------------------------------------------------------

FROM ubuntu:latest AS runtime

COPY --from=builder /usr/local /usr/local

RUN ldconfig
83 changes: 83 additions & 0 deletions recipes/Dockerfile.simulation
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
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 \
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
#

RUN git clone --depth 1 https://github.com/steveicarus/iverilog
RUN cd iverilog && autoconf && ./configure \
&& make -j$(nproc) && make install

#
# Verilator
#

RUN git clone --depth 1 https://github.com/verilator/verilator
RUN cd verilator && autoconf && ./configure \
&& make -j$(nproc) && make install

#
# cocotb
#

# RUN pip install cocotb --break-system-packages

RUN python3 -m venv /opt/venv && /opt/venv/bin/pip install --no-cache-dir cocotb

#
# Optimization
#

RUN strip /usr/local/bin/* 2>/dev/null || true
RUN find /usr/local/lib -name "*.so*" -exec strip --strip-unneeded {} + 2>/dev/null || true

#------------------------------------------------------------------------------

FROM ubuntu:latest AS runtime

ENV PATH="/opt/venv/bin:$PATH"

RUN apt-get update -qq && apt-get install -y --no-install-recommends \
g++ \
make \
perl \
python3 \
libgnat-14 \
zlib1g \
&& rm -rf /var/lib/apt/lists/*

COPY --from=builder /usr/local /usr/local
COPY --from=builder /opt/venv /opt/venv

RUN ldconfig
28 changes: 28 additions & 0 deletions recipes/Dockerfile.slang
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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
35 changes: 35 additions & 0 deletions recipes/Dockerfile.surelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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
29 changes: 29 additions & 0 deletions recipes/Dockerfile.sv2v
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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
Loading
Loading