-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathDockerfile.ci
More file actions
136 lines (116 loc) · 5.21 KB
/
Copy pathDockerfile.ci
File metadata and controls
136 lines (116 loc) · 5.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
FROM ghcr.io/utoss/risc-v-toolchain:latest AS risc-v-toolchain
FROM ghcr.io/utoss/quartus:latest AS quartus
FROM ghcr.io/utoss/oss-cad-suite:latest AS oss-cad-suite
FROM public.ecr.aws/lts/ubuntu:22.04_stable
ARG DEBIAN_FRONTEND=noninteractive
ARG KEYRING_PATH=/usr/share/keyrings
ARG APT_SOURCES_PATH=/etc/apt/sources.list.d
# update and upgrade
RUN apt update && apt upgrade -y
# install essentialls
RUN apt update && \
apt install -y \
man make build-essential git zsh vim curl wget procps gnupg gnupg2 ca-certificates zip \
software-properties-common
# create dev sudo user
RUN useradd --create-home dev && \
usermod --append --groups sudo dev && \
apt update && apt install -y sudo && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# build and install icarus verilog
USER dev
ARG ICARUS_SRC_TAR=s20251012.tar.gz
ARG ICARUS_SRC_URL=https://github.com/steveicarus/iverilog/archive/refs/tags/${ICARUS_SRC_TAR}
ARG ICARUS_SRC_HASH="97776c5dd1ee09157f7cb9f48978c7687b9157b09fa7029c0f9378aac9a6f58c ${ICARUS_SRC_TAR}"
RUN sudo apt update && sudo apt install -y autoconf gperf make gcc g++ bison flex && \
cd /tmp && \
wget ${ICARUS_SRC_URL} && \
echo ${ICARUS_SRC_HASH} | sha256sum -c && \
tar -xzf ${ICARUS_SRC_TAR} && \
cd iverilog-* && sh autoconf.sh && ./configure && make && make check && sudo make install && \
cd .. && rm ${ICARUS_SRC_TAR} && rm -rf ./iverilog-*
# copy Verilator installation from OSS CAD Suite
USER dev
COPY --from=oss-cad-suite /opt/oss-cad-suite/bin/ /usr/local/bin/
COPY --from=oss-cad-suite /opt/oss-cad-suite/share/verilator/ /usr/local/share/verilator/
# install verilator runtime deps
USER dev
RUN sudo apt update && sudo apt install -y ccache
# copy quartus prime lite installation
USER dev
COPY --from=quartus /opt/quartus /opt/quartus
ENV PATH="/opt/quartus/quartus/bin:${PATH}"
# copy OSS CAD Suite installation
USER dev
COPY --from=oss-cad-suite /opt/oss-cad-suite /opt/oss-cad-suite
COPY --from=oss-cad-suite /etc/profile.d/oss-cad-suite.sh /etc/profile.d/oss-cad-suite.sh
ENV PATH="/opt/oss-cad-suite/bin:${PATH}"
# install riscv toolchain
USER dev
COPY --from=risc-v-toolchain /opt/riscv /opt/riscv
ENV PATH="/opt/riscv/bin:${PATH}"
# install SAIL simulator
USER dev
ARG SAIL_RISCV_VERSION=0.7
ARG SAIL_RISCV_ZIP_NAME=sail_riscv-Linux-x86_64.tar.gz
ARG SAIL_RISCV_ZIP_URL=https://github.com/riscv/sail-riscv/releases/download/${SAIL_RISCV_VERSION}/${SAIL_RISCV_ZIP_NAME}
ARG SAIL_RISCV_ZIP_HASH="6b8c3abc3126ce14911a3dec46ff540a60841ef090898f72c4c6f9b0b825efab ${SAIL_RISCV_ZIP_NAME}"
RUN mkdir -p /tmp/sail-riscv && \
cd /tmp/sail-riscv && \
wget ${SAIL_RISCV_ZIP_URL} && \
echo ${SAIL_RISCV_ZIP_HASH} | sha256sum -c && \
tar -xzf ${SAIL_RISCV_ZIP_NAME} && \
sudo mv sail_riscv-Linux-x86_64/bin/* /usr/local/bin/ && \
cd .. && sudo rm -r /tmp/sail-riscv && \
cd /usr/local/bin && \
sudo mv riscv_sim_rv32d riscv_sim_RV32 && \
sudo mv riscv_sim_rv64d riscv_sim_RV64
# install riscof
USER root
RUN apt update && apt install -y python3 python3-pip && \
pip3 install riscof
# install riscv-dv
RUN pip3 install PyYAML bitstring Sphinx Pallets-Sphinx-Themes sphinxcontrib-log-cabinet \
sphinx-issues sphinx_rtd_theme rst2pdf flake8 pyvsc tabulate pandas
ARG RISCV_DV_VERSION=b7a0b4b0b51346a3c64f159f81ea262d867c14a9
ARG RISCV_DV_TAR_NAME=${RISCV_DV_VERSION}.tar.gz
ARG RISCV_DV_TAR_URL=https://github.com/chipsalliance/riscv-dv/archive/${RISCV_DV_TAR_NAME}
ARG RISCV_DV_TAR_HASH="e95d179b52f3c8dd1566b5b7bf6a5b42c570bfb17cca7f1f2c73460a0c5d0669 ${RISCV_DV_TAR_NAME}"
RUN mkdir -p /tmp/riscv-dv && \
cd /tmp/riscv-dv && \
wget ${RISCV_DV_TAR_URL} && \
echo ${RISCV_DV_TAR_HASH} | sha256sum -c && \
tar -xzf ${RISCV_DV_TAR_NAME} && \
mv riscv-dv-* /opt/riscv-dv && \
cd .. && rm -rf /tmp/riscv-dv
ENV RISCV_DV_HOME=/opt/riscv-dv
# install svlint
USER dev
ARG SVLINT_VERSION=0.9.3
ARG SVLINT_ZIP_NAME=svlint-v${SVLINT_VERSION}-x86_64-lnx.zip
ARG SVLINT_ZIP_URL=https://github.com/dalance/svlint/releases/download/v${SVLINT_VERSION}/${SVLINT_ZIP_NAME}
ARG SVLINT_ZIP_HASH="df44caa38e0cddd09bafa93365d489e47f4823bdda26aa923028c2f06df90456 ${SVLINT_ZIP_NAME}"
RUN mkdir -p /tmp/svlint && \
cd /tmp/svlint && \
wget ${SVLINT_ZIP_URL} && \
echo ${SVLINT_ZIP_HASH} | sha256sum -c && \
unzip ${SVLINT_ZIP_NAME} && \
sudo mv bin/* /usr/local/bin/ && \
cd .. && rm -r /tmp/svlint
# CI needs priviledged access
USER root
# install svsch
RUN apt update && apt install -y curl && \
curl -fsSL https://deb.nodesource.com/setup_24.x | bash - && \
apt install -y nodejs && \
npm install -g svsch@0.4.0
# install Nangate45 open cell library
ARG NANGATE45_LIB_NAME=NangateOpenCellLibrary_typical.lib
ARG NANGATE45_LIB_URL=https://raw.githubusercontent.com/The-OpenROAD-Project/OpenROAD-flow-scripts/master/flow/platforms/nangate45/lib/${NANGATE45_LIB_NAME}
ARG NANGATE45_LIB_HASH="8d540a4d4cf6d09d27c87ad067857a9c0c2eeb023ab7a56e058cd3113db4e9b1 ${NANGATE45_LIB_NAME}"
RUN mkdir -p /opt/pdks/nangate45 && \
cd /opt/pdks/nangate45 && \
wget ${NANGATE45_LIB_URL} && \
echo "${NANGATE45_LIB_HASH}" | sha256sum -c && \
chmod 644 ${NANGATE45_LIB_NAME}
ENV NANGATE45_LIB=/opt/pdks/nangate45/NangateOpenCellLibrary_typical.lib