Skip to content

Commit abdc012

Browse files
authored
Merge pull request #12 from PyFPGA/add-simulation
Add simulation
2 parents 22fcca6 + 49409f3 commit abdc012

File tree

4 files changed

+92
-1
lines changed

4 files changed

+92
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
name:
15-
- synthesis
1615
- langutils
16+
- synthesis
17+
- simulation
1718
steps:
1819
- uses: actions/checkout@v2
1920
- name: Login to GitHub Container Registry

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@
1212
* [ghdl-yosys-plugin](https://github.com/ghdl/ghdl-yosys-plugin)
1313
* [yosys-slang](https://github.com/povik/yosys-slang)
1414
* [synlig](https://github.com/chipsalliance/synlig)
15+
* `simulation`: tools for simulation
16+
* [GHDL](https://github.com/ghdl/ghdl)
17+
* [iVerilog](https://github.com/steveicarus/iverilog)
18+
* [Verilator](https://github.com/verilator/verilator)
19+
* [cocotb](https://github.com/cocotb/cocotb)

recipes/simulation

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
FROM ubuntu:latest AS build
2+
3+
WORKDIR /root
4+
5+
#
6+
# Dependencies
7+
#
8+
9+
RUN apt-get update -qq \
10+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
11+
# Common
12+
build-essential \
13+
ca-certificates \
14+
git \
15+
python3 \
16+
zlib1g-dev \
17+
# GHDL
18+
gnat \
19+
# iVerilog & Verilator
20+
autoconf \
21+
bison \
22+
flex \
23+
gperf \
24+
# Verilator
25+
help2man \
26+
libfl2 \
27+
libfl-dev \
28+
zlib1g \
29+
ccache \
30+
mold \
31+
# cocotb
32+
python3-pip \
33+
libpython3-dev \
34+
libgoogle-perftools-dev numactl \
35+
&& apt-get autoclean && apt-get clean && apt-get -y autoremove \
36+
&& rm -rf /var/lib/apt/lists/*
37+
38+
#
39+
# GHDL
40+
#
41+
42+
RUN git clone --depth 1 https://github.com/ghdl/ghdl \
43+
&& mkdir ghdl/build && cd ghdl/build \
44+
&& ../configure --prefix=/usr/local \
45+
&& make -j$(nproc) && make install
46+
47+
#
48+
# iVerilog
49+
#
50+
51+
RUN git clone --depth 1 https://github.com/steveicarus/iverilog \
52+
&& cd iverilog && autoconf && ./configure \
53+
&& make -j$(nproc) && make install
54+
55+
#
56+
# Verilator
57+
#
58+
59+
RUN git clone --depth 1 https://github.com/verilator/verilator \
60+
&& cd verilator && autoconf && ./configure \
61+
&& make -j$(nproc) && make install
62+
63+
#
64+
# cocotb
65+
#
66+
67+
RUN pip install cocotb --break-system-packages
68+
69+
#
70+
# Clean-up
71+
#
72+
73+
###############################################################################
74+
75+
# FROM ubuntu:latest

tests/simulation.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
DOCKER="docker run --rm -v $HOME:$HOME -w $PWD --user $(id -u):$(id -g) ghcr.io/pyfpga/simulation"
6+
7+
$DOCKER ghdl --version
8+
$DOCKER iverilog -V | grep Icarus
9+
$DOCKER verilator --version
10+
$DOCKER cocotb-config --version

0 commit comments

Comments
 (0)