Skip to content

Commit

Permalink
Remove riscv toolchain
Browse files Browse the repository at this point in the history
The dockerfile only contains the rv32emu executable, instead of a 
full-fledged container for development.
  • Loading branch information
henrybear327 committed Jan 1, 2024
1 parent 5549d79 commit 6f02c90
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
FROM sysprog21/rv32emu-gcc as base_gcc
FROM sysprog21/rv32emu-sail as base_sail

FROM ubuntu:22.04 as final
FROM ubuntu:22.04 as base_gcc

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

RUN python3 -m pip install git+https://github.com/riscv/riscof
# 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

# set up the timezone
ENV TZ=Asia/Taipei
Expand All @@ -19,16 +26,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 6f02c90

Please sign in to comment.