diff --git a/.github/workflows/impl.yml b/.github/workflows/impl.yml index ebfde00f..dab48784 100644 --- a/.github/workflows/impl.yml +++ b/.github/workflows/impl.yml @@ -2,6 +2,7 @@ # Unai Martinez-Corral # # Copyright 2019-2021 Unai Martinez-Corral +# Copyright 2021 Sebastian Birke # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -43,9 +44,19 @@ jobs: - run: echo "$(pwd)/.github/bin" >> $GITHUB_PATH - - run: dockerBuild impl impl + - run: dockerBuild impl:ice40 impl ice40 + - run: dockerBuild impl:icestorm impl icestorm + - run: dockerBuild impl:ecp5 impl ecp5 + - run: dockerBuild impl:prjtrellis impl prjtrellis + - run: dockerBuild impl:pnr impl pnr + - run: dockerBuild impl:latest impl latest - - run: dockerTest impl + - run: dockerTest impl:ice40 impl--ice40 + - run: dockerTest impl:icestorm impl--icestorm + - run: dockerTest impl:ecp5 impl--ecp5 + - run: dockerTest impl:prjtrellis impl--prjtrellis + - run: dockerTest impl:pnr impl--pnr + - run: dockerTest impl:latest impl - name: Login to DockerHub if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' @@ -54,5 +65,20 @@ jobs: username: ${{ secrets.DOCKER_USER }} password: ${{ secrets.DOCKER_PASS }} - - run: dockerPush impl + - run: dockerPush impl:ice40 + if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' + + - run: dockerPush impl:icestorm + if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' + + - run: dockerPush impl:ecp5 + if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' + + - run: dockerPush impl:prjtrellis + if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' + + - run: dockerPush impl:pnr + if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' + + - run: dockerPush impl:latest if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' diff --git a/.github/workflows/nextpnr.yml b/.github/workflows/nextpnr.yml index 1fa570d0..598facd1 100644 --- a/.github/workflows/nextpnr.yml +++ b/.github/workflows/nextpnr.yml @@ -45,10 +45,16 @@ jobs: - run: dockerBuild nextpnr:ice40 nextpnr ice40 - run: dockerBuild nextpnr:icestorm nextpnr icestorm + - run: dockerBuild pkg:nextpnr-ice40 nextpnr pkg-ice40 - run: dockerBuild nextpnr:ecp5 nextpnr ecp5 - run: dockerBuild nextpnr:prjtrellis nextpnr prjtrellis + - run: dockerBuild pkg:nextpnr-ecp5 nextpnr pkg-ecp5 + - run: dockerBuild pkg:nextpnr-all nextpnr pkg-all - run: dockerBuild nextpnr nextpnr + - run: dockerTestPkg nextpnr-ice40 + - run: dockerTestPkg nextpnr-ecp5 + - run: dockerTestPkg nextpnr-all - run: dockerTest nextpnr:ice40 - run: dockerTest nextpnr:icestorm - run: dockerTest nextpnr:ecp5 @@ -68,11 +74,20 @@ jobs: - run: dockerPush nextpnr:icestorm if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' + - run: dockerPush pkg:nextpnr-ice40 + if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' + - run: dockerPush nextpnr:ecp5 if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' - run: dockerPush nextpnr:prjtrellis if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' + - run: dockerPush pkg:nextpnr-ecp5 + if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' + - run: dockerPush nextpnr if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' + + - run: dockerPush pkg:nextpnr-all + if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' diff --git a/base.dockerfile b/base.dockerfile index e51677d8..044a8486 100644 --- a/base.dockerfile +++ b/base.dockerfile @@ -35,6 +35,7 @@ FROM base AS build RUN apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ clang \ + git \ make ENV CC clang diff --git a/impl.dockerfile b/impl.dockerfile index 24c268da..8e51af7d 100644 --- a/impl.dockerfile +++ b/impl.dockerfile @@ -1,7 +1,9 @@ # Authors: # Unai Martinez-Corral +# Sebastian Birke # # Copyright 2019-2021 Unai Martinez-Corral +# Copyright 2021 Sebastian Birke # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,20 +19,52 @@ # # SPDX-License-Identifier: Apache-2.0 -FROM hdlc/nextpnr +FROM hdlc/ghdl:yosys AS base COPY --from=hdlc/pkg:ghdl-yosys-plugin /ghdl / COPY --from=hdlc/pkg:yosys /yosys / RUN apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ - libffi-dev \ - libgnat-8 \ - libreadline-dev \ - tcl-dev \ - graphviz \ - xdot \ + libboost-all-dev \ + libomp5-7 \ + make \ && apt-get autoclean && apt-get clean && apt-get -y autoremove \ - && rm -rf /var/lib/apt/lists \ - && yosys-config --exec mkdir -p --datdir/plugins \ - && yosys-config --exec ln -s /usr/local/lib/ghdl_yosys.so --datdir/plugins/ghdl.so + && rm -rf /var/lib/apt/lists + +#--- + +FROM base AS ice40 + +COPY --from=hdlc/pkg:nextpnr-ice40 /nextpnr-ice40 / + +#--- + +FROM ice40 AS icestorm + +COPY --from=hdlc/pkg:icestorm /icestorm / + +#--- + +FROM base AS ecp5 + +COPY --from=hdlc/pkg:nextpnr-ecp5 /nextpnr-ecp5 / + +#--- + +FROM ecp5 AS prjtrellis + +COPY --from=hdlc/pkg:prjtrellis /prjtrellis / + +#--- + +FROM base AS pnr + +COPY --from=hdlc/pkg:nextpnr-all /nextpnr-all / + +#--- + +FROM pnr AS latest + +COPY --from=hdlc/pkg:icestorm /icestorm / +COPY --from=hdlc/pkg:prjtrellis /prjtrellis / diff --git a/nextpnr.dockerfile b/nextpnr.dockerfile index adfe8e4f..29b04a32 100644 --- a/nextpnr.dockerfile +++ b/nextpnr.dockerfile @@ -1,8 +1,10 @@ # Authors: # Anton Blanchard # Unai Martinez-Corral +# Sebastian Birke # # Copyright 2019-2021 Unai Martinez-Corral +# Copyright 2021 Sebastian Birke # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,7 +31,7 @@ RUN apt-get update -qq \ #--- -FROM hdlc/build:dev AS build +FROM hdlc/build:dev AS build-aptrequirements ENV LDFLAGS "-Wl,--copy-dt-needed-entries" @@ -40,13 +42,17 @@ RUN apt-get update -qq \ #--- -FROM build AS build-ice40 +FROM build-aptrequirements AS build-gitfetch + +RUN git clone https://github.com/YosysHQ/nextpnr.git /tmp/nextpnr \ + && mkdir /tmp/nextpnr/build/ + +#--- + +FROM build-gitfetch AS build-ice40 COPY --from=hdlc/pkg:icestorm /icestorm/usr/local/share/icebox /usr/local/share/icebox -RUN mkdir -p /tmp/nextpnr/build \ - && cd /tmp/nextpnr \ - && curl -fsSL https://codeload.github.com/YosysHQ/nextpnr/tar.gz/master | tar xzf - --strip-components=1 \ - && cd build \ +RUN cd /tmp/nextpnr/build \ && cmake .. \ -DARCH=ice40 \ -DBUILD_GUI=OFF \ @@ -67,13 +73,15 @@ COPY --from=hdlc/pkg:icestorm /icestorm / #--- -FROM build AS build-ecp5 +FROM scratch AS pkg-ice40 +COPY --from=build-ice40 /opt/nextpnr /nextpnr-ice40 + +#--- + +FROM build-gitfetch AS build-ecp5 COPY --from=hdlc/pkg:prjtrellis /prjtrellis / -RUN mkdir -p /tmp/nextpnr/build \ - && cd /tmp/nextpnr \ - && curl -fsSL https://codeload.github.com/YosysHQ/nextpnr/tar.gz/master | tar xzf - --strip-components=1 \ - && cd build \ +RUN cd /tmp/nextpnr/build \ && cmake .. \ -DARCH=ecp5 \ -DBUILD_GUI=OFF \ @@ -94,6 +102,11 @@ COPY --from=hdlc/pkg:prjtrellis /prjtrellis / #--- +FROM scratch AS pkg-ecp5 +COPY --from=build-ecp5 /opt/nextpnr /nextpnr-ecp5 + +#--- + FROM build-ice40 AS build-all COPY --from=hdlc/pkg:prjtrellis /prjtrellis / @@ -108,5 +121,10 @@ RUN cd /tmp/nextpnr/build \ #--- +FROM scratch AS pkg-all +COPY --from=build-all /opt/nextpnr /nextpnr-all + +#--- + FROM base AS all COPY --from=build-all /opt/nextpnr / diff --git a/test/impl--ecp5.sh b/test/impl--ecp5.sh new file mode 100755 index 00000000..8927f445 --- /dev/null +++ b/test/impl--ecp5.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env sh + +# Authors: +# Unai Martinez-Corral +# Sebastian Birke +# +# Copyright 2020-2021 Unai Martinez-Corral +# Copyright 2021 Sebastian Birke +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +set -e + +cd $(dirname "$0") + +./ghdl.sh +./yosys.sh +./nextpnr--ecp5.sh diff --git a/test/impl--ice40.sh b/test/impl--ice40.sh new file mode 100755 index 00000000..66cae582 --- /dev/null +++ b/test/impl--ice40.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env sh + +# Authors: +# Unai Martinez-Corral +# Sebastian Birke +# +# Copyright 2020-2021 Unai Martinez-Corral +# Copyright 2021 Sebastian Birke +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +set -e + +cd $(dirname "$0") + +./ghdl.sh +./yosys.sh +./nextpnr--ice40.sh diff --git a/test/impl--icestorm.sh b/test/impl--icestorm.sh new file mode 100755 index 00000000..22b12a89 --- /dev/null +++ b/test/impl--icestorm.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env sh + +# Authors: +# Unai Martinez-Corral +# Sebastian Birke +# +# Copyright 2020-2021 Unai Martinez-Corral +# Copyright 2021 Sebastian Birke +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +set -e + +cd $(dirname "$0") + +./ghdl.sh +./yosys.sh + +./nextpnr--ice40.sh +./icestorm.sh diff --git a/test/impl--pnr.sh b/test/impl--pnr.sh new file mode 100755 index 00000000..914ea7a0 --- /dev/null +++ b/test/impl--pnr.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env sh + +# Authors: +# Unai Martinez-Corral +# Sebastian Birke +# +# Copyright 2020-2021 Unai Martinez-Corral +# Copyright 2021 Sebastian Birke +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +set -e + +cd $(dirname "$0") + +./ghdl.sh +./yosys.sh + +./nextpnr--ecp5.sh +./nextpnr--ice40.sh diff --git a/test/impl--prjtrellis.sh b/test/impl--prjtrellis.sh new file mode 100755 index 00000000..3619d88a --- /dev/null +++ b/test/impl--prjtrellis.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env sh + +# Authors: +# Unai Martinez-Corral +# Sebastian Birke +# +# Copyright 2020-2021 Unai Martinez-Corral +# Copyright 2021 Sebastian Birke +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +set -e + +cd $(dirname "$0") + +./ghdl.sh +./yosys.sh + +./nextpnr--ecp5.sh +./prjtrellis.sh diff --git a/test/impl.sh b/test/impl.sh index 9dc0e86a..a1b58fa1 100755 --- a/test/impl.sh +++ b/test/impl.sh @@ -2,8 +2,10 @@ # Authors: # Unai Martinez-Corral +# Sebastian Birke # # Copyright 2020-2021 Unai Martinez-Corral +# Copyright 2021 Sebastian Birke # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,7 +31,11 @@ cd $(dirname "$0") ./smoke-tests/nextpnr.sh ./smoke-tests/yosys.sh -ghdl --version -yosys --version +./ghdl.sh +./yosys.sh -./_todo.sh +./nextpnr--ice40.sh +./icestorm.sh + +./nextpnr--ecp5.sh +./prjtrellis.sh diff --git a/test/nextpnr--ecp5.sh b/test/nextpnr--ecp5.sh index d9604cbd..ecd7e454 100755 --- a/test/nextpnr--ecp5.sh +++ b/test/nextpnr--ecp5.sh @@ -27,4 +27,6 @@ cd $(dirname "$0") ./smoke-tests/nextpnr-ecp5.sh +nextpnr-ecp5 --version + ./_todo.sh diff --git a/test/nextpnr--ice40.sh b/test/nextpnr--ice40.sh index 27584ede..4bb430ea 100755 --- a/test/nextpnr--ice40.sh +++ b/test/nextpnr--ice40.sh @@ -27,4 +27,6 @@ cd $(dirname "$0") ./smoke-tests/nextpnr-ice40.sh +nextpnr-ice40 --version + ./_todo.sh diff --git a/test/nextpnr-all.pkg.sh b/test/nextpnr-all.pkg.sh new file mode 100755 index 00000000..8b18884b --- /dev/null +++ b/test/nextpnr-all.pkg.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +# Authors: +# Sebastian Birke +# +# Copyright 2020-2021 Unai Martinez-Corral +# Copyright 2020-2021 Sebastian Birke +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +set -e + +cd $(dirname "$0") + +./_tree.sh + +./_todo.sh diff --git a/test/nextpnr-ecp5.pkg.sh b/test/nextpnr-ecp5.pkg.sh new file mode 100755 index 00000000..dab13cd6 --- /dev/null +++ b/test/nextpnr-ecp5.pkg.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +# Authors: +# Sebastian Birke +# +# Copyright 2020-2021 Unai Martinez-Corral +# Copyright 2020-2021 Sebastian Birke +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +set -e + +cd $(dirname "$0") + +./_tree.sh + +file /usr/local/bin/nextpnr-ecp5 + +./_todo.sh diff --git a/test/nextpnr-ice40.pkg.sh b/test/nextpnr-ice40.pkg.sh new file mode 100755 index 00000000..6a218434 --- /dev/null +++ b/test/nextpnr-ice40.pkg.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +# Authors: +# Sebastian Birke +# +# Copyright 2020-2021 Unai Martinez-Corral +# Copyright 2020-2021 Sebastian Birke +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +set -e + +cd $(dirname "$0") + +./_tree.sh + +file /usr/local/bin/nextpnr-ice40 + +./_todo.sh diff --git a/test/nextpnr.sh b/test/nextpnr.sh index fb8af3ec..fccc5475 100755 --- a/test/nextpnr.sh +++ b/test/nextpnr.sh @@ -27,4 +27,7 @@ cd $(dirname "$0") ./smoke-tests/nextpnr.sh +nextpnr-ecp5 --version +nextpnr-ice40 --version + ./_todo.sh diff --git a/test/prjtrellis.sh b/test/prjtrellis.sh index 415b7b41..cad60bdc 100755 --- a/test/prjtrellis.sh +++ b/test/prjtrellis.sh @@ -27,4 +27,6 @@ cd $(dirname "$0") ./smoke-tests/prjtrellis.sh +ecppack --version + ./_todo.sh diff --git a/yosys.dockerfile b/yosys.dockerfile index f731df1f..fda3804e 100644 --- a/yosys.dockerfile +++ b/yosys.dockerfile @@ -39,15 +39,14 @@ RUN apt-get update -qq \ flex \ gawk \ gcc \ - git \ iverilog \ pkg-config \ zlib1g-dev \ && apt-get autoclean && apt-get clean && apt-get -y autoremove \ && rm -rf /var/lib/apt/lists/* -RUN mkdir /tmp/yosys && cd /tmp/yosys \ - && curl -fsSL https://codeload.github.com/YosysHQ/yosys/tar.gz/master | tar xzf - --strip-components=1 \ +RUN git clone https://github.com/YosysHQ/yosys.git /tmp/yosys \ + && cd /tmp/yosys \ && make -j $(nproc) \ && make DESTDIR=/opt/yosys install \ && make test