Skip to content

Commit 821155f

Browse files
authored
Remove riscv toolchain (#290)
The Dockerfile contains the executable files and reference emulator, instead of a full-fledged container for development.
1 parent 5a5b73a commit 821155f

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

Dockerfile

+21-17
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,38 @@
1-
FROM sysprog21/rv32emu-gcc as base_gcc
21
FROM sysprog21/rv32emu-sail as base_sail
32

4-
FROM ubuntu:22.04 as final
3+
FROM ubuntu:22.04 as base_gcc
54

6-
# Install extra packages for the emulator to compile and execute with full capabilities correctly
5+
# install extra packages for the emulator to compile with full capabilities correctly
76
RUN apt-get update && \
87
DEBIAN_FRONTEND=noninteractive apt-get install -y \
9-
libsdl2-dev libsdl2-mixer-dev python3-pip git && \
8+
build-essential curl git && \
109
rm -rf /var/lib/apt/lists/*
1110

12-
RUN python3 -m pip install git+https://github.com/riscv/riscof
11+
# copy in the source code
12+
WORKDIR /home/root/rv32emu
13+
COPY . .
14+
15+
# generate execution file for rv32emu and rv_histogram
16+
RUN make
17+
RUN make tool
18+
19+
FROM ubuntu:22.04 as final
1320

1421
# set up the timezone
1522
ENV TZ=Asia/Taipei
1623
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
1724

18-
# copy in the source code
25+
# copy in elf files and reference emulator
1926
WORKDIR /home/root/rv32emu
20-
COPY . .
21-
22-
# Copy the GNU Toolchain files
23-
ENV RISCV=/opt/riscv
24-
ENV PATH=$RISCV/bin:$PATH
25-
COPY --from=base_gcc /opt/riscv/ /opt/riscv/
27+
COPY ./build/*.elf /home/root/rv32emu/build/
28+
COPY ./tests/arch-test-target/sail_cSim/riscv_sim_RV32 /home/root/rv32emu/tests/arch-test-target/sail_cSim/
2629

2730
# replace the emulator (riscv_sim_RV32) with the arch that the container can execute
2831
RUN rm /home/root/rv32emu/tests/arch-test-target/sail_cSim/riscv_sim_RV32
29-
COPY --from=base_sail /home/root/riscv_sim_RV32 /home/root/rv32emu/tests/arch-test-target/sail_cSim/riscv_sim_RV32
32+
COPY --from=base_sail /home/root/riscv_sim_RV32 /home/root/rv32emu/tests/arch-test-target/sail_cSim/
3033

31-
# generate execution file for rv32emu and rv_histogram
32-
RUN make
33-
RUN make tool
34-
ENV PATH=/home/root/rv32emu/build:$PATH
34+
# get rv32emu and rv_histogram binaries
35+
COPY --from=base_gcc /home/root/rv32emu/build/rv32emu /home/root/rv32emu/build/rv32emu
36+
COPY --from=base_gcc /home/root/rv32emu/build/rv_histogram /home/root/rv32emu/build/rv_histogram
37+
38+
ENV PATH=/home/root/rv32emu/build:/home/root/rv32emu/tests/arch-test-target/sail_cSim:$PATH

0 commit comments

Comments
 (0)