tillitis-key/contrib/Dockerfile
Matthew Mets 072b204d3d
Add (hardware) production tests for the TK-1 and TP-1 (#69)
* ch552 firmware: add ch55x support files directly

* Add sdcc compiler to docker image, for building CH552 firmware

* Rework production test script

* Add menu-based test runner
* Rewrite production test flows as lists of individual tests
* Add both production flows and manual tests to menu

* Switch to using included binaries

* production test: Update message format
* test_txrx_touchpad: Retry if device communications fail
* production test: put all binaries in binaries/ folder
* binaries/top.bin: replace broken binary

* flash_check: Check for explicit flash IDs

* Document most test procedures

* Test plan documentation

* Sample udev rules

* Production test: allow external references to be overridden

* Remove outdated descriptions

* Correct shebang

* Update shebangs to comply with PEP 394

Change the python scripts to call python instead of python3, as this
works cross platform. See:
https://peps.python.org/pep-0394/#for-python-script-publishers

* Move production test to higher-level directory

* Clarify production test setup

* Move USB C connector test to separate directory

Co-authored-by: Michael Cardell Widerkrantz <mc@tillitis.se>
2023-01-11 16:33:01 +01:00

89 lines
2.6 KiB
Docker

FROM docker.io/library/ubuntu:22.10 as base
RUN apt-get -qq update -y \
&& DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends \
bison \
build-essential \
ca-certificates \
clang \
cmake \
flex \
gawk \
git \
golang \
graphviz \
less \
libboost-dev \
libboost-filesystem-dev \
libboost-iostreams-dev \
libboost-program-options-dev \
libboost-thread-dev \
libeigen3-dev \
libffi-dev \
libftdi-dev \
libglib2.0-dev \
libhidapi-dev \
libpixman-1-dev \
libreadline-dev \
lld \
llvm \
mercurial \
nano \
ninja-build \
pkg-config \
python3 \
python3-dev \
tcl-dev \
verilator \
vim \
xdot \
sdcc \
&& rm -rf /var/lib/apt/lists/*
FROM base as builder
RUN git clone --depth=1 https://github.com/YosysHQ/icestorm /src
WORKDIR /src
RUN make -j$(nproc --ignore=2) \
&& make install
RUN git >/usr/local/repo-commit-icestorm describe --tags --always --dirty
WORKDIR /
RUN rm -rf /src
# Custom iceprog for the RPi 2040-based programmer (will be upstreamed).
RUN git clone -b interfaces --depth=1 https://github.com/tillitis/icestorm /src
WORKDIR /src/iceprog
RUN make -j$(nproc --ignore=2) \
&& make PROGRAM_PREFIX=tillitis- install
RUN git >/usr/local/repo-commit-tillitis--icestorm describe --tags --always --dirty
WORKDIR /
RUN rm -rf /src
RUN git clone https://github.com/YosysHQ/yosys /src
WORKDIR /src
# Avoiding current issue with yosys & icebram, filed in:
# https://github.com/YosysHQ/yosys/issues/3478
RUN git checkout 06ef3f264afaa3eaeab45cc0404d8006c15f02b1 \
&& make -j$(nproc --ignore=2) \
&& make install
RUN git >/usr/local/repo-commit-yosys describe --tags --always --dirty
WORKDIR /
RUN rm -rf /src
RUN git clone https://github.com/YosysHQ/nextpnr /src
WORKDIR /src
# Use nextpnr-0.4. Aa few commits later we got issues, like on f4e6bbd383f6c43.
RUN git checkout nextpnr-0.4 \
&& cmake -DARCH=ice40 -DCMAKE_INSTALL_PREFIX=/usr/local . \
&& make -j$(nproc --ignore=2) \
&& make install
RUN git >/usr/local/repo-commit-nextpnr describe --tags --always --dirty
WORKDIR /
RUN rm -rf /src
FROM base
COPY --from=builder /usr/local/ /usr/local