@@ -26,26 +26,65 @@ COPY Makefile ./
2626COPY requirements-dev.txt ./
2727
2828# Install SSH keys to access private repositories
29- RUN mkdir -p -m 0700 ~/.ssh && ssh-keyscan iis-git.ee.ethz.ch >> ~/.ssh/known_hosts
30-
31- # Compile emulators
29+ RUN mkdir -p -m 0700 ~/.ssh && \
30+ ssh-keyscan iis-git.ee.ethz.ch >> ~/.ssh/known_hosts && \
31+ ssh-keyscan github.com >> ~/.ssh/known_hosts
32+
33+ # Install build dependencies for GAP9 SDK
34+ RUN apt-get update && \
35+ apt-get install -y \
36+ device-tree-compiler \
37+ bison \
38+ flex \
39+ rsync \
40+ build-essential \
41+ g++ \
42+ python3-dev && \
43+ rm -rf /var/lib/apt/lists/*
44+
45+ # Compile emulators (except banshee and gvsoc)
3246# WIESEP: We need to already clean up some space, otherwise the GitHub runners run out of disk space
3347RUN --mount=type=cache,target=/ccache \
3448 --mount=type=cache,target=/root/.cache/pip \
3549 --mount=type=cache,target=/root/.cargo/registry \
36- ccache -z && \
37- make pulp-sdk chimera-sdk qemu mempool banshee xtensor && \
38- make gvsoc && \
39- cp -r /app/toolchain/gvsoc/core/requirements.txt /app/core-requirements.txt && \
50+ make pulp-sdk chimera-sdk qemu mempool xtensor
51+
52+ # Install Rust 1.70.0 separately for better caching
53+ RUN --mount=type=cache,target=/root/.cargo/registry \
54+ rustup install 1.70.0 && \
55+ rustup default 1.70.0
56+
57+ # Install GAP9 RISC-V GCC toolchain (required for GAP9 SDK build)
58+ RUN --mount=type=cache,target=/ccache \
59+ make gap9-toolchain
60+
61+ # Build GAP9 SDK
62+ RUN --mount=type=ssh \
63+ --mount=type=cache,target=/ccache \
64+ --mount=type=cache,target=/root/.cache/pip \
65+ make gap9-sdk
66+
67+ # Compile banshee with Rust 1.70.0
68+ RUN --mount=type=cache,target=/ccache \
69+ --mount=type=cache,target=/root/.cache/pip \
70+ --mount=type=cache,target=/root/.cargo/registry \
71+ export PATH="/root/.rustup/toolchains/1.70.0-x86_64-unknown-linux-gnu/bin:$PATH" && \
72+ make banshee
73+
74+ # Compile gvsoc
75+ RUN --mount=type=cache,target=/ccache \
76+ --mount=type=cache,target=/root/.cache/pip \
77+ --mount=type=cache,target=/root/.cargo/registry \
78+ make gvsoc
79+
80+ # Save gvsoc requirements and clean up toolchain source
81+ RUN cp -r /app/toolchain/gvsoc/core/requirements.txt /app/core-requirements.txt && \
4082 cp -r /app/toolchain/gvsoc/gapy/requirements.txt /app/gapy-requirements.txt && \
41- rm -rf toolchain/pulp-sdk toolchain/qemu toolchain/mempool toolchain/banshee toolchain/xtensor toolchain/xtl toolchain/xsimd toolchain/gvsoc && \
42- ccache -s
83+ rm -rf toolchain/pulp-sdk toolchain/qemu toolchain/mempool toolchain/banshee toolchain/xtensor toolchain/xtl toolchain/xsimd toolchain/gvsoc
4384
4485# Install SoftHier emulator and toolchain
4586RUN --mount=type=cache,target=/ccache \
46- ccache -z && \
47- make SOFTHIER_INSTALL_DIR=/app/install/softhier softhier && \
48- ccache -s
87+ make SOFTHIER_INSTALL_DIR=/app/install/softhier softhier
4988
5089# Install Bender
5190RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
62101ENV CC="gcc"
63102ENV CXX="g++"
64103
65- RUN --mount=type=ssh \
66- --mount=type=cache,target=/ccache \
67- --mount=type=cache,target=/root/.cache/pip \
68- ccache -z && \
69- make gap9-sdk && \
70- ccache -s
71104
72105RUN --mount=type=cache,target=/ccache \
73106 --mount=type=cache,target=/root/.cache/pip \
74- ccache -z && \
75- make snitch_runtime && \
76- ccache -s
107+ make snitch_runtime
77108
78109# Remove toolchain to make the container lighter
79110RUN rm -rf toolchain
0 commit comments