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 languagessynthesis: tools for logic synthesis- GHDL
- Yosys (now including sv-elab)
- ghdl-yosys-plugin
- synlig
simulation: tools for simulation- nextpnr based containers: place and route + bitstream manipulation
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.
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.
Notes:
- Only
$PWDis mounted: files outside the current directory (e.g.../rtl/top.v) are not visible inside the container. Run from a common parent directory or mount it instead (-v $HOME:$HOME). --user $(id -u):$(id -g)makes generated files belong to you instead of root.- Each container is independent: a full flow chains several of them (e.g.
yosysfromsynthesis, thennextpnr-*for place and route).
| Image | Executables (in /usr/local/bin unless stated) |
|---|---|
langutils |
vhd2vl, sv2v, slang, slang-tidy, surelog, svlint, verible-verilog-* (syntax, lint, format, ls, preprocessor, ...) |
synthesis |
ghdl, yosys (with plugin -i ghdl and read_slang), synlig |
simulation |
ghdl, iverilog, vvp, verilator, verilator_coverage, python3 with cocotb, cocotbext-axi, pytest, wavedrom |
nextpnr-icestorm |
nextpnr-ice40, icepack, iceunpack, icetime, icepll, icebram, icemulti, iceprog, icebox_* |
nextpnr-trellis |
nextpnr-ecp5, ecppack, ecpunpack, ecppll, ecpbram, ecpmulti |
nextpnr-apicula |
nextpnr-himbaechel (gowin uarch), gowin_pack, gowin_unpack, gowin_pll (apycula, Python) |
Define a helper (adjust the mount if your sources are outside $PWD):
RUN="docker run --rm -v $PWD:$PWD -w $PWD --user $(id -u):$(id -g) ghcr.io/pyfpga"Language utilities:
$RUN/langutils sv2v top.sv --write=top.v # SystemVerilog to Verilog
$RUN/langutils vhd2vl top.vhdl top.v # VHDL to Verilog
$RUN/langutils slang top.sv --lint-only # SystemVerilog lint
$RUN/langutils verible-verilog-lint top.svSynthesis:
$RUN/synthesis yosys -p 'read_verilog -sv top.sv; synth -top top'
$RUN/synthesis yosys -p 'read_slang top.sv -top top; synth -top top'
$RUN/synthesis yosys -p 'plugin -i ghdl; ghdl top.vhdl -e top; synth -top top'
$RUN/synthesis ghdl synth --out=verilog top.vhdl -e top > top.vSimulation:
$RUN/simulation iverilog -g2012 -o sim tb.sv top.sv && $RUN/simulation vvp sim
$RUN/simulation verilator --binary --top-module tb tb.sv top.sv
$RUN/simulation python3 test_top.py # cocotb (cocotb_tools.runner), see tests/cocotbFull flows, synthesis + place and route + bitstream:
# Lattice iCE40 (iCEstick)
$RUN/synthesis yosys -p 'read_verilog -sv top.sv; synth_ice40 -top top -json top.json'
$RUN/nextpnr-icestorm nextpnr-ice40 --hx1k --package tq144 --pcf top.pcf --json top.json --asc top.asc
$RUN/nextpnr-icestorm icepack top.asc top.bin
# Lattice ECP5 (OrangeCrab)
$RUN/synthesis yosys -p 'read_verilog -sv top.sv; synth_ecp5 -top top -json top.json'
$RUN/nextpnr-trellis nextpnr-ecp5 --25k --package CSFBGA285 --lpf top.lpf --json top.json --textcfg top.config
$RUN/nextpnr-trellis ecppack top.config top.bit
# Gowin (Tang Nano 9K)
$RUN/synthesis yosys -p 'read_verilog -sv top.sv; synth_gowin -top top -json top.json'
$RUN/nextpnr-apicula nextpnr-himbaechel --device GW1NR-LV9QN88PC6/I5 --vopt family=GW1N-9C \
--vopt cst=top.cst --json top.json --write top_pnr.json
$RUN/nextpnr-apicula gowin_pack -d GW1N-9C -o top.fs top_pnr.jsonWorking examples of every tool (with HDL sources and constraint files) are in tests.