From 2c23080e229dc5bc111fe30a5e33b0615103f844 Mon Sep 17 00:00:00 2001 From: Luka Macan Date: Thu, 26 Dec 2024 09:18:37 +0100 Subject: [PATCH] Add gvsoc to docker (#16) --- test/Dockerfile | 11 +++++++++++ test/docker/build_riscv_gnu_toolchain.sh | 2 +- test/docker/clone_and_build_gvsoc.sh | 9 +++++++++ test/docker/requirements-run-gvsoc.txt | 3 +++ 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100755 test/docker/clone_and_build_gvsoc.sh create mode 100644 test/docker/requirements-run-gvsoc.txt diff --git a/test/Dockerfile b/test/Dockerfile index 0439bee..c4299a4 100644 --- a/test/Dockerfile +++ b/test/Dockerfile @@ -52,6 +52,10 @@ ENV PULP_RISCV_GCC_TOOLCHAIN=${TOOLCHAIN_GNU_INSTALL_DIR} COPY docker/get_pulp_sdk.sh ./ RUN ./get_pulp_sdk.sh +# Build gvsoc +COPY docker/clone_and_build_gvsoc.sh ./ +RUN ./clone_and_build_gvsoc.sh + # Minimal image FROM ubuntu:22.04 @@ -88,3 +92,10 @@ ENV PULP_RISCV_GCC_TOOLCHAIN=${TOOLCHAIN_GNU_INSTALL_DIR} COPY --from=builder ${TOOLCHAIN_GNU_INSTALL_DIR} ${TOOLCHAIN_GNU_INSTALL_DIR} COPY --from=builder /pulp-sdk /pulp-sdk +COPY --from=builder /gvsoc/install /gvsoc + +ENV TOOLCHAIN_GNU_INSTALL_DIR=${TOOLCHAIN_GNU_INSTALL_DIR} +ENV GVSOC="/gvsoc/bin/gvsoc" + +COPY docker/requirements-run-gvsoc.txt ./ +RUN pip3 install --no-cache-dir -r requirements-run-gvsoc.txt diff --git a/test/docker/build_riscv_gnu_toolchain.sh b/test/docker/build_riscv_gnu_toolchain.sh index c317b47..d65a702 100755 --- a/test/docker/build_riscv_gnu_toolchain.sh +++ b/test/docker/build_riscv_gnu_toolchain.sh @@ -6,4 +6,4 @@ set -euo pipefail mkdir -p $TOOLCHAIN_GNU_INSTALL_DIR cd riscv-gnu-toolchain ./configure --prefix=$TOOLCHAIN_GNU_INSTALL_DIR --with-arch=rv32imfcxpulpv3 --with-abi=ilp32 --enable-multilib -make +make -j 8 diff --git a/test/docker/clone_and_build_gvsoc.sh b/test/docker/clone_and_build_gvsoc.sh new file mode 100755 index 0000000..5fa2274 --- /dev/null +++ b/test/docker/clone_and_build_gvsoc.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -euo pipefail + +git clone https://github.com/lukamac/gvsoc.git \ + --depth=1 --branch=fix-vectorload --recurse-submodules --shallow-submodules +cd gvsoc +pip3 install --no-cache-dir -r requirements.txt -r gapy/requirements.txt -r core/requirements.txt +make all TARGETS=siracusa diff --git a/test/docker/requirements-run-gvsoc.txt b/test/docker/requirements-run-gvsoc.txt new file mode 100644 index 0000000..2b59774 --- /dev/null +++ b/test/docker/requirements-run-gvsoc.txt @@ -0,0 +1,3 @@ +prettytable +rich +pexpect