generated from riscv-software-src/template-riscv-code
-
Notifications
You must be signed in to change notification settings - Fork 74
Adding the End to End flow #278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Jatin-exe
wants to merge
1
commit into
riscv-software-src:master
Choose a base branch
from
Jatin-exe:jatin/full_flow
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,4 +41,8 @@ | |
*~ | ||
|
||
# Python cache file | ||
__pycache__/ | ||
__pycache__/ | ||
|
||
|
||
# output generated by the end to end flow | ||
outputs | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
FROM ubuntu:24.04 | ||
|
||
# Set environment variables early | ||
# Set environment variables early (separate lines) | ||
ENV RISCV=/riscv | ||
ENV QEMU_DIR=/qemu | ||
ENV QEMU_PLUGINS=/qemu/build/contrib/plugins | ||
ENV PATH=$RISCV/bin:/opt/riscv/riscv32-elf/bin:/opt/riscv/riscv64-elf/bin:/opt/riscv/riscv32-glibc/bin:/SimPoint/bin:/qemu/build:$PATH | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV WORKDIR=/workspace | ||
ENV WORKLOADS=/workloads | ||
ENV OUTPUT=/output | ||
ENV OUTPUT=/outputs | ||
ENV PATH=$RISCV/bin:/opt/riscv/riscv32-elf/bin:/opt/riscv/riscv64-elf/bin:/opt/riscv/riscv32-glibc/bin:/SimPoint/bin:/qemu/build:$PATH | ||
ENV STF_DIR=$RISCV/condor.riscv-isa-sim/stf_lib | ||
|
||
# Install dependencies and clean up in one layer | ||
RUN apt update && apt install -y \ | ||
RUN apt-get update && apt-get install -y \ | ||
autoconf \ | ||
automake \ | ||
autotools-dev \ | ||
|
@@ -54,15 +54,18 @@ RUN apt update && apt install -y \ | |
wget \ | ||
zlib1g-dev \ | ||
zstd \ | ||
python3-yaml | ||
python3-yaml \ | ||
python3-pyelftools \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& apt-get clean | ||
|
||
# Configure git for building | ||
RUN git config --global url."https://github.com/".insteadOf "git@github.com:" && \ | ||
git config --global user.email "builder@docker.com" && \ | ||
git config --global user.name "Docker Builder" | ||
|
||
# Create directory structure | ||
RUN mkdir -p /output | ||
RUN mkdir -p /workloads /outputs /workspace $RISCV | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line seems redundant since each folder already has its own WORKDIR command. As for the output directory, it is only used for host system binds, so there is also no need to create it in the dockerfile |
||
|
||
# Clone repositories in RISCV directory | ||
WORKDIR $RISCV | ||
|
@@ -83,11 +86,11 @@ RUN git clone https://github.com/riscv-software-src/riscv-tests.git && \ | |
|
||
# Copy and execute toolchain setup script | ||
COPY utils/get-tool.sh $RISCV/get-tool.sh | ||
RUN chmod +x $RISCV/get-tool.sh && \ | ||
$RISCV/get-tool.sh && \ | ||
echo "Toolchain version:" && \ | ||
riscv64-unknown-linux-gnu-gcc --version 2>/dev/null || echo "Toolchain setup pending" | ||
RUN chmod +x $RISCV/get-tool.sh | ||
RUN $RISCV/get-tool.sh || true | ||
RUN echo "Toolchain version:" && (riscv64-unknown-linux-gnu-gcc --version 2>/dev/null || echo "Toolchain setup pending") | ||
|
||
RUN mkdir -p /qemu/build | ||
# Build QEMU with plugins support | ||
WORKDIR /qemu/build | ||
RUN ../configure \ | ||
|
@@ -107,16 +110,15 @@ RUN make -j$(nproc) | |
WORKDIR $RISCV/stf_tools | ||
RUN git submodule update --init --recursive | ||
WORKDIR $RISCV/stf_tools/release | ||
RUN cmake .. -DCMAKE_BUILD_TYPE=Release && make -j$(nproc) | ||
RUN cmake .. -DCMAKE_BUILD_TYPE=Release | ||
RUN make -j$(nproc) | ||
|
||
# Build condor.riscv-isa-sim (Spike) | ||
# make the builddir ? | ||
WORKDIR $RISCV/condor.riscv-isa-sim/build | ||
RUN ../configure --prefix=$RISCV/condor.riscv-isa-sim/install | ||
RUN make -j$(nproc) | ||
RUN make regress | ||
RUN make install | ||
ENV STF_DIR=$RISCV/condor.riscv-isa-sim/stf_lib | ||
|
||
# Create mount points for runtime mounting | ||
# Environment and flow scripts will be mounted at runtime | ||
|
@@ -128,18 +130,17 @@ RUN mkdir -p /workloads/environment /flow /outputs | |
# - Host outputs -> /outputs | ||
|
||
RUN cp $RISCV/condor.riscv-isa-sim/install/bin/spike /usr/bin/ | ||
|
||
WORKDIR $RISCV/trace-gen | ||
RUN make | ||
RUN make | ||
RUN make install | ||
|
||
# Build riscv-pk (to provide pk for Spike if requested) | ||
WORKDIR $RISCV/riscv-pk | ||
RUN mkdir -p build | ||
WORKDIR $RISCV/riscv-pk/build | ||
RUN mkdir $RISCV/pk | ||
RUN ../configure --prefix=$RISCV/pk --host=riscv64-unknown-elf | ||
RUN ../configure --host=riscv64-unknown-elf | ||
RUN make -j$(nproc) | ||
RUN make install | ||
ENV PATH=$RISCV/pk:$PATH | ||
|
||
WORKDIR /workspace | ||
|
||
CMD ["/bin/bash"] | ||
|
||
# Volumes are mounted at runtime |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not sure if this change affects anything related to the Olympia setup. To be safer, I’d suggest ignoring only the outputs inside the
docker stf trace gen folder
instead of applying it more broadly.