Skip to content

Commit ee90e38

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

File tree

8 files changed

+236
-5
lines changed

8 files changed

+236
-5
lines changed

Diff for: .github/workflows/apicula.yml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Authors:
2+
# Unai Martinez-Corral
3+
# Lucas Teske
4+
#
5+
# Copyright 2019-2021 Unai Martinez-Corral <[email protected]>
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
# SPDX-License-Identifier: Apache-2.0
20+
21+
name: 'apicula'
22+
23+
on:
24+
pull_request:
25+
push:
26+
schedule:
27+
- cron: '0 0 * * 5'
28+
workflow_dispatch:
29+
repository_dispatch:
30+
types: [ apicula ]
31+
32+
env:
33+
DOCKER_BUILDKIT: 1
34+
35+
jobs:
36+
37+
apicula:
38+
runs-on: ubuntu-latest
39+
steps:
40+
41+
- uses: actions/checkout@v2
42+
with:
43+
submodules: recursive
44+
45+
- run: echo "$(pwd)/.github/bin" >> $GITHUB_PATH
46+
47+
- run: dockerBuild pkg:apicula apicula pkg
48+
- run: dockerBuild apicula apicula
49+
50+
- run: dockerTestPkg apicula
51+
- run: dockerTest apicula
52+
53+
- name: Login to DockerHub
54+
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'
55+
uses: docker/login-action@v1
56+
with:
57+
username: ${{ secrets.DOCKER_USER }}
58+
password: ${{ secrets.DOCKER_PASS }}
59+
60+
- run: dockerPush pkg:apicula
61+
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'
62+
63+
- run: dockerPush apicula
64+
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'

Diff for: .github/workflows/nextpnr.yml

+6
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,15 @@ jobs:
4747
- run: dockerBuild nextpnr:icestorm nextpnr icestorm
4848
- run: dockerBuild nextpnr:ecp5 nextpnr ecp5
4949
- run: dockerBuild nextpnr:prjtrellis nextpnr prjtrellis
50+
- run: dockerBuild nextpnr:gowin nextpnr gowin
51+
- run: dockerBuild nextpnr:apicula nextpnr apicula
5052
- run: dockerBuild nextpnr nextpnr
5153

5254
- run: dockerTest nextpnr:ice40
5355
- run: dockerTest nextpnr:icestorm
5456
- run: dockerTest nextpnr:ecp5
5557
- run: dockerTest nextpnr:prjtrellis
58+
- run: dockerTest nextpnr:gowin
5659
- run: dockerTest nextpnr
5760

5861
- name: Login to DockerHub
@@ -74,5 +77,8 @@ jobs:
7477
- run: dockerPush nextpnr:prjtrellis
7578
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'
7679

80+
- run: dockerPush nextpnr:gowin
81+
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'
82+
7783
- run: dockerPush nextpnr
7884
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'

Diff for: apicula.dockerfile

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Authors:
2+
# Unai Martinez-Corral
3+
# Lucas Teske
4+
#
5+
# Copyright 2019-2021 Unai Martinez-Corral <[email protected]>
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
# SPDX-License-Identifier: Apache-2.0
20+
21+
FROM hdlc/build:build AS build
22+
23+
RUN apt-get update -qq \
24+
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends python3-setuptools python3-pip
25+
26+
RUN mkdir /tmp/apicula \
27+
&& cd /tmp/apicula \
28+
&& pip3 install apycula --target /tmp/apicula
29+
30+
#---
31+
32+
FROM scratch AS pkg
33+
COPY --from=build /tmp/apicula /apicula
34+
35+
#---
36+
37+
FROM hdlc/build:base
38+
RUN apt-get update -qq \
39+
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends python3-setuptools python3-pip \
40+
&& pip3 install apycula

Diff for: nextpnr.dockerfile

+36-4
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,43 @@ COPY --from=build-ecp5 /opt/nextpnr /
9292
FROM ecp5 AS prjtrellis
9393
COPY --from=hdlc/pkg:prjtrellis /prjtrellis /
9494

95+
9596
#---
9697

97-
FROM build-ice40 AS build-all
98-
COPY --from=hdlc/pkg:prjtrellis /prjtrellis /
98+
FROM build AS build-gowin
99+
COPY --from=hdlc/apicula /usr/local/bin/gowin* /usr/local/bin
100+
COPY --from=hdlc/apicula /usr/local/lib/python3.7/dist-packages /usr/local/lib/python3.7/dist-packages
101+
102+
RUN mkdir -p /tmp/nextpnr/build \
103+
&& cd /tmp/nextpnr \
104+
&& curl -fsSL https://codeload.github.com/YosysHQ/nextpnr/tar.gz/master | tar xzf - --strip-components=1 \
105+
&& cd build \
106+
&& cmake .. \
107+
-DARCH=gowin \
108+
-DBUILD_GUI=OFF \
109+
-DBUILD_PYTHON=ON \
110+
-DUSE_OPENMP=ON \
111+
&& make -j $(nproc) \
112+
&& make DESTDIR=/opt/nextpnr install
113+
114+
#---
115+
116+
FROM base AS gowin
117+
COPY --from=build-gowin /opt/nextpnr /
118+
119+
#---
120+
121+
FROM gowin AS apicula
122+
COPY --from=hdlc/apicula /usr/local/bin/gowin* /usr/local/bin
123+
COPY --from=hdlc/apicula /usr/local/lib/python3.7/dist-packages /usr/local/lib/python3.7/dist-packages
124+
125+
#---
126+
127+
FROM build AS build-generic
99128

100129
RUN cd /tmp/nextpnr/build \
101130
&& cmake .. \
102-
-DARCH=all \
131+
-DARCH=generic \
103132
-DBUILD_GUI=OFF \
104133
-DBUILD_PYTHON=ON \
105134
-DUSE_OPENMP=ON \
@@ -109,4 +138,7 @@ RUN cd /tmp/nextpnr/build \
109138
#---
110139

111140
FROM base AS all
112-
COPY --from=build-all /opt/nextpnr /
141+
COPY --from=build-ice40 /opt/nextpnr /
142+
COPY --from=build-ecp5 /opt/nextpnr /
143+
COPY --from=build-gowin /opt/nextpnr /
144+
COPY --from=build-generic /opt/nextpnr /

Diff for: test/apicula.pkg.sh

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

Diff for: test/apicula.sh

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

Diff for: test/nextpnr--gowin.sh

+31
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)