Skip to content

Commit

Permalink
[docker] use CI verilator build in docker instead of custom apt source
Browse files Browse the repository at this point in the history
  • Loading branch information
nbdd0121 committed Apr 19, 2024
1 parent 79b4f81 commit 0a8118d
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,12 @@ LABEL description="Ibex Demo System Container."
# Use bash as default shell.
RUN ln -sf /bin/bash /bin/sh

# Add OBS repository to apt sources.
RUN OBS_URL="https://download.opensuse.org/repositories"; \
OBS_PATH="/home:/phiwag:/edatools/xUbuntu_20.04"; \
REPO_URL="${OBS_URL}${OBS_PATH}"; \
\
EDATOOLS_REPO_KEY="${REPO_URL}/Release.key"; \
EDATOOLS_REPO="deb ${REPO_URL}/ /"; \
\
apt-get update && \
apt-get install -y curl && \
\
curl -f -sL -o "$TMPDIR/obs.asc" "$EDATOOLS_REPO_KEY" || { \
error "Failed to download repository key from ${REPO_URL}"; \
} && \
echo "$EDATOOLS_REPO" > "$TMPDIR/obs.list" && \
mv "$TMPDIR/obs.asc" /etc/apt/trusted.gpg.d/obs.asc && \
mv "$TMPDIR/obs.list" /etc/apt/sources.list.d/edatools.list

# Necessary to avoid user interaction with tzdata during install
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=UTC

COPY container/apt-requirements.txt /tmp/apt-requirements.txt
RUN echo "verilator-${VERILATOR_VERSION}" >> /tmp/apt-requirements.txt \
&& sed -i -e '/^$/d' -e '/^#/D' -e 's/#.*//' /tmp/apt-requirements.txt \
RUN sed -i -e '/^$/d' -e '/^#/D' -e 's/#.*//' /tmp/apt-requirements.txt \
&& apt-get update \
&& xargs apt-get install -y < /tmp/apt-requirements.txt \
&& apt-get clean; \
Expand All @@ -58,6 +39,11 @@ RUN /tmp/get-toolchain.py -r ${RISCV_TOOLCHAIN_RELEASE_TAG} \
&& rm -f /tmp/get-toolchain.py
ENV PATH "/tools/riscv/bin:${PATH}"

# Install verilator prebuild binary
RUN mkdir -p /tools/verilator \
&& curl -sSfL https://storage.googleapis.com/verilator-builds/verilator-v${VERILATOR_VERSION}.tar.gz | tar -C /tools/verilator -xvzf -
ENV PATH "/tools/verilator/v${VERILATOR_VERSION}/bin:${PATH}"

# Install Verible
RUN curl -f -Ls -o verible.tar.gz \
https://github.com/chipsalliance/verible/releases/download/${VERIBLE_VERSION}/verible-${VERIBLE_VERSION}-Ubuntu-18.04-bionic-x86_64.tar.gz \
Expand Down

0 comments on commit 0a8118d

Please sign in to comment.