From 294af3a5226381c9fdda9c02ada698138861df8a Mon Sep 17 00:00:00 2001 From: Thirsty2 Date: Thu, 3 Dec 2020 06:59:38 -0800 Subject: [PATCH 01/19] Add Dockerfile.qorc to build and test full quicklogic toolchain. --- Dockerfile.qorc | 97 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 Dockerfile.qorc diff --git a/Dockerfile.qorc b/Dockerfile.qorc new file mode 100644 index 0000000..0df5995 --- /dev/null +++ b/Dockerfile.qorc @@ -0,0 +1,97 @@ +FROM ubuntu:20.04 as base + +ARG DEBIAN_FRONTEND=noninteractive +ENV TZ=America/Los_Angeles + +RUN apt-get update && apt-get install -y \ + libcanberra-gtk-module \ + make \ + curl \ + git \ + wget \ + xz-utils && \ + rm -rf /var/lib/apt/lists/* + +# make /bin/sh symlink to bash instead of dash: +RUN echo "dash dash/sh boolean false" | debconf-set-selections +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash + +# add ARGs so that these can be passed in while doing a docker build, the following will be default values +ARG TAG=v0.0.0 +ENV INSTALL_DIR="/opt/symbiflow/eos-s3" +# Appending all of these commands (mostly the chmod 755 commands) saved about 1.9 GB in image size +RUN wget https://github.com/QuickLogic-Corp/quicklogic-fpga-toolchain/releases/download/${TAG}/Symbiflow_${TAG}.gz.run && \ + chmod 755 Symbiflow_${TAG}.gz.run && \ + ./Symbiflow_${TAG}.gz.run && \ + rm Symbiflow_${TAG}.gz.run && \ + chmod 755 /opt/symbiflow && \ + chmod 755 /opt/symbiflow/eos-s3 && \ + chmod -R 755 /opt/symbiflow/eos-s3/conda && \ + chmod -R 755 /opt/symbiflow/eos-s3/quicklogic-arch-defs + +ENV PATH="${INSTALL_DIR}/quicklogic-arch-defs/bin:${INSTALL_DIR}/quicklogic-arch-defs/bin/python:$PATH" + +FROM base as symbiflow-ql + +FROM symbiflow-ql as qorc-base + +WORKDIR /opt + +RUN wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 && \ + tar -xjvf gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 && \ + rm gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 + +ENV PATH=/opt/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux:$PATH + + +FROM qorc-base as qorc-test-base + +WORKDIR / +RUN git clone --recursive https://github.com/QuickLogic-Corp/qorc-sdk.git + +FROM qorc-test-base as qorc-test-qf_apps + +WORKDIR /qorc-sdk/qf_apps +RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ + conda activate && \ + make + +FROM qorc-test-base as qorc-test-qf_vr_apps + +WORKDIR /qorc-sdk/qf_vr_apps +RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ + conda activate && \ + make + +#FROM qorc-test-base as qorc-test-qorc_testapps + +#WORKDIR /qorc-sdk/qorc-testapps +#RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ +#conda activate && \ +#make +FROM qorc-base as qorc-user + +RUN apt-get update && apt-get install -y \ + libusb-1.0-0 \ + python3-pip \ + usbutils \ + udev && \ + rm -rf /var/lib/apt/lists/* + +ARG USER=ic +ARG UID=1000 +ARG GID=1000 +RUN addgroup --gid ${GID} ${USER} +RUN adduser --uid ${UID} --gid ${GID} --gecos "" --disabled-password --shell /bin/bash ${USER} +RUN usermod -a -G plugdev ${USER} && usermod -a -G dialout ${USER} +COPY 98-quickfeather.rules /etc/udev/rules.d/98-quickfeather.rules +USER ${USER} +WORKDIR /home/${USER} + +SHELL [ "/bin/bash" ] +COPY conda-user.sh /scripts/conda-user.sh + +ENTRYPOINT [ "/scripts/conda-user.sh" ] + +FROM qorc-base as qorc + From 7713e29056332d8100d77d5c1bd04ed48f88368f Mon Sep 17 00:00:00 2001 From: Thirsty2 Date: Thu, 3 Dec 2020 20:02:44 -0800 Subject: [PATCH 02/19] Add missing files used by Dockerfile.qorc. --- 98-quickfeather.rules | 1 + conda-user.sh | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 98-quickfeather.rules create mode 100755 conda-user.sh diff --git a/98-quickfeather.rules b/98-quickfeather.rules new file mode 100644 index 0000000..426ed82 --- /dev/null +++ b/98-quickfeather.rules @@ -0,0 +1 @@ +SUBSYSTEM=="usb", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="6140", MODE="0664", GROUP="plugdev" diff --git a/conda-user.sh b/conda-user.sh new file mode 100755 index 0000000..32ee3c9 --- /dev/null +++ b/conda-user.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -e + +source ${INSTALL_DIR}/conda/etc/profile.d/conda.sh +conda activate + +exec "$@" + +conda deactivate + From bb561bd690a0719daed67f088c434ce54c76053c Mon Sep 17 00:00:00 2001 From: Thirsty2 Date: Sat, 5 Dec 2020 20:45:02 -0800 Subject: [PATCH 03/19] Added comments to document how to build and use the targets of this dockerfile. --- Dockerfile.qorc | 59 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/Dockerfile.qorc b/Dockerfile.qorc index 0df5995..6312434 100644 --- a/Dockerfile.qorc +++ b/Dockerfile.qorc @@ -43,25 +43,28 @@ RUN wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-a ENV PATH=/opt/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux:$PATH +# The following tests were commented out because they create intermediate +# images that eat a large percentage of the small remaning space on my chromebook. +# Uncomment them if you have the disk space needed to run the tests. -FROM qorc-base as qorc-test-base +#FROM qorc-base as qorc-test-base -WORKDIR / -RUN git clone --recursive https://github.com/QuickLogic-Corp/qorc-sdk.git +#WORKDIR / +#RUN git clone --recursive https://github.com/QuickLogic-Corp/qorc-sdk.git -FROM qorc-test-base as qorc-test-qf_apps +#FROM qorc-test-base as qorc-test-qf_apps -WORKDIR /qorc-sdk/qf_apps -RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ - conda activate && \ - make +#WORKDIR /qorc-sdk/qf_apps +#RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ +# conda activate && \ +# make -FROM qorc-test-base as qorc-test-qf_vr_apps +#FROM qorc-test-base as qorc-test-qf_vr_apps -WORKDIR /qorc-sdk/qf_vr_apps -RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ - conda activate && \ - make +#WORKDIR /qorc-sdk/qf_vr_apps +#RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ +# conda activate && \ +# make #FROM qorc-test-base as qorc-test-qorc_testapps @@ -69,6 +72,23 @@ RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ #RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ #conda activate && \ #make + +# The qorc-user target adds a user and entrypoint to the default target. +# Build the qorc-user target with a command like this: +# docker build --build-arg TAG=v1.3.0 -f Dockerfile.qorc --target qorc-user . -t qorc-user +# +# Run it in the qorc-sdk directory or any project directory with a command like this: +# docker run -it --rm -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix" -v $(pwd):/home/ic qorc-user bash +# +# Note that the conda-user.sh file used as an entrypoint sources the conda.sh file and activates conda +# so there is no need to do those things when using this qorc-user target. Simply run make inside qorc-sdk. +# +# The qorc-user target is the most convenient to use of the targets in this file, but it is not the default +# because a default target with no entrypoint or user is more convinent for re-use. For instance, to reuse +# the default qorc image, you could create a new Dockerfile containing only the contents of the following +# qorc-user section, and replacing the top line with: +# FROM qorc +# assuming the qorc:latest image exists on your system, or as a Docker hub image. FROM qorc-base as qorc-user RUN apt-get update && apt-get install -y \ @@ -93,5 +113,18 @@ COPY conda-user.sh /scripts/conda-user.sh ENTRYPOINT [ "/scripts/conda-user.sh" ] +# qorc is the default target. There is no user and no entrypoint specified, which makes +# it useful as a base image. + +# Build the default qorc target with a command like this: +# docker build --build-arg TAG=v1.3.0 -f Dockerfile.qorc . -t qorc +# +# Run it in the qorc-sdk directory or another project directory with a command like this: +# docker run -it --rm -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix" -v $(pwd):/root qorc bash +# +# Note that when using the default qorc target, there is no entrypoint script so you need to source +# the conda.sh file, and activate conda before running make in qorc-sdk. +# See the tests above for examples of how this may be done. +# FROM qorc-base as qorc From 690afa3d64c62ac2946a71c642bfefb9514107e4 Mon Sep 17 00:00:00 2001 From: Thirsty2 Date: Thu, 10 Dec 2020 22:00:51 -0800 Subject: [PATCH 04/19] Add github action workflow to create qorc package. --- .../workflows/docker-publish-tagged-qorc.yml | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/docker-publish-tagged-qorc.yml diff --git a/.github/workflows/docker-publish-tagged-qorc.yml b/.github/workflows/docker-publish-tagged-qorc.yml new file mode 100644 index 0000000..54e486a --- /dev/null +++ b/.github/workflows/docker-publish-tagged-qorc.yml @@ -0,0 +1,49 @@ +name: Docker + +on: + push: + tags: [ v* ] + workflow_dispatch: + +env: + IMAGE_NAME: qorc + +jobs: + push: + runs-on: ubuntu-latest + if: github.event_name == 'push' + + steps: + - uses: actions/checkout@v2 + + - name: Build image + run: | + # Strip git ref prefix from version + VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') + + docker build --build-arg TAG=$VERSION . --file Dockerfile.qorc --tag $IMAGE_NAME + + - name: Log into registry + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin + + - name: Push image + run: | + IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME + + # Change all uppercase to lowercase + IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') + + # Strip git ref prefix from version + VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') + + # Strip "v" prefix from tag name + [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') + + # Use Docker `latest` tag convention + [ "$VERSION" == "master" ] && VERSION=latest + + echo IMAGE_ID=$IMAGE_ID + echo VERSION=$VERSION + + docker tag $IMAGE_NAME $IMAGE_ID:$VERSION + docker push $IMAGE_ID:$VERSION \ No newline at end of file From 1dec99ca9f762cb3d5875144a1afc43c99c1dc20 Mon Sep 17 00:00:00 2001 From: Thirsty2 Date: Thu, 10 Dec 2020 23:48:24 -0800 Subject: [PATCH 05/19] Add github action workflow to create qorc-user package. --- .../docker-publish-tagged-qorc-user.yml | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/docker-publish-tagged-qorc-user.yml diff --git a/.github/workflows/docker-publish-tagged-qorc-user.yml b/.github/workflows/docker-publish-tagged-qorc-user.yml new file mode 100644 index 0000000..409d3d6 --- /dev/null +++ b/.github/workflows/docker-publish-tagged-qorc-user.yml @@ -0,0 +1,49 @@ +name: Docker + +on: + push: + tags: [ v* ] + workflow_dispatch: + +env: + IMAGE_NAME: qorc-user + +jobs: + push: + runs-on: ubuntu-latest + if: github.event_name == 'push' + + steps: + - uses: actions/checkout@v2 + + - name: Build image + run: | + # Strip git ref prefix from version + VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') + + docker build --build-arg TAG=$VERSION --target qorc-user . --file Dockerfile.qorc --tag $IMAGE_NAME + + - name: Log into registry + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin + + - name: Push image + run: | + IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME + + # Change all uppercase to lowercase + IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') + + # Strip git ref prefix from version + VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') + + # Strip "v" prefix from tag name + [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') + + # Use Docker `latest` tag convention + [ "$VERSION" == "master" ] && VERSION=latest + + echo IMAGE_ID=$IMAGE_ID + echo VERSION=$VERSION + + docker tag $IMAGE_NAME $IMAGE_ID:$VERSION + docker push $IMAGE_ID:$VERSION \ No newline at end of file From 73c26550c5acc4255d245b5d6daa33ebff4256f1 Mon Sep 17 00:00:00 2001 From: Thirsty2 Date: Tue, 15 Dec 2020 23:22:02 -0800 Subject: [PATCH 06/19] The default qorc target now has an entrypoint and a user. --- Dockerfile.qorc | 63 ++++++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/Dockerfile.qorc b/Dockerfile.qorc index 6312434..52c8527 100644 --- a/Dockerfile.qorc +++ b/Dockerfile.qorc @@ -33,6 +33,18 @@ ENV PATH="${INSTALL_DIR}/quicklogic-arch-defs/bin:${INSTALL_DIR}/quicklogic-arch FROM base as symbiflow-ql +# The qorc-base target has no user and no entrypoint specified, which makes +# it useful as a base image. + +# Build the qorc-base target with a command like this: +# docker build --build-arg TAG=v1.3.0 -f Dockerfile.qorc --target qorc-base . -t qorc-base +# +# Run it in the qorc-sdk directory or another project directory with a command like this: +# docker run -it --rm -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix" -v $(pwd):/root qorc-base bash +# +# Note that when using the qorc-base target, there is no entrypoint script so you need to source +# the conda.sh file, and activate conda before running make in qorc-sdk. +# FROM symbiflow-ql as qorc-base WORKDIR /opt @@ -47,25 +59,26 @@ ENV PATH=/opt/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux:$PATH # images that eat a large percentage of the small remaning space on my chromebook. # Uncomment them if you have the disk space needed to run the tests. -#FROM qorc-base as qorc-test-base +FROM qorc-base as qorc-test-base -#WORKDIR / -#RUN git clone --recursive https://github.com/QuickLogic-Corp/qorc-sdk.git +WORKDIR / +RUN git clone --recursive https://github.com/QuickLogic-Corp/qorc-sdk.git -#FROM qorc-test-base as qorc-test-qf_apps +FROM qorc-test-base as qorc-test-qf_apps -#WORKDIR /qorc-sdk/qf_apps -#RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ -# conda activate && \ -# make +WORKDIR /qorc-sdk/qf_apps +RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ + conda activate && \ + make -#FROM qorc-test-base as qorc-test-qf_vr_apps +FROM qorc-test-base as qorc-test-qf_vr_apps -#WORKDIR /qorc-sdk/qf_vr_apps -#RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ -# conda activate && \ -# make +WORKDIR /qorc-sdk/qf_vr_apps +RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ + conda activate && \ + make +# The following qorc_testapps wouldn't build #FROM qorc-test-base as qorc-test-qorc_testapps #WORKDIR /qorc-sdk/qorc-testapps @@ -83,12 +96,6 @@ ENV PATH=/opt/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux:$PATH # Note that the conda-user.sh file used as an entrypoint sources the conda.sh file and activates conda # so there is no need to do those things when using this qorc-user target. Simply run make inside qorc-sdk. # -# The qorc-user target is the most convenient to use of the targets in this file, but it is not the default -# because a default target with no entrypoint or user is more convinent for re-use. For instance, to reuse -# the default qorc image, you could create a new Dockerfile containing only the contents of the following -# qorc-user section, and replacing the top line with: -# FROM qorc -# assuming the qorc:latest image exists on your system, or as a Docker hub image. FROM qorc-base as qorc-user RUN apt-get update && apt-get install -y \ @@ -103,8 +110,7 @@ ARG UID=1000 ARG GID=1000 RUN addgroup --gid ${GID} ${USER} RUN adduser --uid ${UID} --gid ${GID} --gecos "" --disabled-password --shell /bin/bash ${USER} -RUN usermod -a -G plugdev ${USER} && usermod -a -G dialout ${USER} -COPY 98-quickfeather.rules /etc/udev/rules.d/98-quickfeather.rules + USER ${USER} WORKDIR /home/${USER} @@ -113,18 +119,17 @@ COPY conda-user.sh /scripts/conda-user.sh ENTRYPOINT [ "/scripts/conda-user.sh" ] -# qorc is the default target. There is no user and no entrypoint specified, which makes -# it useful as a base image. + +FROM qorc-user as qorc +# If the above test builds complete, the qorc-user becomes the default target, qorc. # Build the default qorc target with a command like this: # docker build --build-arg TAG=v1.3.0 -f Dockerfile.qorc . -t qorc # -# Run it in the qorc-sdk directory or another project directory with a command like this: -# docker run -it --rm -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix" -v $(pwd):/root qorc bash +# Run it in the qorc-sdk directory or any project directory with a command like this: +# docker run -it --rm -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix" -v $(pwd):/home/ic qorc bash # -# Note that when using the default qorc target, there is no entrypoint script so you need to source -# the conda.sh file, and activate conda before running make in qorc-sdk. -# See the tests above for examples of how this may be done. +# Note that the conda-user.sh file used as an entrypoint sources the conda.sh file and activates conda +# so there is no need to do those things when using this qorc target. Simply run make inside qorc-sdk. # -FROM qorc-base as qorc From b33863801cb81722995cc8c536618a4e36ff5e2f Mon Sep 17 00:00:00 2001 From: Thirsty2 Date: Wed, 16 Dec 2020 22:41:55 -0800 Subject: [PATCH 07/19] Integrated Dockerfile.qorc into Dockerfile.use-installer with qorc as the default target. --- ...ml => docker-publish-tagged-qorc-base.yml} | 4 +- .../workflows/docker-publish-tagged-qorc.yml | 2 +- .github/workflows/docker-publish-tagged.yml | 2 +- 98-quickfeather.rules | 1 - Dockerfile.qorc | 135 ------------------ Dockerfile.use-installer | 106 +++++++++++++- 6 files changed, 107 insertions(+), 143 deletions(-) rename .github/workflows/{docker-publish-tagged-qorc-user.yml => docker-publish-tagged-qorc-base.yml} (89%) delete mode 100644 98-quickfeather.rules delete mode 100644 Dockerfile.qorc diff --git a/.github/workflows/docker-publish-tagged-qorc-user.yml b/.github/workflows/docker-publish-tagged-qorc-base.yml similarity index 89% rename from .github/workflows/docker-publish-tagged-qorc-user.yml rename to .github/workflows/docker-publish-tagged-qorc-base.yml index 409d3d6..5ad54d5 100644 --- a/.github/workflows/docker-publish-tagged-qorc-user.yml +++ b/.github/workflows/docker-publish-tagged-qorc-base.yml @@ -6,7 +6,7 @@ on: workflow_dispatch: env: - IMAGE_NAME: qorc-user + IMAGE_NAME: qorc-base jobs: push: @@ -21,7 +21,7 @@ jobs: # Strip git ref prefix from version VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - docker build --build-arg TAG=$VERSION --target qorc-user . --file Dockerfile.qorc --tag $IMAGE_NAME + docker build --build-arg TAG=$VERSION --target qorc-base . --file Dockerfile.use-installer --tag $IMAGE_NAME - name: Log into registry run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin diff --git a/.github/workflows/docker-publish-tagged-qorc.yml b/.github/workflows/docker-publish-tagged-qorc.yml index 54e486a..2275867 100644 --- a/.github/workflows/docker-publish-tagged-qorc.yml +++ b/.github/workflows/docker-publish-tagged-qorc.yml @@ -21,7 +21,7 @@ jobs: # Strip git ref prefix from version VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - docker build --build-arg TAG=$VERSION . --file Dockerfile.qorc --tag $IMAGE_NAME + docker build --build-arg TAG=$VERSION . --file Dockerfile.use-installer --tag $IMAGE_NAME - name: Log into registry run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin diff --git a/.github/workflows/docker-publish-tagged.yml b/.github/workflows/docker-publish-tagged.yml index 1f9cc05..12bc367 100644 --- a/.github/workflows/docker-publish-tagged.yml +++ b/.github/workflows/docker-publish-tagged.yml @@ -21,7 +21,7 @@ jobs: # Strip git ref prefix from version VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - docker build --build-arg TAG=$VERSION . --file Dockerfile.use-installer --tag $IMAGE_NAME + docker build --build-arg TAG=$VERSION --target symbiflow-ql . --file Dockerfile.use-installer --tag $IMAGE_NAME - name: Log into registry run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin diff --git a/98-quickfeather.rules b/98-quickfeather.rules deleted file mode 100644 index 426ed82..0000000 --- a/98-quickfeather.rules +++ /dev/null @@ -1 +0,0 @@ -SUBSYSTEM=="usb", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="6140", MODE="0664", GROUP="plugdev" diff --git a/Dockerfile.qorc b/Dockerfile.qorc deleted file mode 100644 index 52c8527..0000000 --- a/Dockerfile.qorc +++ /dev/null @@ -1,135 +0,0 @@ -FROM ubuntu:20.04 as base - -ARG DEBIAN_FRONTEND=noninteractive -ENV TZ=America/Los_Angeles - -RUN apt-get update && apt-get install -y \ - libcanberra-gtk-module \ - make \ - curl \ - git \ - wget \ - xz-utils && \ - rm -rf /var/lib/apt/lists/* - -# make /bin/sh symlink to bash instead of dash: -RUN echo "dash dash/sh boolean false" | debconf-set-selections -RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash - -# add ARGs so that these can be passed in while doing a docker build, the following will be default values -ARG TAG=v0.0.0 -ENV INSTALL_DIR="/opt/symbiflow/eos-s3" -# Appending all of these commands (mostly the chmod 755 commands) saved about 1.9 GB in image size -RUN wget https://github.com/QuickLogic-Corp/quicklogic-fpga-toolchain/releases/download/${TAG}/Symbiflow_${TAG}.gz.run && \ - chmod 755 Symbiflow_${TAG}.gz.run && \ - ./Symbiflow_${TAG}.gz.run && \ - rm Symbiflow_${TAG}.gz.run && \ - chmod 755 /opt/symbiflow && \ - chmod 755 /opt/symbiflow/eos-s3 && \ - chmod -R 755 /opt/symbiflow/eos-s3/conda && \ - chmod -R 755 /opt/symbiflow/eos-s3/quicklogic-arch-defs - -ENV PATH="${INSTALL_DIR}/quicklogic-arch-defs/bin:${INSTALL_DIR}/quicklogic-arch-defs/bin/python:$PATH" - -FROM base as symbiflow-ql - -# The qorc-base target has no user and no entrypoint specified, which makes -# it useful as a base image. - -# Build the qorc-base target with a command like this: -# docker build --build-arg TAG=v1.3.0 -f Dockerfile.qorc --target qorc-base . -t qorc-base -# -# Run it in the qorc-sdk directory or another project directory with a command like this: -# docker run -it --rm -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix" -v $(pwd):/root qorc-base bash -# -# Note that when using the qorc-base target, there is no entrypoint script so you need to source -# the conda.sh file, and activate conda before running make in qorc-sdk. -# -FROM symbiflow-ql as qorc-base - -WORKDIR /opt - -RUN wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 && \ - tar -xjvf gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 && \ - rm gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 - -ENV PATH=/opt/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux:$PATH - -# The following tests were commented out because they create intermediate -# images that eat a large percentage of the small remaning space on my chromebook. -# Uncomment them if you have the disk space needed to run the tests. - -FROM qorc-base as qorc-test-base - -WORKDIR / -RUN git clone --recursive https://github.com/QuickLogic-Corp/qorc-sdk.git - -FROM qorc-test-base as qorc-test-qf_apps - -WORKDIR /qorc-sdk/qf_apps -RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ - conda activate && \ - make - -FROM qorc-test-base as qorc-test-qf_vr_apps - -WORKDIR /qorc-sdk/qf_vr_apps -RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ - conda activate && \ - make - -# The following qorc_testapps wouldn't build -#FROM qorc-test-base as qorc-test-qorc_testapps - -#WORKDIR /qorc-sdk/qorc-testapps -#RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ -#conda activate && \ -#make - -# The qorc-user target adds a user and entrypoint to the default target. -# Build the qorc-user target with a command like this: -# docker build --build-arg TAG=v1.3.0 -f Dockerfile.qorc --target qorc-user . -t qorc-user -# -# Run it in the qorc-sdk directory or any project directory with a command like this: -# docker run -it --rm -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix" -v $(pwd):/home/ic qorc-user bash -# -# Note that the conda-user.sh file used as an entrypoint sources the conda.sh file and activates conda -# so there is no need to do those things when using this qorc-user target. Simply run make inside qorc-sdk. -# -FROM qorc-base as qorc-user - -RUN apt-get update && apt-get install -y \ - libusb-1.0-0 \ - python3-pip \ - usbutils \ - udev && \ - rm -rf /var/lib/apt/lists/* - -ARG USER=ic -ARG UID=1000 -ARG GID=1000 -RUN addgroup --gid ${GID} ${USER} -RUN adduser --uid ${UID} --gid ${GID} --gecos "" --disabled-password --shell /bin/bash ${USER} - -USER ${USER} -WORKDIR /home/${USER} - -SHELL [ "/bin/bash" ] -COPY conda-user.sh /scripts/conda-user.sh - -ENTRYPOINT [ "/scripts/conda-user.sh" ] - - - -FROM qorc-user as qorc -# If the above test builds complete, the qorc-user becomes the default target, qorc. -# Build the default qorc target with a command like this: -# docker build --build-arg TAG=v1.3.0 -f Dockerfile.qorc . -t qorc -# -# Run it in the qorc-sdk directory or any project directory with a command like this: -# docker run -it --rm -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix" -v $(pwd):/home/ic qorc bash -# -# Note that the conda-user.sh file used as an entrypoint sources the conda.sh file and activates conda -# so there is no need to do those things when using this qorc target. Simply run make inside qorc-sdk. -# - diff --git a/Dockerfile.use-installer b/Dockerfile.use-installer index 83598f3..45f3cb3 100644 --- a/Dockerfile.use-installer +++ b/Dockerfile.use-installer @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 as builder +FROM ubuntu:20.04 as base ARG DEBIAN_FRONTEND=noninteractive ENV TZ=America/Los_Angeles @@ -17,7 +17,7 @@ RUN echo "dash dash/sh boolean false" | debconf-set-selections RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash # add ARGs so that these can be passed in while doing a docker build, the following will be default values -ARG TAG=v1.3.0 +ARG TAG=v0.0.0 ENV INSTALL_DIR="/opt/symbiflow/eos-s3" # Appending all of these commands (mostly the chmod 755 commands) saved about 1.9 GB in image size RUN wget https://github.com/QuickLogic-Corp/quicklogic-fpga-toolchain/releases/download/${TAG}/Symbiflow_${TAG}.gz.run && \ @@ -26,7 +26,107 @@ RUN wget https://github.com/QuickLogic-Corp/quicklogic-fpga-toolchain/releases/d rm Symbiflow_${TAG}.gz.run && \ chmod 755 /opt/symbiflow && \ chmod 755 /opt/symbiflow/eos-s3 && \ - chmod -R 755 /opt/symbiflow/eos-s3/conda + chmod -R 755 /opt/symbiflow/eos-s3/conda && \ + chmod -R 755 /opt/symbiflow/eos-s3/quicklogic-arch-defs ENV PATH="${INSTALL_DIR}/quicklogic-arch-defs/bin:${INSTALL_DIR}/quicklogic-arch-defs/bin/python:$PATH" +FROM base as symbiflow-ql + +# The qorc-base target has no user and no entrypoint specified, which makes +# it useful as a base image. + +# Build the qorc-base target with a command like this: +# docker build --build-arg TAG=v1.3.0 -f Dockerfile.qorc --target qorc-base . -t qorc-base +# +# Run it in the qorc-sdk directory or another project directory with a command like this: +# docker run -it --rm -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix" -v $(pwd):/root qorc-base bash +# +# Note that when using the qorc-base target, there is no entrypoint script so you need to source +# the conda.sh file, and activate conda before running make in qorc-sdk. +# +FROM symbiflow-ql as qorc-base + +WORKDIR /opt + +RUN wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 && \ + tar -xjvf gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 && \ + rm gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 + +ENV PATH=/opt/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux:$PATH + +# The following tests are run automatically during a build of the default qorc image +FROM qorc-base as qorc-test-base + +WORKDIR / +RUN git clone --recursive https://github.com/QuickLogic-Corp/qorc-sdk.git + +FROM qorc-test-base as qorc-test-qf_apps + +WORKDIR /qorc-sdk/qf_apps +RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ + conda activate && \ + make + +FROM qorc-test-base as qorc-test-qf_vr_apps + +WORKDIR /qorc-sdk/qf_vr_apps +RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ + conda activate && \ + make + +# The following qorc_testapps wouldn't build +#FROM qorc-test-base as qorc-test-qorc_testapps + +#WORKDIR /qorc-sdk/qorc-testapps +#RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ +#conda activate && \ +#make + +# The qorc-user target adds a user and entrypoint to the default target. +# Build the qorc-user target with a command like this: +# docker build --build-arg TAG=v1.3.0 -f Dockerfile.qorc --target qorc-user . -t qorc-user +# +# Run it in the qorc-sdk directory or any project directory with a command like this: +# docker run -it --rm -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix" -v $(pwd):/home/ic qorc-user bash +# +# Note that the conda-user.sh file used as an entrypoint sources the conda.sh file and activates conda +# so there is no need to do those things when using this qorc-user target. Simply run make inside qorc-sdk. +# +FROM qorc-base as qorc-user + +RUN apt-get update && apt-get install -y \ + libusb-1.0-0 \ + python3-pip \ + usbutils \ + udev && \ + rm -rf /var/lib/apt/lists/* + +ARG USER=ic +ARG UID=1000 +ARG GID=1000 +RUN addgroup --gid ${GID} ${USER} +RUN adduser --uid ${UID} --gid ${GID} --gecos "" --disabled-password --shell /bin/bash ${USER} + +USER ${USER} +WORKDIR /home/${USER} + +SHELL [ "/bin/bash" ] +COPY conda-user.sh /scripts/conda-user.sh + +ENTRYPOINT [ "/scripts/conda-user.sh" ] + + + +FROM qorc-user as qorc +# If the above test builds complete, the qorc-user becomes the default target, qorc. +# Build the default qorc target with a command like this: +# docker build --build-arg TAG=v1.3.0 -f Dockerfile.qorc . -t qorc +# +# Run it in the qorc-sdk directory or any project directory with a command like this: +# docker run -it --rm -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix" -v $(pwd):/home/ic qorc bash +# +# Note that the conda-user.sh file used as an entrypoint sources the conda.sh file and activates conda +# so there is no need to do those things when using this qorc target. Simply run make inside qorc-sdk. +# + From b9969a4c6aec704530e0f833de51d4f51d5f079c Mon Sep 17 00:00:00 2001 From: Thirsty2 Date: Wed, 16 Dec 2020 23:12:13 -0800 Subject: [PATCH 08/19] Fixed comments for Dockerfile.use-installer. --- Dockerfile.use-installer | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/Dockerfile.use-installer b/Dockerfile.use-installer index 45f3cb3..df317ec 100644 --- a/Dockerfile.use-installer +++ b/Dockerfile.use-installer @@ -31,13 +31,22 @@ RUN wget https://github.com/QuickLogic-Corp/quicklogic-fpga-toolchain/releases/d ENV PATH="${INSTALL_DIR}/quicklogic-arch-defs/bin:${INSTALL_DIR}/quicklogic-arch-defs/bin/python:$PATH" +# The symbiflow-ql target is the same as in previous versions of Dockerfile.use-installer. +# It contains no user or entrypoint, which makes it easy to re-use as a parent image. +# +# Build the symbiflow-ql target with a command like this: +# docker build --build-arg TAG=v1.3.0 -f Dockerfile.use-installer --target symbiflow-ql . -t symbiflow-ql +# +# Run it with a command like this: +# docker run -it --rm -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix" -v $(pwd):/root symbiflow-ql bash +# FROM base as symbiflow-ql # The qorc-base target has no user and no entrypoint specified, which makes # it useful as a base image. - +# # Build the qorc-base target with a command like this: -# docker build --build-arg TAG=v1.3.0 -f Dockerfile.qorc --target qorc-base . -t qorc-base +# docker build --build-arg TAG=v1.3.0 -f Dockerfile.use-installer --target qorc-base . -t qorc-base # # Run it in the qorc-sdk directory or another project directory with a command like this: # docker run -it --rm -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix" -v $(pwd):/root qorc-base bash @@ -75,7 +84,7 @@ RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ conda activate && \ make -# The following qorc_testapps wouldn't build +# The following qorc_testapps wouldn't build so they are commented out for now #FROM qorc-test-base as qorc-test-qorc_testapps #WORKDIR /qorc-sdk/qorc-testapps @@ -85,7 +94,7 @@ RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ # The qorc-user target adds a user and entrypoint to the default target. # Build the qorc-user target with a command like this: -# docker build --build-arg TAG=v1.3.0 -f Dockerfile.qorc --target qorc-user . -t qorc-user +# docker build --build-arg TAG=v1.3.0 -f Dockerfile.use-installer --target qorc-user . -t qorc-user # # Run it in the qorc-sdk directory or any project directory with a command like this: # docker run -it --rm -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix" -v $(pwd):/home/ic qorc-user bash @@ -116,12 +125,14 @@ COPY conda-user.sh /scripts/conda-user.sh ENTRYPOINT [ "/scripts/conda-user.sh" ] - +# I would prefer to move the tests to this point, but doing so didn't work initially so +# I left them after the qorc-base target for now. It may have something to do with adding +# the entrypoint, or with permissions, or both. More work is needed to move the tests. FROM qorc-user as qorc # If the above test builds complete, the qorc-user becomes the default target, qorc. # Build the default qorc target with a command like this: -# docker build --build-arg TAG=v1.3.0 -f Dockerfile.qorc . -t qorc +# docker build --build-arg TAG=v1.3.0 -f Dockerfile.use-installer . -t qorc # # Run it in the qorc-sdk directory or any project directory with a command like this: # docker run -it --rm -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix" -v $(pwd):/home/ic qorc bash From 0e8446782a034a721d413df80265d0aead982ff5 Mon Sep 17 00:00:00 2001 From: Thirsty2 Date: Tue, 29 Dec 2020 19:32:06 -0800 Subject: [PATCH 09/19] Install bazel, needed for tensorflow. --- Dockerfile.use-installer | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Dockerfile.use-installer b/Dockerfile.use-installer index df317ec..dc91c93 100644 --- a/Dockerfile.use-installer +++ b/Dockerfile.use-installer @@ -3,11 +3,13 @@ FROM ubuntu:20.04 as base ARG DEBIAN_FRONTEND=noninteractive ENV TZ=America/Los_Angeles +# install depedencies that are not yet in the installer RUN apt-get update && apt-get install -y \ - libcanberra-gtk-module \ - make \ curl \ git \ + gnupg \ + libcanberra-gtk-module \ + make \ wget \ xz-utils && \ rm -rf /var/lib/apt/lists/* @@ -16,6 +18,14 @@ RUN apt-get update && apt-get install -y \ RUN echo "dash dash/sh boolean false" | debconf-set-selections RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash +# install bazel (needed for tensorFlow) +RUN curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg && \ + mv bazel.gpg /etc/apt/trusted.gpg.d/ && \ + echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list && \ + apt update && apt install -y \ + bazel && \ + rm -rf /var/lib/apt/lists/* + # add ARGs so that these can be passed in while doing a docker build, the following will be default values ARG TAG=v0.0.0 ENV INSTALL_DIR="/opt/symbiflow/eos-s3" From 4ae3b66c3344faf35b6203d8d7dbfd2b3f812c7b Mon Sep 17 00:00:00 2001 From: Thirsty2 Date: Wed, 30 Dec 2020 11:03:46 -0800 Subject: [PATCH 10/19] Updated documentation and comments. --- Dockerfile.use-installer | 8 ++++---- README.rst | 38 +++++++++++++++++++++++++++----------- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/Dockerfile.use-installer b/Dockerfile.use-installer index dc91c93..bf964dc 100644 --- a/Dockerfile.use-installer +++ b/Dockerfile.use-installer @@ -45,7 +45,7 @@ ENV PATH="${INSTALL_DIR}/quicklogic-arch-defs/bin:${INSTALL_DIR}/quicklogic-arch # It contains no user or entrypoint, which makes it easy to re-use as a parent image. # # Build the symbiflow-ql target with a command like this: -# docker build --build-arg TAG=v1.3.0 -f Dockerfile.use-installer --target symbiflow-ql . -t symbiflow-ql +# docker build --build-arg TAG=v1.3.1 -f Dockerfile.use-installer --target symbiflow-ql . -t symbiflow-ql # # Run it with a command like this: # docker run -it --rm -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix" -v $(pwd):/root symbiflow-ql bash @@ -56,7 +56,7 @@ FROM base as symbiflow-ql # it useful as a base image. # # Build the qorc-base target with a command like this: -# docker build --build-arg TAG=v1.3.0 -f Dockerfile.use-installer --target qorc-base . -t qorc-base +# docker build --build-arg TAG=v1.3.1 -f Dockerfile.use-installer --target qorc-base . -t qorc-base # # Run it in the qorc-sdk directory or another project directory with a command like this: # docker run -it --rm -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix" -v $(pwd):/root qorc-base bash @@ -104,7 +104,7 @@ RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ # The qorc-user target adds a user and entrypoint to the default target. # Build the qorc-user target with a command like this: -# docker build --build-arg TAG=v1.3.0 -f Dockerfile.use-installer --target qorc-user . -t qorc-user +# docker build --build-arg TAG=v1.3.1 -f Dockerfile.use-installer --target qorc-user . -t qorc-user # # Run it in the qorc-sdk directory or any project directory with a command like this: # docker run -it --rm -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix" -v $(pwd):/home/ic qorc-user bash @@ -142,7 +142,7 @@ ENTRYPOINT [ "/scripts/conda-user.sh" ] FROM qorc-user as qorc # If the above test builds complete, the qorc-user becomes the default target, qorc. # Build the default qorc target with a command like this: -# docker build --build-arg TAG=v1.3.0 -f Dockerfile.use-installer . -t qorc +# docker build --build-arg TAG=v1.3.1 -f Dockerfile.use-installer . -t qorc # # Run it in the qorc-sdk directory or any project directory with a command like this: # docker run -it --rm -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix" -v $(pwd):/home/ic qorc bash diff --git a/README.rst b/README.rst index 8d82249..877545b 100644 --- a/README.rst +++ b/README.rst @@ -196,34 +196,50 @@ Such images are useful for developing continuous integration of FPGA projects. The act of building and testing them automatically through github actions also provides assurances that what is checked into the github source repositories can be built and executed. Below are some of -the options for using containers to run or build SymbiFlow for -Quicklogic development. +the options for using containers to run or build SymbiFlow and the QORC +toolchain for Quicklogic development. .. _option-a-build-a-container-image-locally-from-dockerfileuse-installer: Option A) Build a container image locally from Dockerfile.use-installer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -| The Dockerfile.use-installer in this repo builds a SymbiFlow container +| The Dockerfile.use-installer in this repo builds a QORC container image from a released installer. -| You can build and tag the symbiflow-ql container with: +| The default target is the full QORC toolchain. You can build it with: :: + docker build --build-arg TAG=v1.3.1 -f Dockerfile.use-installer . -t qorc:1.3.1 - docker build . -f Dockerfile.use-installer -t symbiflow-ql +| The easiest way to test the QORC toolchain container is to clone the qorc-sdk repository and build the sample apps. +:: + git clone https://github.com/QuickLogic-Corp/qorc-sdk.git + cd qorc-sdk + git submodule init + git submodule update + docker run -it --rm -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix" -v $(pwd):/home/ic qorc:1.3.0 bash + cd qf_apps + make + +| Previous versions of this README file documented the symbiflow-ql container which has no compiler, no entrypoint, and runs as root. +It is less convenient than the default target, but it is still useful as a base image to build upon. +You can still build and tag the symbiflow-ql container image with: + +:: + + docker build --build-arg TAG=v1.3.1 -f Dockerfile.use-installer --target symbiflow-ql . -t symbiflow-ql -In order to view the gtkwave program, the easiest (but not the safest) -thing to do is allow x connections: +In order to view the gtkwave program, the easiest thing to do is allow x connections: :: - xhost + + xhost +local:docker docker run -it -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix" symbiflow-ql bash or run a prebuilt container automatically built from the installer by github actions: - docker run -it -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix" docker.pkg.github.com/thirsty2/quicklogic-fpga-toolchain/symbiflow-ql:1.2.0.0 bash + docker run -it -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix" docker.pkg.github.com/quicklogic-corp/quicklogic-fpga-toolchain/symbiflow-ql:1.3.1 bash Inside your running docker container, try some of the commands from the tutorial: @@ -252,7 +268,7 @@ When you are finished, it would be wise to disallow x connections: :: - xhost - + xhost -local:docker Option B) Build a container image locally from Dockerfile ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -293,7 +309,7 @@ using a docker command like this: :: - docker run -it docker.pkg.github.com/quicklogic-corp/quicklogic-fpga-toolchain/symbiflow-ql-src:latest bash + docker run -it docker.pkg.github.com/quicklogic-corp/quicklogic-fpga-toolchain/symbiflow-ql:1.3.1 bash From your bash session in the container, try: From 4eb57fbac159ff9afb63d776e75cee682859e99c Mon Sep 17 00:00:00 2001 From: Thirsty2 Date: Wed, 30 Dec 2020 11:07:31 -0800 Subject: [PATCH 11/19] Clean up formatting of documentation. --- README.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 877545b..27a98ea 100644 --- a/README.rst +++ b/README.rst @@ -209,10 +209,12 @@ Option A) Build a container image locally from Dockerfile.use-installer | The default target is the full QORC toolchain. You can build it with: :: + docker build --build-arg TAG=v1.3.1 -f Dockerfile.use-installer . -t qorc:1.3.1 | The easiest way to test the QORC toolchain container is to clone the qorc-sdk repository and build the sample apps. :: + git clone https://github.com/QuickLogic-Corp/qorc-sdk.git cd qorc-sdk git submodule init @@ -221,8 +223,7 @@ Option A) Build a container image locally from Dockerfile.use-installer cd qf_apps make -| Previous versions of this README file documented the symbiflow-ql container which has no compiler, no entrypoint, and runs as root. -It is less convenient than the default target, but it is still useful as a base image to build upon. +| Previous versions of this README file documented the symbiflow-ql container which has no compiler, no entrypoint, and runs as root. It is less convenient than the default target, but it is still useful as a base image to build upon. You can still build and tag the symbiflow-ql container image with: :: From d245410223d2fa770bb5d2dcbbfe4b75ff0dd2c4 Mon Sep 17 00:00:00 2001 From: Doug Knight Date: Sun, 20 Jun 2021 20:58:14 -0700 Subject: [PATCH 12/19] Add libtbb-dev --- Dockerfile | 1 + Dockerfile.use-installer | 1 + 2 files changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index b7a317f..b26a94e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,7 @@ RUN apt-get update -qq \ git \ libffi-dev \ libreadline-dev \ + libtbb-dev \ tcl-dev \ graphviz \ wget \ diff --git a/Dockerfile.use-installer b/Dockerfile.use-installer index bf964dc..f080d10 100644 --- a/Dockerfile.use-installer +++ b/Dockerfile.use-installer @@ -9,6 +9,7 @@ RUN apt-get update && apt-get install -y \ git \ gnupg \ libcanberra-gtk-module \ + libtbb-dev\ make \ wget \ xz-utils && \ From 0a62bad850b492faad07c80ac5482b2f3a0c1712 Mon Sep 17 00:00:00 2001 From: Doug Knight Date: Mon, 21 Jun 2021 15:04:07 -0700 Subject: [PATCH 13/19] Last build succeeded. Comment out long running test to troubleshoot package push. Try creating a new GITHUB_TOKEN for push because expiration time is only an hour. --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index b26a94e..622d750 100644 --- a/Dockerfile +++ b/Dockerfile @@ -92,10 +92,10 @@ FROM release-candidate AS all_quick_tests WORKDIR /symbiflow-arch-defs/build/quicklogic/pp3/tests RUN make all_quick_tests -FROM release-candidate AS all_ql_tests +# FROM release-candidate AS all_ql_tests -WORKDIR /symbiflow-arch-defs/build/quicklogic/pp3/tests -RUN make all_ql_tests +# WORKDIR /symbiflow-arch-defs/build/quicklogic/pp3/tests +# RUN make all_ql_tests FROM release-candidate AS release From 6b1750c7bc4fb7c52aee4a994dd216e29d77d612 Mon Sep 17 00:00:00 2001 From: Doug Knight Date: Mon, 21 Jun 2021 15:06:05 -0700 Subject: [PATCH 14/19] Last build succeeded. Comment out long running test to troubleshoot package push. Try creating a new GITHUB_TOKEN for push because expiration time is only an hour. --- .github/workflows/docker-publish.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index d12361a..ffb939a 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -44,4 +44,6 @@ jobs: echo VERSION=$VERSION docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION \ No newline at end of file + docker push $IMAGE_ID:$VERSION + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 20de793e8b12665273671b3c7fa3267cab2fc934 Mon Sep 17 00:00:00 2001 From: Doug Knight Date: Mon, 21 Jun 2021 23:51:57 -0700 Subject: [PATCH 15/19] Build token timeout fixed, run make all_ql_tests. --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 622d750..b26a94e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -92,10 +92,10 @@ FROM release-candidate AS all_quick_tests WORKDIR /symbiflow-arch-defs/build/quicklogic/pp3/tests RUN make all_quick_tests -# FROM release-candidate AS all_ql_tests +FROM release-candidate AS all_ql_tests -# WORKDIR /symbiflow-arch-defs/build/quicklogic/pp3/tests -# RUN make all_ql_tests +WORKDIR /symbiflow-arch-defs/build/quicklogic/pp3/tests +RUN make all_ql_tests FROM release-candidate AS release From 4e403f2b377deaf938e717cf7d2201676b542533 Mon Sep 17 00:00:00 2001 From: Thirsty2 Date: Sat, 3 Jul 2021 17:33:01 -0700 Subject: [PATCH 16/19] Fix Dockerfile - clone master branch of vtr as described in README file. --- Dockerfile | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index b26a94e..a787ad8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,10 +41,10 @@ RUN apt-get update -qq \ iverilog \ pkg-config -#Checkout *yosys* repository (https://github.com/QuickLogic-Corp/yosys.git), branch: **quicklogic-rebased**. +#Checkout *yosys* repository (https://github.com/QuickLogic-Corp/yosys.git), branch: **quicklogic-rebased**. RUN git clone https://github.com/QuickLogic-Corp/yosys.git -b quicklogic-rebased quicklogic-yosys -RUN cd quicklogic-yosys WORKDIR /quicklogic-yosys + RUN make config-gcc RUN make install PREFIX=${INSTALL_DIR}/install RUN cd - @@ -52,24 +52,24 @@ RUN cd - #Checkout *yosys-symbiflow-plugins* (https://github.com/QuickLogic-Corp/yosys-symbiflow-plugins), branch: **ql-ios**. WORKDIR / RUN git clone https://github.com/QuickLogic-Corp/yosys-symbiflow-plugins -b ql-ios -RUN cd yosys-symbiflow-plugins + WORKDIR /yosys-symbiflow-plugins # export PATH='specify Yosys installation path as specified in PREFIX in previous step':$PATH RUN make RUN make install RUN cd - -#Checkout *vpr* repository (https://github.com/QuickLogic-Corp/vtr-verilog-to-routing.git), branch: **blackbox_timing**. +#Checkout *vpr* repository (https://github.com/SymbiFlow/vtr-verilog-to-routing.git), branch: **master**. WORKDIR / -RUN git clone https://github.com/QuickLogic-Corp/vtr-verilog-to-routing -b blackbox_timing +RUN git clone https://github.com/SymbiFlow/vtr-verilog-to-routing -b master RUN cd vtr-verilog-to-routing WORKDIR /vtr-verilog-to-routing RUN make -#Checkout *symbiflow-arch-defs* repository (https://github.com/QuickLogic-Corp/symbiflow-arch-defs.git), branch: **quicklogic-upstream-rebase**. +#Checkout *symbiflow-arch-defs* repository (https://github.com/QuickLogic-Corp/symbiflow-arch-defs.git), branch: **quicklogic-upstream-rebase**. WORKDIR / RUN git clone https://github.com/QuickLogic-Corp/symbiflow-arch-defs.git -b quicklogic-upstream-rebase -RUN cd symbiflow-arch-defs + WORKDIR /symbiflow-arch-defs RUN make env @@ -87,6 +87,11 @@ COPY --from=build /symbiflow-arch-defs /symbiflow-arch-defs/ COPY --from=build /yosys-symbiflow-plugins /yosys-symbiflow-plugins/ COPY --from=build /vtr-verilog-to-routing /vtr-verilog-to-routing/ +# Probably should add these to the release candidate: +# ENV YOSYS='path to Yosys binary, installed in first step' +# ENV VPR='path to vpr binary built' +# ENV GENFASM='path to genfasm binary built' + FROM release-candidate AS all_quick_tests WORKDIR /symbiflow-arch-defs/build/quicklogic/pp3/tests From 480ddb02a7adbd569393c4f0c7a504c2e56edb64 Mon Sep 17 00:00:00 2001 From: Thirsty2 Date: Mon, 5 Jul 2021 11:27:07 -0700 Subject: [PATCH 17/19] Run tests using a layer that is tagged as the final image provided that they pass. --- Dockerfile.use-installer | 116 ++++++++++++++++++++++++++++++++------- 1 file changed, 95 insertions(+), 21 deletions(-) diff --git a/Dockerfile.use-installer b/Dockerfile.use-installer index f080d10..13c3958 100644 --- a/Dockerfile.use-installer +++ b/Dockerfile.use-installer @@ -73,7 +73,8 @@ RUN wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-a tar -xjvf gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 && \ rm gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 -ENV PATH=/opt/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux:$PATH +ENV PATH=/opt/gcc-arm-none-eabi-9-2020-q2-update/bin:$PATH +ENV QORC_TC_PATH=/opt/gcc-arm-none-eabi-9-2020-q2-update/bin # The following tests are run automatically during a build of the default qorc image FROM qorc-base as qorc-test-base @@ -88,21 +89,6 @@ RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ conda activate && \ make -FROM qorc-test-base as qorc-test-qf_vr_apps - -WORKDIR /qorc-sdk/qf_vr_apps -RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ - conda activate && \ - make - -# The following qorc_testapps wouldn't build so they are commented out for now -#FROM qorc-test-base as qorc-test-qorc_testapps - -#WORKDIR /qorc-sdk/qorc-testapps -#RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ -#conda activate && \ -#make - # The qorc-user target adds a user and entrypoint to the default target. # Build the qorc-user target with a command like this: # docker build --build-arg TAG=v1.3.1 -f Dockerfile.use-installer --target qorc-user . -t qorc-user @@ -123,6 +109,7 @@ RUN apt-get update && apt-get install -y \ rm -rf /var/lib/apt/lists/* ARG USER=ic +ENV USER=${USER} ARG UID=1000 ARG GID=1000 RUN addgroup --gid ${GID} ${USER} @@ -131,14 +118,101 @@ RUN adduser --uid ${UID} --gid ${GID} --gecos "" --disabled-password --shell /bi USER ${USER} WORKDIR /home/${USER} -SHELL [ "/bin/bash" ] -COPY conda-user.sh /scripts/conda-user.sh +COPY --chown=ic:ic conda-user.sh /scripts/conda-user.sh ENTRYPOINT [ "/scripts/conda-user.sh" ] -# I would prefer to move the tests to this point, but doing so didn't work initially so -# I left them after the qorc-base target for now. It may have something to do with adding -# the entrypoint, or with permissions, or both. More work is needed to move the tests. +# create a base layer that checks out the qorc-sdk repo containing various projects +# that may be used to test the image. We run tests using the qorc-user layer, and +# if none of them fail, that layer is tagged as the default qorc layer. +FROM qorc-user as qorc-user-test + +RUN echo $PATH +RUN git --version +RUN git clone --recursive https://github.com/QuickLogic-Corp/qorc-sdk.git + +# The following tests run automatically during a build of the default qorc target. +# If any of these tests fail, the build will not tag a qorc image. + +FROM qorc-user-test as qorc-user-test-qf-apps + +WORKDIR /home/${USER}/qorc-sdk/qf_apps +RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ + conda activate && \ + make + +# One of the following qf_vr_apps wouldn't build from the main makefile, so +# building them independently for now. +FROM qorc-user-test as qorc-user-test-qf_vr_apps + +WORKDIR /home/${USER}/qorc-sdk/qf_vr_apps +RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ + conda activate && \ + make 1micvr_app && \ + make 2micvr_app && \ + make vr_raw_app && \ + make host_app && \ + make vr_i2s_app && \ + make vr_opus_app && \ + make vr_raw_wifi_app && \ + make vr_aec_app +# make amazon_alexa_app +# won't link, so commented it out. + + +FROM qorc-user-test as qorc-user-test-qorc-testapps + +# The main makefile only runs 3 of these, so testing them independently +WORKDIR /home/${USER}/qorc-sdk/qorc-testapps/qf_advancedfpga_separate/GCC_Project +RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ +conda activate && \ +make + +WORKDIR /home/${USER}/qorc-sdk/qorc-testapps/qf_baremetal/GCC_Project +RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ +conda activate && \ +make + +WORKDIR /home/${USER}/qorc-sdk/qorc-testapps/qf_gwtestharness_fll/GCC_Project +RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ +conda activate && \ +make + +WORKDIR /home/${USER}/qorc-sdk/qorc-testapps/qf_helloworldm4/GCC_Project +RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ +conda activate && \ +make + +WORKDIR /home/${USER}/qorc-sdk/qorc-testapps/qf_helloworldsw_separate/GCC_Project +RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ +conda activate && \ +make + +WORKDIR /home/${USER}/qorc-sdk/qorc-testapps/qf_ramblockinit/GCC_Project +RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ +conda activate && \ +make + +# The qf_usbspeed app doesn't compile, so commented it out for now. +#WORKDIR /qorc-sdk/qorc-testapps/qf_usbspeed/GCC_Project +#RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ +#conda activate && \ +#make + +FROM qorc-user-test as qorc-user-test-qomu-apps + +WORKDIR /home/${USER}/qorc-sdk/qomu_apps +RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ +conda activate && \ +make + + +FROM qorc-user-test as qorc-user-test-qorc-example-apps + +WORKDIR /home/${USER}/qorc-sdk/qorc-example-apps/qf_pm2dot5aqi/GCC_Project +RUN source $INSTALL_DIR/conda/etc/profile.d/conda.sh && \ +conda activate && \ +make FROM qorc-user as qorc # If the above test builds complete, the qorc-user becomes the default target, qorc. From 77b36122c83f55683eeea7d390b7c494b0ac7278 Mon Sep 17 00:00:00 2001 From: Thirsty2 Date: Sun, 15 Aug 2021 20:13:36 -0700 Subject: [PATCH 18/19] Update README.rst --- README.rst | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 1adae7c..d8c5b9a 100644 --- a/README.rst +++ b/README.rst @@ -21,9 +21,6 @@ QLF-K4N8/QLF-K6N10 Device: Below are some ways to run SymbiFlow for QLF-K4N8/QLF-K6N10 Devices: -1) Run an installer and run an example -2) Compile from source code and run example - .. _1-run-an-installer-and-run-an-example: 1) Run an installer and run an example @@ -227,6 +224,45 @@ it: cd quicklogic/pp3/tests/quicklogic_testsuite/bin2seven make bin2seven-ql-chandalar_fasm +.. _3-run-symbiflow-in-a-container: + +3) Run SymbiFlow in a container +------------------------------------------- + +The qorc-sdk project from Quicklogic's github page contains good examples for running the qorc tools to +create hardware and FPGA gateware for the quickfeather development kit. +https://github.com/QuickLogic-Corp/qorc-sdk + +A quick way to get started without installing any tools is to use a docker container. Build your own +container image from Dockerfile.use-installer with: + +:: + docker build --build-arg TAG=v1.3.1 -f Dockerfile.use-installer . -t qorc:1.3.1 + +Or pull a prebuilt container image from github with: + +:: + docker pull ghcr.io/thirsty2/quicklogic-fpga-toolchain/qorc:1.3.1 + docker tag ghcr.io/thirsty2/quicklogic-fpga-toolchain/qorc:1.3.1 qorc:1.3.1 + +If you have cloned the qorc-sdk project, you can use the container and build an example project. +Change to the qorc-sdk directory, and start bash in a qorc container with: + +:: + cd qorc-sdk + docker run -it --rm -v $(pwd):/home/ic/qorc-sdk qorc:1.3.1 bash + source $INSTALL_DIR/conda/etc/profile.d/conda.sh + conda activate + cd qorc-sdk/qf_apps/qf_helloworldhw/GCC_Project + make + +You can use qfprog in a container to program the quickfeather hardware. +Instructions and a Dockerfile are here: +https://github.com/Thirsty2/qfprog + +Or use pip3 to install the programming tool from the QuickLogic github page here: +https://github.com/QuickLogic-Corp/TinyFPGA-Programmer-Application + Hardware features that are not supported in this release -------------------------------------------------------- From d8338e20b45c50541598350f21eb86cfb2b2c7d5 Mon Sep 17 00:00:00 2001 From: Thirsty2 Date: Sun, 15 Aug 2021 20:19:21 -0700 Subject: [PATCH 19/19] Update README.rst --- README.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index d8c5b9a..8135129 100644 --- a/README.rst +++ b/README.rst @@ -236,19 +236,22 @@ https://github.com/QuickLogic-Corp/qorc-sdk A quick way to get started without installing any tools is to use a docker container. Build your own container image from Dockerfile.use-installer with: -:: + :: + docker build --build-arg TAG=v1.3.1 -f Dockerfile.use-installer . -t qorc:1.3.1 Or pull a prebuilt container image from github with: -:: + :: + docker pull ghcr.io/thirsty2/quicklogic-fpga-toolchain/qorc:1.3.1 docker tag ghcr.io/thirsty2/quicklogic-fpga-toolchain/qorc:1.3.1 qorc:1.3.1 If you have cloned the qorc-sdk project, you can use the container and build an example project. Change to the qorc-sdk directory, and start bash in a qorc container with: -:: + :: + cd qorc-sdk docker run -it --rm -v $(pwd):/home/ic/qorc-sdk qorc:1.3.1 bash source $INSTALL_DIR/conda/etc/profile.d/conda.sh