From d8716d07f516a336ca1325cc89d0ea5fc1aaa5b8 Mon Sep 17 00:00:00 2001 From: "A.M. Smith" Date: Sat, 16 Mar 2024 04:07:11 -0700 Subject: [PATCH 1/2] feat: add icestorm fpga dev container --- .cspell.project-words.txt | 15 ++++++++++ .github/workflows/build-and-push-docker.yml | 2 +- docker/arrow-icestorm/.env | 1 + docker/arrow-icestorm/Dockerfile | 31 +++++++++++++++++++++ 4 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 docker/arrow-icestorm/.env create mode 100644 docker/arrow-icestorm/Dockerfile diff --git a/.cspell.project-words.txt b/.cspell.project-words.txt index 1677f67..8a5c515 100644 --- a/.cspell.project-words.txt +++ b/.cspell.project-words.txt @@ -50,3 +50,18 @@ postgis pgrouting xvzf sfcgal +noninteractive +gperf +readline +eigen +graphviz +qtbase +VHDL +yosys +ghdl +icestorm +nextpnr +nproc +DARCH +DCMAKE +libftdi diff --git a/.github/workflows/build-and-push-docker.yml b/.github/workflows/build-and-push-docker.yml index 34ceab5..956ba56 100644 --- a/.github/workflows/build-and-push-docker.yml +++ b/.github/workflows/build-and-push-docker.yml @@ -24,7 +24,7 @@ jobs: packages: write strategy: matrix: - image: ["arrow-rust", "arrow-sanitychecks", "arrow-stm32", "arrow-tfenv", "arrow-gis"] + image: ["arrow-rust", "arrow-sanitychecks", "arrow-stm32", "arrow-tfenv", "arrow-gis", "arrow-icestorm"] steps: - name: Checkout repository diff --git a/docker/arrow-icestorm/.env b/docker/arrow-icestorm/.env new file mode 100644 index 0000000..e581d22 --- /dev/null +++ b/docker/arrow-icestorm/.env @@ -0,0 +1 @@ +VERSION=v1.0.0 diff --git a/docker/arrow-icestorm/Dockerfile b/docker/arrow-icestorm/Dockerfile new file mode 100644 index 0000000..361618e --- /dev/null +++ b/docker/arrow-icestorm/Dockerfile @@ -0,0 +1,31 @@ +FROM alpine:3.18 + +ARG DEBIAN_FRONTEND=noninteractive +ENV TZ=UTC + +RUN apk update +RUN apk add --no-cache --update bash curl git g++ musl-dev make \ + libftdi1-dev clang bison flex-dev gperf readline-dev \ + gawk tcl-dev libffi-dev eigen-dev \ + graphviz python3 libftdi1-dev gcc-gnat \ + qt5-qtbase python3-dev boost-dev cmake + +# To use VHDL with yosys, require ghdl plugin +RUN git clone https://github.com/ghdl/ghdl.git ghdl +RUN git clone https://github.com/ghdl/ghdl-yosys-plugin ghdl-yosys-plugin + +# To use yosys with ice40, require icestorm and nextpnr with ice40 architecture +RUN git clone https://github.com/YosysHQ/yosys.git yosys +RUN git clone https://github.com/YosysHQ/icestorm.git icestorm +RUN git clone https://github.com/YosysHQ/nextpnr nextpnr + +# Install all +RUN cd yosys; make -j$(nproc); make install +RUN cd ghdl; ./configure --prefix=/usr/local; make -j$(nproc); make install +RUN cd ghdl-yosys-plugin; make -j$(nproc); make install +RUN cd icestorm; make -j$(nproc); make install +RUN cd nextpnr; \ + git submodule init && git submodule update; \ + cmake . -DARCH=ice40 -DUSE_IPO=off -DCMAKE_INSTALL_PREFIX=/usr/local; \ + make -j$(nproc); \ + make install From fb4506f1ed174dce21c829f22d4b0b59d24b6ad4 Mon Sep 17 00:00:00 2001 From: "Alex M. Smith" Date: Mon, 18 Mar 2024 11:02:24 +0100 Subject: [PATCH 2/2] feat: add llvm for non x86 builds --- docker/arrow-icestorm/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/arrow-icestorm/Dockerfile b/docker/arrow-icestorm/Dockerfile index 361618e..b1027e1 100644 --- a/docker/arrow-icestorm/Dockerfile +++ b/docker/arrow-icestorm/Dockerfile @@ -7,7 +7,7 @@ RUN apk update RUN apk add --no-cache --update bash curl git g++ musl-dev make \ libftdi1-dev clang bison flex-dev gperf readline-dev \ gawk tcl-dev libffi-dev eigen-dev \ - graphviz python3 libftdi1-dev gcc-gnat \ + graphviz python3 libftdi1-dev gcc-gnat llvm16-dev \ qt5-qtbase python3-dev boost-dev cmake # To use VHDL with yosys, require ghdl plugin @@ -21,7 +21,7 @@ RUN git clone https://github.com/YosysHQ/nextpnr nextpnr # Install all RUN cd yosys; make -j$(nproc); make install -RUN cd ghdl; ./configure --prefix=/usr/local; make -j$(nproc); make install +RUN cd ghdl; ./configure --with-llvm-config --prefix=/usr/local; make -j$(nproc); make install RUN cd ghdl-yosys-plugin; make -j$(nproc); make install RUN cd icestorm; make -j$(nproc); make install RUN cd nextpnr; \