diff --git a/.github/workflows/apicula.yml b/.github/workflows/apicula.yml new file mode 100644 index 00000000..1f813299 --- /dev/null +++ b/.github/workflows/apicula.yml @@ -0,0 +1,64 @@ +# Authors: +# Unai Martinez-Corral +# Lucas Teske +# +# Copyright 2019-2021 Unai Martinez-Corral +# +# 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 + +name: 'apicula' + +on: + pull_request: + push: + schedule: + - cron: '0 0 * * 5' + workflow_dispatch: + repository_dispatch: + types: [ apicula ] + +env: + DOCKER_BUILDKIT: 1 + +jobs: + + apicula: + runs-on: ubuntu-latest + steps: + + - uses: actions/checkout@v2 + with: + submodules: recursive + + - run: echo "$(pwd)/.github/bin" >> $GITHUB_PATH + + - run: dockerBuild pkg:apicula apicula pkg + - run: dockerBuild apicula apicula + + - run: dockerTestPkg apicula + - run: dockerTest apicula + + - name: Login to DockerHub + if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_PASS }} + + - run: dockerPush pkg:apicula + if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' + + - run: dockerPush apicula + if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' diff --git a/.github/workflows/nextpnr.yml b/.github/workflows/nextpnr.yml index 1fa570d0..a34629fe 100644 --- a/.github/workflows/nextpnr.yml +++ b/.github/workflows/nextpnr.yml @@ -47,12 +47,15 @@ jobs: - run: dockerBuild nextpnr:icestorm nextpnr icestorm - run: dockerBuild nextpnr:ecp5 nextpnr ecp5 - run: dockerBuild nextpnr:prjtrellis nextpnr prjtrellis + - run: dockerBuild nextpnr:gowin nextpnr gowin + - run: dockerBuild nextpnr:apicula nextpnr apicula - run: dockerBuild nextpnr nextpnr - run: dockerTest nextpnr:ice40 - run: dockerTest nextpnr:icestorm - run: dockerTest nextpnr:ecp5 - run: dockerTest nextpnr:prjtrellis + - run: dockerTest nextpnr:gowin - run: dockerTest nextpnr - name: Login to DockerHub @@ -74,5 +77,8 @@ jobs: - run: dockerPush nextpnr:prjtrellis if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' + - run: dockerPush nextpnr:gowin + if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' + - run: dockerPush nextpnr if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' diff --git a/apicula.dockerfile b/apicula.dockerfile new file mode 100644 index 00000000..db0a1046 --- /dev/null +++ b/apicula.dockerfile @@ -0,0 +1,40 @@ +# Authors: +# Unai Martinez-Corral +# Lucas Teske +# +# Copyright 2019-2021 Unai Martinez-Corral +# +# 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 + +FROM hdlc/build:build AS build + +RUN apt-get update -qq \ + && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends python3-setuptools python3-pip + +RUN mkdir /tmp/apicula \ + && cd /tmp/apicula \ + && pip3 install apycula --target /tmp/apicula + +#--- + +FROM scratch AS pkg +COPY --from=build /tmp/apicula /apicula + +#--- + +FROM hdlc/build:base +RUN apt-get update -qq \ + && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends python3-setuptools python3-pip \ + && pip3 install apycula diff --git a/nextpnr.dockerfile b/nextpnr.dockerfile index adfe8e4f..52096231 100644 --- a/nextpnr.dockerfile +++ b/nextpnr.dockerfile @@ -92,14 +92,43 @@ COPY --from=build-ecp5 /opt/nextpnr / FROM ecp5 AS prjtrellis COPY --from=hdlc/pkg:prjtrellis /prjtrellis / + #--- -FROM build-ice40 AS build-all -COPY --from=hdlc/pkg:prjtrellis /prjtrellis / +FROM build AS build-gowin +COPY --from=hdlc/apicula /usr/local/bin/gowin* /usr/local/bin +COPY --from=hdlc/apicula /usr/local/lib/python3.7/dist-packages /usr/local/lib/python3.7/dist-packages + +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 \ + && cmake .. \ + -DARCH=gowin \ + -DBUILD_GUI=OFF \ + -DBUILD_PYTHON=ON \ + -DUSE_OPENMP=ON \ + && make -j $(nproc) \ + && make DESTDIR=/opt/nextpnr install + +#--- + +FROM base AS gowin +COPY --from=build-gowin /opt/nextpnr / + +#--- + +FROM gowin AS apicula +COPY --from=hdlc/apicula /usr/local/bin/gowin* /usr/local/bin +COPY --from=hdlc/apicula /usr/local/lib/python3.7/dist-packages /usr/local/lib/python3.7/dist-packages + +#--- + +FROM build AS build-generic RUN cd /tmp/nextpnr/build \ && cmake .. \ - -DARCH=all \ + -DARCH=generic \ -DBUILD_GUI=OFF \ -DBUILD_PYTHON=ON \ -DUSE_OPENMP=ON \ @@ -109,4 +138,7 @@ RUN cd /tmp/nextpnr/build \ #--- FROM base AS all -COPY --from=build-all /opt/nextpnr / +COPY --from=build-ice40 /opt/nextpnr / +COPY --from=build-ecp5 /opt/nextpnr / +COPY --from=build-gowin /opt/nextpnr / +COPY --from=build-generic /opt/nextpnr / diff --git a/test/apicula.pkg.sh b/test/apicula.pkg.sh new file mode 100755 index 00000000..b9b22d14 --- /dev/null +++ b/test/apicula.pkg.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +# Authors: +# Unai Martinez-Corral +# +# Copyright 2020-2021 Unai Martinez-Corral +# +# 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/apicula.sh b/test/apicula.sh new file mode 100755 index 00000000..b7fbf0a0 --- /dev/null +++ b/test/apicula.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env sh + +# Authors: +# Unai Martinez-Corral +# +# Copyright 2020-2021 Unai Martinez-Corral +# +# 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") + +./_env.sh + +./smoke-tests/apicula.sh + +./_todo.sh diff --git a/test/nextpnr--gowin.sh b/test/nextpnr--gowin.sh new file mode 100755 index 00000000..4fc631f8 --- /dev/null +++ b/test/nextpnr--gowin.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env sh + +# Authors: +# Unai Martinez-Corral +# Lucas Teske +# +# Copyright 2020-2021 Unai Martinez-Corral +# +# 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") + +./_env.sh + +./smoke-tests/nextpnr-gowin.sh + +./_todo.sh diff --git a/test/smoke-tests b/test/smoke-tests index 0f912896..d9c45d81 160000 --- a/test/smoke-tests +++ b/test/smoke-tests @@ -1 +1 @@ -Subproject commit 0f912896788faa36db6959fae205a6156c56b454 +Subproject commit d9c45d8151cf9539ace0adfddb61fc3f8a3eed1d