Skip to content

Commit

Permalink
Remove riscv toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
henrybear327 committed Dec 12, 2023
1 parent ec914f4 commit c090200
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
FROM sysprog21/rv32emu-gcc as base_gcc
FROM sysprog21/rv32emu-sail as base_sail

FROM ubuntu:22.04 as base_gcc

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
build-essential curl && \
rm -rf /var/lib/apt/lists/*

# copy in the source code
WORKDIR /home/root/rv32emu
COPY . .

# generate execution file for rv32emu and rv_histogram
RUN make
RUN make tool

FROM ubuntu:22.04 as final

# Install extra packages for the emulator to compile and execute with full capabilities correctly
# install extra packages for the emulator to compile and execute with full capabilities correctly
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
libsdl2-dev libsdl2-mixer-dev python3-pip git && \
Expand All @@ -19,16 +33,12 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
WORKDIR /home/root/rv32emu
COPY . .

# Copy the GNU Toolchain files
ENV RISCV=/opt/riscv
ENV PATH=$RISCV/bin:$PATH
COPY --from=base_gcc /opt/riscv/ /opt/riscv/

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

# generate execution file for rv32emu and rv_histogram
RUN make
RUN make tool
# get rv32emu and rv_histogram binaries
COPY --from=base_gcc /home/root/rv32emu/build/rv32emu /home/root/rv32emu/build/rv32emu
COPY --from=base_gcc /home/root/rv32emu/build/rv_histogram /home/root/rv32emu/build/rv_histogram

ENV PATH=/home/root/rv32emu/build:$PATH

0 comments on commit c090200

Please sign in to comment.