|
1 |
| -FROM sysprog21/rv32emu-gcc as base_gcc |
2 | 1 | FROM sysprog21/rv32emu-sail as base_sail
|
3 | 2 |
|
4 |
| -FROM ubuntu:22.04 as final |
| 3 | +FROM ubuntu:22.04 as base_gcc |
5 | 4 |
|
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 |
7 | 6 | RUN apt-get update && \
|
8 | 7 | DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
9 |
| - libsdl2-dev libsdl2-mixer-dev python3-pip git && \ |
| 8 | + build-essential curl git && \ |
10 | 9 | rm -rf /var/lib/apt/lists/*
|
11 | 10 |
|
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 |
13 | 20 |
|
14 | 21 | # set up the timezone
|
15 | 22 | ENV TZ=Asia/Taipei
|
16 | 23 | RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
17 | 24 |
|
18 |
| -# copy in the source code |
| 25 | +# copy in elf files and reference emulator |
19 | 26 | 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/ |
26 | 29 |
|
27 | 30 | # replace the emulator (riscv_sim_RV32) with the arch that the container can execute
|
28 | 31 | 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/ |
30 | 33 |
|
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