Skip to content

Commit

Permalink
add: gowin nextpnr build
Browse files Browse the repository at this point in the history
  • Loading branch information
racerxdl committed Jan 14, 2021
1 parent 63b9a3a commit 4433985
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/nextpnr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
27 changes: 27 additions & 0 deletions nextpnr.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 31 additions & 0 deletions test/nextpnr--gowin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env sh

# Authors:
# Unai Martinez-Corral
# Lucas Teske
#
# Copyright 2020-2021 Unai Martinez-Corral <[email protected]>
#
# 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
2 changes: 1 addition & 1 deletion test/smoke-tests

0 comments on commit 4433985

Please sign in to comment.