Skip to content

Commit 7420ed6

Browse files
committed
Add dockerfiles for iverilog and verilator, update simulation
1 parent b8da457 commit 7420ed6

3 files changed

Lines changed: 69 additions & 47 deletions

File tree

‎recipes/Dockerfile.iverilog‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# https://github.com/steveicarus/iverilog
2+
3+
FROM ubuntu:latest AS builder
4+
5+
WORKDIR /tmp
6+
7+
ENV DEBIAN_FRONTEND=noninteractive
8+
9+
RUN apt-get update -qq
10+
RUN apt-get install -y --no-install-recommends ca-certificates git
11+
RUN apt-get install -y --no-install-recommends build-essential bison flex
12+
RUN apt-get install -y --no-install-recommends autoconf gperf
13+
14+
RUN git clone --depth 1 https://github.com/steveicarus/iverilog
15+
RUN cd iverilog && autoconf && ./configure \
16+
&& make -j$(nproc) && make install
17+
18+
#------------------------------------------------------------------------------
19+
20+
FROM ubuntu:latest AS runtime
21+
22+
COPY --from=builder /usr/local /usr/local
23+
24+
RUN ldconfig

‎recipes/Dockerfile.simulation‎

Lines changed: 21 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,49 @@
1-
FROM ubuntu:latest AS build
1+
FROM ubuntu:latest AS builder
22

3-
WORKDIR /root
3+
WORKDIR /tmp
44

5-
#
6-
# Dependencies
7-
#
5+
ENV DEBIAN_FRONTEND=noninteractive
86

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/*
7+
RUN apt-get update -qq
8+
RUN apt-get install -y --no-install-recommends ca-certificates git
9+
RUN apt-get install -y --no-install-recommends autoconf build-essential bison flex
10+
RUN apt-get install -y --no-install-recommends autoconf gnat zlib1g-dev libfl-dev
11+
RUN apt-get install -y --no-install-recommends python3 gperf help2man
3712

3813
#
39-
# GHDL
14+
# ghdl
4015
#
4116

42-
RUN git clone --depth 1 https://github.com/ghdl/ghdl \
43-
&& mkdir ghdl/build && cd ghdl/build \
44-
&& ../configure --prefix=/usr/local \
17+
RUN git clone --depth 1 https://github.com/ghdl/ghdl
18+
RUN mkdir ghdl/build && cd ghdl/build && ../configure --prefix=/usr/local \
4519
&& make -j$(nproc) && make install
4620

4721
#
4822
# iVerilog
4923
#
5024

51-
RUN git clone --depth 1 https://github.com/steveicarus/iverilog \
52-
&& cd iverilog && autoconf && ./configure \
25+
RUN git clone --depth 1 https://github.com/steveicarus/iverilog
26+
RUN cd iverilog && autoconf && ./configure \
5327
&& make -j$(nproc) && make install
5428

5529
#
5630
# Verilator
5731
#
5832

59-
RUN git clone --depth 1 https://github.com/verilator/verilator \
60-
&& cd verilator && autoconf && ./configure \
33+
RUN git clone --depth 1 https://github.com/verilator/verilator
34+
RUN cd verilator && autoconf && ./configure \
6135
&& make -j$(nproc) && make install
6236

6337
#
6438
# cocotb
6539
#
6640

67-
RUN pip install cocotb --break-system-packages
41+
# RUN pip install cocotb --break-system-packages
6842

69-
#
70-
# Clean-up
71-
#
43+
#------------------------------------------------------------------------------
44+
45+
FROM ubuntu:latest AS runtime
7246

73-
###############################################################################
47+
COPY --from=builder /usr/local /usr/local
7448

75-
# FROM ubuntu:latest
49+
RUN ldconfig

‎recipes/Dockerfile.verilator‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# https://github.com/verilator/verilator
2+
3+
FROM ubuntu:latest AS builder
4+
5+
WORKDIR /tmp
6+
7+
ENV DEBIAN_FRONTEND=noninteractive
8+
9+
RUN apt-get update -qq
10+
RUN apt-get install -y --no-install-recommends ca-certificates git
11+
RUN apt-get install -y --no-install-recommends autoconf build-essential bison flex
12+
RUN apt-get install -y --no-install-recommends python3 libfl-dev help2man
13+
14+
RUN git clone --depth 1 https://github.com/verilator/verilator
15+
RUN cd verilator && autoconf && ./configure \
16+
&& make -j$(nproc) && make install
17+
18+
#------------------------------------------------------------------------------
19+
20+
FROM ubuntu:latest AS runtime
21+
22+
COPY --from=builder /usr/local /usr/local
23+
24+
RUN ldconfig

0 commit comments

Comments
 (0)