Skip to content

Commit 6a8ceca

Browse files
committed
add: gowin nextpnr build
1 parent 63b9a3a commit 6a8ceca

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

.github/workflows/nextpnr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,14 @@ jobs:
4646
- run: dockerBuild nextpnr:ice40 nextpnr ice40
4747
- run: dockerBuild nextpnr:icestorm nextpnr icestorm
4848
- run: dockerBuild nextpnr:ecp5 nextpnr ecp5
49+
- run: dockerBuild nextpnr:gowin nextpnr gowin
4950
- run: dockerBuild nextpnr:prjtrellis nextpnr prjtrellis
5051
- run: dockerBuild nextpnr nextpnr
5152

5253
- run: dockerTest nextpnr:ice40
5354
- run: dockerTest nextpnr:icestorm
5455
- run: dockerTest nextpnr:ecp5
56+
- run: dockerTest nextpnr:gowin
5557
- run: dockerTest nextpnr:prjtrellis
5658
- run: dockerTest nextpnr
5759

nextpnr.dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,33 @@ RUN cd /tmp/nextpnr/build \
106106
&& make -j $(nproc) \
107107
&& make DESTDIR=/opt/nextpnr install
108108

109+
110+
#---
111+
112+
FROM build AS build-gowin
113+
RUN mkdir -p /tmp/nextpnr/build \
114+
&& apt-get update -qq \
115+
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends python3-setuptools python3-pip \
116+
&& pip3 install apycula \
117+
&& cd /tmp/nextpnr \
118+
&& curl -fsSL https://codeload.github.com/YosysHQ/nextpnr/tar.gz/master | tar xzf - --strip-components=1 \
119+
&& cd build \
120+
&& cmake .. \
121+
-DARCH=gowin \
122+
-DBUILD_GUI=OFF \
123+
-DBUILD_PYTHON=ON \
124+
-DUSE_OPENMP=ON \
125+
&& make -j $(nproc) \
126+
&& make DESTDIR=/opt/nextpnr install
127+
128+
#---
129+
130+
FROM base AS gowin
131+
RUN apt-get update -qq \
132+
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends python3-setuptools python3-pip \
133+
&& pip3 install apycula
134+
COPY --from=build-gowin /opt/nextpnr /
135+
109136
#---
110137

111138
FROM base AS all

test/nextpnr--gowin.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env sh
2+
3+
# Authors:
4+
# Unai Martinez-Corral
5+
# Lucas Teske
6+
#
7+
# Copyright 2020-2021 Unai Martinez-Corral <[email protected]>
8+
#
9+
# Licensed under the Apache License, Version 2.0 (the "License");
10+
# you may not use this file except in compliance with the License.
11+
# You may obtain a copy of the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS,
17+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
# See the License for the specific language governing permissions and
19+
# limitations under the License.
20+
#
21+
# SPDX-License-Identifier: Apache-2.0
22+
23+
set -e
24+
25+
cd $(dirname "$0")
26+
27+
./_env.sh
28+
29+
./smoke-tests/nextpnr-gowin.sh
30+
31+
./_todo.sh

0 commit comments

Comments
 (0)