diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3787933..bebc407 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -12,8 +12,9 @@ jobs: fail-fast: false matrix: name: - - synthesis - langutils + - synthesis + - simulation steps: - uses: actions/checkout@v2 - name: Login to GitHub Container Registry diff --git a/README.md b/README.md index 2b87413..501acaf 100644 --- a/README.md +++ b/README.md @@ -12,3 +12,8 @@ * [ghdl-yosys-plugin](https://github.com/ghdl/ghdl-yosys-plugin) * [yosys-slang](https://github.com/povik/yosys-slang) * [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) diff --git a/recipes/simulation b/recipes/simulation new file mode 100644 index 0000000..15378d1 --- /dev/null +++ b/recipes/simulation @@ -0,0 +1,75 @@ +FROM ubuntu:latest AS build + +WORKDIR /root + +# +# Dependencies +# + +RUN apt-get update -qq \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + # Common + build-essential \ + ca-certificates \ + git \ + python3 \ + zlib1g-dev \ + # GHDL + gnat \ + # iVerilog & Verilator + autoconf \ + bison \ + flex \ + gperf \ + # Verilator + help2man \ + libfl2 \ + libfl-dev \ + zlib1g \ + ccache \ + mold \ + # cocotb + python3-pip \ + libpython3-dev \ + libgoogle-perftools-dev numactl \ + && apt-get autoclean && apt-get clean && apt-get -y autoremove \ + && rm -rf /var/lib/apt/lists/* + +# +# GHDL +# + +RUN git clone --depth 1 https://github.com/ghdl/ghdl \ + && 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 \ + && cd iverilog && autoconf && ./configure \ + && make -j$(nproc) && make install + +# +# Verilator +# + +RUN git clone --depth 1 https://github.com/verilator/verilator \ + && cd verilator && autoconf && ./configure \ + && make -j$(nproc) && make install + +# +# cocotb +# + +RUN pip install cocotb --break-system-packages + +# +# Clean-up +# + +############################################################################### + +# FROM ubuntu:latest diff --git a/tests/simulation.sh b/tests/simulation.sh new file mode 100644 index 0000000..f99fe5c --- /dev/null +++ b/tests/simulation.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +DOCKER="docker run --rm -v $HOME:$HOME -w $PWD --user $(id -u):$(id -g) ghcr.io/pyfpga/simulation" + +$DOCKER ghdl --version +$DOCKER iverilog -V | grep Icarus +$DOCKER verilator --version +$DOCKER cocotb-config --version