From 0b09bc26d559794e4262f2910b41df2d52789bf0 Mon Sep 17 00:00:00 2001 From: Peter McGoron Date: Tue, 30 May 2023 17:34:00 -0400 Subject: [PATCH] litex f4pga upsilon vexriscv smp compiles --- .gitignore | 3 +++ Makefile | 9 +++---- .../Dockerfile.buildroot | 0 .../Dockerfile.litex_f4pga | 24 +++++++++++-------- .../Dockerfile.opensbi | 0 scripts/install_f4pga_defs.sh | 0 6 files changed, 22 insertions(+), 14 deletions(-) rename Dockerfile.buildroot => scripts/Dockerfile.buildroot (100%) rename Dockerfile.litex_f4pga => scripts/Dockerfile.litex_f4pga (62%) rename Dockerfile.opensbi => scripts/Dockerfile.opensbi (100%) mode change 100644 => 100755 scripts/install_f4pga_defs.sh diff --git a/.gitignore b/.gitignore index df99041..07a9e01 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ f4pga/ litex/ opensbi/ upsilon/ +.venv +upsilon.tar.gz +f4pga.tar.gz diff --git a/Makefile b/Makefile index 9f5234a..92be622 100644 --- a/Makefile +++ b/Makefile @@ -11,18 +11,19 @@ help: images: hardware-image buildroot-image -hardware-image: f4pga/scripts/prepare_environment.sh litex/litex_setup.py - docker build -f Dockerfile.litex_f4pga -t "upsilon-litex-f4pga-env" . +hardware-image: + docker build -f scripts/Dockerfile.litex_f4pga -t "upsilon-litex-f4pga-env" . buildroot-image: buildroot.tar.gz - docker build -f Dockerfile.buildroot -t "upsilon-buildroot-env" . + docker build -f scripts/Dockerfile.buildroot -t "upsilon-buildroot-env" . ###### Containers hardware-container: docker run -d --name upsilon-hardware-container upsilon-litex-f4pga-env /bin/sh -c 'while true; do sleep 2; done' hardware-container-copy: upsilon.tar.gz - docker cp upsilon.tar.gz upsilon-hardware-container:/home/user/upsilon.tar.gz + # XXX: this always fails if there are very high UIDs + -docker cp upsilon.tar.gz upsilon-hardware-container:/home/user/upsilon.tar.gz hardware-container-shell: docker exec -ti upsilon-hardware-container /bin/bash -l hardware-container-clean: diff --git a/Dockerfile.buildroot b/scripts/Dockerfile.buildroot similarity index 100% rename from Dockerfile.buildroot rename to scripts/Dockerfile.buildroot diff --git a/Dockerfile.litex_f4pga b/scripts/Dockerfile.litex_f4pga similarity index 62% rename from Dockerfile.litex_f4pga rename to scripts/Dockerfile.litex_f4pga index b9225c4..71b49a5 100644 --- a/Dockerfile.litex_f4pga +++ b/scripts/Dockerfile.litex_f4pga @@ -6,24 +6,28 @@ ENV F4PGA_INSTALL_DIR=/home/user/conda RUN apt-get update \ && apt-get -y upgrade \ && apt-get install -y git wget python3 xz-utils bash verilator \ - m4 device-tree-compiler make gcc-riscv64-unknown-elf \ + m4 device-tree-compiler make gcc-riscv64-unknown-elf vi \ && adduser --quiet --disabled-password user EXPOSE 22 USER user:user WORKDIR /home/user -COPY --chown=user:user f4pga.tar.gz /home/user -COPY --chown=user:user install_f4pga_defs.sh /home/user -RUN tar -xvf f4pga.tar.gz \ - && rm f4pga.tar.gz -RUN cd f4pga/scripts/ \ - && sed -i 's/sudo/#sudo/g' ./prepare_environment.sh \ - && ./prepare_environment.sh \ +# F4PGA +COPY --chown=user:user scripts/install_f4pga_defs.sh /home/user +RUN chmod +x install_f4pga_defs.sh \ + && ./install_f4pga_defs.sh \ && echo 'source ~/conda/xc7/conda/etc/profile.d/conda.sh' >> /home/user/.bashrc \ - && echo 'conda activate xc7' >> /home/user/.bashrc -RUN cd f4pga/f4pga && bash -c 'source ~/conda/xc7/conda/etc/profile.d/conda.sh; conda activate xc7; pip install . ninja meson' + && echo 'conda activate xc7' >> /home/user/.bashrc \ + && rm install_f4pga_defs.sh +COPY --chown=user:user f4pga.tar.gz /home/user +RUN tar -xvf f4pga.tar.gz \ + && rm f4pga.tar.gz \ + && cd f4pga/f4pga \ + && bash -c 'source ~/conda/xc7/conda/etc/profile.d/conda.sh; conda activate xc7; pip install . ninja meson' + +#LITEX COPY --chown=user:user litex/litex_setup.py /home/user RUN mkdir /home/user/litex \ && chmod +x litex_setup.py \ diff --git a/Dockerfile.opensbi b/scripts/Dockerfile.opensbi similarity index 100% rename from Dockerfile.opensbi rename to scripts/Dockerfile.opensbi diff --git a/scripts/install_f4pga_defs.sh b/scripts/install_f4pga_defs.sh old mode 100644 new mode 100755