Skip to content

Commit

Permalink
nextpnr: Restructure a bit and add pkg images
Browse files Browse the repository at this point in the history
  • Loading branch information
se-bi committed Jan 17, 2021
1 parent 100b94c commit a9dbd8c
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 8 deletions.
31 changes: 26 additions & 5 deletions .github/workflows/nextpnr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Authors:
# Sebastian Birke <[email protected]>
# Unai Martinez-Corral
#
# Copyright 2019-2021 Unai Martinez-Corral <[email protected]>
Expand Down Expand Up @@ -43,16 +44,24 @@ jobs:

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

- run: dockerBuild nextpnr:ice40 nextpnr ice40
- run: dockerBuild nextpnr:icestorm nextpnr icestorm
- run: dockerBuild nextpnr:ecp5 nextpnr ecp5
- run: dockerBuild nextpnr:prjtrellis nextpnr prjtrellis
- run: dockerBuild nextpnr nextpnr
- run: dockerBuild pkg:nextpnr-ice40 nextpnr pkg-ice40
- run: dockerBuild nextpnr:ice40 nextpnr ice40
- run: dockerBuild nextpnr:icestorm nextpnr icestorm
- run: dockerBuild pkg:nextpnr-ecp5 nextpnr pkg-ecp5
- run: dockerBuild nextpnr:ecp5 nextpnr ecp5
- run: dockerBuild nextpnr:prjtrellis nextpnr prjtrellis
- run: dockerBuild pkg:nextpnr-generic nextpnr pkg-generic
- run: dockerBuild nextpnr:generic nextpnr generic
- run: dockerBuild nextpnr nextpnr

- run: dockerTestPkg nextpnr-ice40
- run: dockerTest nextpnr:ice40
- run: dockerTest nextpnr:icestorm
- run: dockerTestPkg nextpnr-ecp5
- run: dockerTest nextpnr:ecp5
- run: dockerTest nextpnr:prjtrellis
- run: dockerTestPkg nextpnr-generic
- run: dockerTest nextpnr:generic
- run: dockerTest nextpnr

- name: Login to DockerHub
Expand All @@ -62,17 +71,29 @@ jobs:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}

- run: dockerPush pkg:nextpnr-ice40
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'

- run: dockerPush nextpnr:ice40
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'

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

- run: dockerPush pkg:nextpnr-ecp5
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'

- run: dockerPush nextpnr:ecp5
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'

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

- run: dockerPush pkg:nextpnr-generic
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'

- run: dockerPush nextpnr:generic
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'

- run: dockerPush nextpnr
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'
28 changes: 25 additions & 3 deletions nextpnr.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ COPY --from=hdlc/pkg:icestorm /icestorm /

#---

FROM scratch AS pkg-ice40
COPY --from=build-ice40 /opt/nextpnr /nextpnr-ice40

#---

FROM build AS build-ecp5
COPY --from=hdlc/pkg:prjtrellis /prjtrellis /

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

#---

FROM build-ice40 AS build-all
FROM scratch AS pkg-ecp5
COPY --from=build-ecp5 /opt/nextpnr /nextpnr-ecp5

#---

FROM build-ice40 AS build-generic
COPY --from=hdlc/pkg:prjtrellis /prjtrellis /

RUN cd /tmp/nextpnr/build \
&& cmake .. \
-DARCH=all \
-DARCH=generic \
-DBUILD_GUI=OFF \
-DBUILD_PYTHON=ON \
-DUSE_OPENMP=ON \
Expand All @@ -105,5 +115,17 @@ RUN cd /tmp/nextpnr/build \

#---

FROM base AS generic
COPY --from=build-generic /opt/nextpnr /

#---

FROM scratch AS pkg-generic
COPY --from=build-generic /opt/nextpnr /nextpnr-generic

#---

FROM base AS all
COPY --from=build-all /opt/nextpnr /
COPY --from=build-ice40 /opt/nextpnr /
COPY --from=build-ecp5 /opt/nextpnr /
COPY --from=build-generic /opt/nextpnr /
31 changes: 31 additions & 0 deletions test/nextpnr--generic.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env sh

# Authors:
# Sebastian Birke <[email protected]>
# Unai Martinez-Corral
#
# 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-generic.sh

./_todo.sh
31 changes: 31 additions & 0 deletions test/nextpnr-ecp5.pkg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

# Authors:
# Sebastian Birke <[email protected]>
# Unai Martinez-Corral
#
# 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")

./_tree.sh

file /usr/local/bin/nextpnr-ecp5

./_todo.sh
31 changes: 31 additions & 0 deletions test/nextpnr-generic.pkg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

# Authors:
# Sebastian Birke <[email protected]>
# Unai Martinez-Corral
#
# 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")

./_tree.sh

file /usr/local/bin/nextpnr-generic

./_todo.sh
31 changes: 31 additions & 0 deletions test/nextpnr-ice40.pkg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

# Authors:
# Sebastian Birke <[email protected]>
# Unai Martinez-Corral
#
# 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")

./_tree.sh

file /usr/local/bin/nextpnr-ice40

./_todo.sh

0 comments on commit a9dbd8c

Please sign in to comment.