Skip to content

Commit

Permalink
Merge branch 'update-debian-base-image2' into 'master'
Browse files Browse the repository at this point in the history
Update docker image from Debian Bullseye to Debian Bookworm

Apart from the usual benefits of updating to a more recent Debian image, it also includes:

* Yosys from the official debian repo, v0.23-6
* Verilator from the official debian repo, v5.006

See merge request hdl-libraries/bedrock!177
  • Loading branch information
ldoolitt committed Nov 16, 2023
2 parents 4158a53 + 29d7a60 commit 4dc1fb7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 58 deletions.
3 changes: 1 addition & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ stages:
variables:
XILINX_VIVADO: /non-free/Xilinx/Vivado/2020.2
CI_REGISTRY: mohs.dhcp.lbl.gov
CONTAINER_IMAGE: $CI_REGISTRY/testing_base_bullseye
CONTAINER_IMAGE: $CI_REGISTRY/testing_base_bookworm
# CONTAINER_IM_IMAGE: $CI_REGISTRY/riscv_bloat
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
Expand Down Expand Up @@ -113,7 +113,6 @@ sphinx_docs:
python3 -m pip install \
sphinx==5.0.2 \
sphinx_rtd_theme \
numpy \
m2r2==0.3.2
sed -i -e '/pattern="PS"/ s/rights=".*" pattern=/rights="read|write" pattern=/g' \
-e '/pattern="PDF"/ s/rights=".*" pattern=/rights="read|write" pattern=/g' \
Expand Down
72 changes: 17 additions & 55 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:bullseye-slim as testing_base_bullseye
FROM debian:bookworm-slim as testing_base_bookworm

# Vivado needs libtinfo5, at least for Artix?
RUN apt-get update && \
Expand All @@ -8,6 +8,8 @@ RUN apt-get update && \
libbsd-dev \
xc3sprog \
build-essential \
yosys \
verilator \
libtinfo5 \
wget \
iputils-ping \
Expand All @@ -19,6 +21,9 @@ RUN apt-get update && \
python3-numpy \
python3-scipy \
python3-matplotlib \
python3-yaml \
python3-serial \
python3-setuptools-scm \
gcc-riscv64-unknown-elf \
picolibc-riscv64-unknown-elf \
cmake \
Expand All @@ -35,71 +40,29 @@ RUN apt-get update && \
# gcc-riscv64-unknown-elf above replace our previous
# approach, used in Buster, of building from source

# Allow pip to install packages
RUN mkdir -p $HOME/.config/pip && \
printf "[global]\nbreak-system-packages = true\n" > \
$HOME/.config/pip/pip.conf && \
cat $HOME/.config/pip/pip.conf

# vhd2vl
RUN git clone https://github.com/ldoolitt/vhd2vl && \
cd vhd2vl && \
git checkout 37e3143395ce4e7d2f2e301e12a538caf52b983c && \
git checkout bbe3198c435a4a6325bdd08b7b43a47b6dacf5de && \
make && \
install src/vhd2vl /usr/local/bin && \
cd .. && \
rm -rf vhd2vl

# Yosys
# For now we need to build yosys from source, since Debian Bullseye
# is stuck at yosys-0.9 that doesn't have the features we need.
# Commit 7ce5011 corresponds to yosys-0.23 2022-11-08, matching
# the version in Debian Bookworm.
# Note that the standard yosys build process used here requires
# network access to download abc from https://github.com/YosysHQ/abc.
RUN apt-get update && \
apt-get install -y \
clang \
libreadline-dev \
tcl-dev \
libffi-dev \
graphviz \
xdot \
libboost-system-dev \
libboost-python-dev \
libboost-filesystem-dev \
zlib1g-dev && \
rm -rf /var/lib/apt/lists/* && \
git clone https://github.com/cliffordwolf/yosys.git && \
cd yosys && \
git checkout 7ce5011c24bc4c605578bb16576cadf79373e23f && \
make config-clang && \
make -j4 && \
make install && \
cd .. && \
rm -rf yosys
# Yosys and Verilator are no longer built from source, just included
# in apt-get list above. Tested good in Debian Bookworm.

# Because we are running inside docker, installing
# python packages system wide should be ok
RUN pip3 install \
pyyaml==5.1.2 pyserial==3.4 setuptools-scm==7.1.0 \
nmigen==0.2

# we need a version of verilator with more than 20000, issue #1574,
# any version > v4.110 should have this limit increased to 40000.
# libz-dev required for Verilator FST support
RUN apt-get update && \
apt-get install -y \
libfl2 \
libfl-dev \
libz-dev \
zlib1g \
zlib1g-dev \
autoconf && \
rm -rf /var/lib/apt/lists/* && \
git clone https://github.com/verilator/verilator && \
cd verilator && \
git checkout v4.228 && \
autoconf && \
./configure && \
make -j4 && \
make install && \
cd ../ && \
rm -rf verilator && \
verilator -V

# SymbiYosys formal verification tool + Yices 2 solver (`sby` command)
RUN apt-get update && \
apt-get install -y \
Expand All @@ -114,7 +77,6 @@ RUN apt-get update && \
graphviz \
xdot \
pkg-config \
python \
python3 \
libftdi-dev \
gperf \
Expand Down
2 changes: 1 addition & 1 deletion build-tools/top_rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ VLATORFLAGS = $(subst -y,-y ,${VFLAGS}) $(subst -y,-y ,${VFLAGS_DEP}) -y . -I.
# keep -Wno-TIMESCALEMOD separate, since it's a new flag not supported by Verilator 4.010 in Debian Buster
VLATOR_TIMESCALEMOD = -Wno-TIMESCALEMOD
# new flag for Verilator v4.226 and beyond
# VLATOR_TIMING = --timing
VLATOR_TIMING = --timing
VLATOR_LINT_IGNORE = -Wno-PINMISSING -Wno-WIDTH -Wno-REDEFMACRO -Wno-PINCONNECTEMPTY $(VLATOR_TIMESCALEMOD)
VERILATOR_LINT = $(VERILATOR) $(VG_ALL) ${VLATORFLAGS} ${VLATOR_LINT_IGNORE} --lint-only $(filter %.v %.sv, $^)
VERILATOR_MAKEDEP = $(VERILATOR_LINT) -Wno-DECLFILENAME -Wno-UNUSED -Wno-CASEINCOMPLETE -Wno-UNDRIVEN $(VLATOR_TIMING) --MMD --Mdir $(DEPDIR)
Expand Down

0 comments on commit 4dc1fb7

Please sign in to comment.