Skip to content

Commit d450fe3

Browse files
committed
nextpnr: Restructure a bit and add pkg images
1 parent 100b94c commit d450fe3

File tree

6 files changed

+175
-8
lines changed

6 files changed

+175
-8
lines changed

.github/workflows/nextpnr.yml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Authors:
2+
# Sebastian Birke <[email protected]>
23
# Unai Martinez-Corral
34
#
45
# Copyright 2019-2021 Unai Martinez-Corral <[email protected]>
@@ -43,16 +44,24 @@ jobs:
4344

4445
- run: echo "$(pwd)/.github/bin" >> $GITHUB_PATH
4546

46-
- run: dockerBuild nextpnr:ice40 nextpnr ice40
47-
- run: dockerBuild nextpnr:icestorm nextpnr icestorm
48-
- run: dockerBuild nextpnr:ecp5 nextpnr ecp5
49-
- run: dockerBuild nextpnr:prjtrellis nextpnr prjtrellis
50-
- run: dockerBuild nextpnr nextpnr
47+
- run: dockerBuild pkg:nextpnr-ice40 nextpnr pkg-ice40
48+
- run: dockerBuild nextpnr:ice40 nextpnr ice40
49+
- run: dockerBuild nextpnr:icestorm nextpnr icestorm
50+
- run: dockerBuild pkg:nextpnr-ecp5 nextpnr pkg-ecp5
51+
- run: dockerBuild nextpnr:ecp5 nextpnr ecp5
52+
- run: dockerBuild nextpnr:prjtrellis nextpnr prjtrellis
53+
- run: dockerBuild pkg:nextpnr-generic nextpnr pkg-generic
54+
- run: dockerBuild nextpnr:generic nextpnr generic
55+
- run: dockerBuild nextpnr nextpnr
5156

57+
- run: dockerTestPkg nextpnr-ice40
5258
- run: dockerTest nextpnr:ice40
5359
- run: dockerTest nextpnr:icestorm
60+
- run: dockerTestPkg nextpnr-ecp5
5461
- run: dockerTest nextpnr:ecp5
5562
- run: dockerTest nextpnr:prjtrellis
63+
- run: dockerTestPkg nextpnr-generic
64+
- run: dockerTest nextpnr:generic
5665
- run: dockerTest nextpnr
5766

5867
- name: Login to DockerHub
@@ -62,17 +71,29 @@ jobs:
6271
username: ${{ secrets.DOCKER_USER }}
6372
password: ${{ secrets.DOCKER_PASS }}
6473

74+
- run: dockerPush pkg:nextpnr-ice40
75+
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'
76+
6577
- run: dockerPush nextpnr:ice40
6678
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'
6779

6880
- run: dockerPush nextpnr:icestorm
6981
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'
7082

83+
- run: dockerPush pkg:nextpnr-ecp5
84+
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'
85+
7186
- run: dockerPush nextpnr:ecp5
7287
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'
7388

7489
- run: dockerPush nextpnr:prjtrellis
7590
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'
7691

92+
- run: dockerPush pkg:nextpnr-generic
93+
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'
94+
95+
- run: dockerPush nextpnr:generic
96+
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'
97+
7798
- run: dockerPush nextpnr
7899
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'

nextpnr.dockerfile

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ COPY --from=hdlc/pkg:icestorm /icestorm /
6767

6868
#---
6969

70+
FROM scratch AS pkg-ice40
71+
COPY --from=build-ice40 /opt/nextpnr /nextpnr-ice40
72+
73+
#---
74+
7075
FROM build AS build-ecp5
7176
COPY --from=hdlc/pkg:prjtrellis /prjtrellis /
7277

@@ -91,12 +96,17 @@ COPY --from=hdlc/pkg:prjtrellis /prjtrellis /
9196

9297
#---
9398

94-
FROM build-ice40 AS build-all
99+
FROM scratch AS pkg-ecp5
100+
COPY --from=build-ecp5 /opt/nextpnr /nextpnr-ecp5
101+
102+
#---
103+
104+
FROM build-ice40 AS build-generic
95105
COPY --from=hdlc/pkg:prjtrellis /prjtrellis /
96106

97107
RUN cd /tmp/nextpnr/build \
98108
&& cmake .. \
99-
-DARCH=all \
109+
-DARCH=generic \
100110
-DBUILD_GUI=OFF \
101111
-DBUILD_PYTHON=ON \
102112
-DUSE_OPENMP=ON \
@@ -105,5 +115,17 @@ RUN cd /tmp/nextpnr/build \
105115

106116
#---
107117

118+
FROM base AS generic
119+
COPY --from=build-generic /opt/nextpnr /
120+
121+
#---
122+
123+
FROM scratch AS pkg-generic
124+
COPY --from=build-generic /opt/nextpnr /nextpnr-generic
125+
126+
#---
127+
108128
FROM base AS all
109-
COPY --from=build-all /opt/nextpnr /
129+
COPY --from=build-ice40 /opt/nextpnr /
130+
COPY --from=build-ecp5 /opt/nextpnr /
131+
COPY --from=build-generic /opt/nextpnr /

test/nextpnr--generic.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+
# Sebastian Birke <[email protected]>
5+
# Unai Martinez-Corral
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-generic.sh
30+
31+
./_todo.sh

test/nextpnr-ecp5.pkg.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
3+
# Authors:
4+
# Sebastian Birke <[email protected]>
5+
# Unai Martinez-Corral
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+
./_tree.sh
28+
29+
file /usr/local/bin/nextpnr-ecp5
30+
31+
./_todo.sh

test/nextpnr-generic.pkg.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
3+
# Authors:
4+
# Sebastian Birke <[email protected]>
5+
# Unai Martinez-Corral
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+
./_tree.sh
28+
29+
file /usr/local/bin/nextpnr-generic
30+
31+
./_todo.sh

test/nextpnr-ice40.pkg.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
3+
# Authors:
4+
# Sebastian Birke <[email protected]>
5+
# Unai Martinez-Corral
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+
./_tree.sh
28+
29+
file /usr/local/bin/nextpnr-ice40
30+
31+
./_todo.sh

0 commit comments

Comments
 (0)