From 44339859f1abfd650ff51de57070eb280228209a Mon Sep 17 00:00:00 2001 From: Lucas Teske Date: Thu, 14 Jan 2021 00:45:07 -0300 Subject: [PATCH] add: gowin nextpnr build --- .github/workflows/nextpnr.yml | 2 ++ nextpnr.dockerfile | 27 +++++++++++++++++++++++++++ test/nextpnr--gowin.sh | 31 +++++++++++++++++++++++++++++++ test/smoke-tests | 2 +- 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100755 test/nextpnr--gowin.sh diff --git a/.github/workflows/nextpnr.yml b/.github/workflows/nextpnr.yml index 1fa570d07..da3d47a8b 100644 --- a/.github/workflows/nextpnr.yml +++ b/.github/workflows/nextpnr.yml @@ -46,12 +46,14 @@ jobs: - run: dockerBuild nextpnr:ice40 nextpnr ice40 - run: dockerBuild nextpnr:icestorm nextpnr icestorm - run: dockerBuild nextpnr:ecp5 nextpnr ecp5 + - run: dockerBuild nextpnr:gowin nextpnr gowin - run: dockerBuild nextpnr:prjtrellis nextpnr prjtrellis - run: dockerBuild nextpnr nextpnr - run: dockerTest nextpnr:ice40 - run: dockerTest nextpnr:icestorm - run: dockerTest nextpnr:ecp5 + - run: dockerTest nextpnr:gowin - run: dockerTest nextpnr:prjtrellis - run: dockerTest nextpnr diff --git a/nextpnr.dockerfile b/nextpnr.dockerfile index adfe8e4f8..5f2727688 100644 --- a/nextpnr.dockerfile +++ b/nextpnr.dockerfile @@ -106,6 +106,33 @@ RUN cd /tmp/nextpnr/build \ && make -j $(nproc) \ && make DESTDIR=/opt/nextpnr install + +#--- + +FROM build AS build-gowin +RUN mkdir -p /tmp/nextpnr/build \ + && apt-get update -qq \ + && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends python3-setuptools python3-pip \ + && pip3 install apycula \ + && 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 +RUN apt-get update -qq \ + && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends python3-setuptools python3-pip \ + && pip3 install apycula +COPY --from=build-gowin /opt/nextpnr / + #--- FROM base AS all diff --git a/test/nextpnr--gowin.sh b/test/nextpnr--gowin.sh new file mode 100755 index 000000000..4fc631f8e --- /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 0f9128967..621c29489 160000 --- a/test/smoke-tests +++ b/test/smoke-tests @@ -1 +1 @@ -Subproject commit 0f912896788faa36db6959fae205a6156c56b454 +Subproject commit 621c29489ab97a47c95293100883bbb2ab7c9d89