Skip to content

Commit 14d8e66

Browse files
committed
add: gowin nextpnr build
1 parent 63b9a3a commit 14d8e66

File tree

4 files changed

+65
-1
lines changed

4 files changed

+65
-1
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: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,38 @@ COPY --from=build-ecp5 /opt/nextpnr /
9292
FROM ecp5 AS prjtrellis
9393
COPY --from=hdlc/pkg:prjtrellis /prjtrellis /
9494

95+
#---
96+
97+
FROM build AS build-gowin
98+
RUN mkdir -p /tmp/nextpnr/build \
99+
&& apt-get update -qq \
100+
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends python3-setuptools python3-pip \
101+
&& pip3 install apycula \
102+
&& cd /tmp/nextpnr \
103+
&& curl -fsSL https://codeload.github.com/YosysHQ/nextpnr/tar.gz/master | tar xzf - --strip-components=1 \
104+
&& cd build \
105+
&& cmake .. \
106+
-DARCH=gowin \
107+
-DBUILD_GUI=OFF \
108+
-DBUILD_PYTHON=ON \
109+
-DUSE_OPENMP=ON \
110+
&& make -j $(nproc) \
111+
&& make DESTDIR=/opt/nextpnr install
112+
113+
#---
114+
115+
FROM base AS gowin
116+
RUN apt-get update -qq \
117+
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends python3-setuptools python3-pip \
118+
&& pip3 install apycula
119+
COPY --from=build-gowin /opt/nextpnr /
120+
121+
95122
#---
96123

97124
FROM build-ice40 AS build-all
98125
COPY --from=hdlc/pkg:prjtrellis /prjtrellis /
126+
COPY --from=build-gowin /opt/nextpnr /
99127

100128
RUN cd /tmp/nextpnr/build \
101129
&& cmake .. \
@@ -110,3 +138,6 @@ RUN cd /tmp/nextpnr/build \
110138

111139
FROM base AS all
112140
COPY --from=build-all /opt/nextpnr /
141+
RUN apt-get update -qq \
142+
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends python3-setuptools python3-pip \
143+
&& pip3 install apycula

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)