Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update impl-image, tests and enable tool version strings #4

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions .github/workflows/impl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Unai Martinez-Corral
#
# Copyright 2019-2021 Unai Martinez-Corral <[email protected]>
# Copyright 2021 Sebastian Birke <[email protected]>
eine marked this conversation as resolved.
Show resolved Hide resolved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -43,9 +44,19 @@ jobs:

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

- run: dockerBuild impl impl
- run: dockerBuild impl:ice40 impl ice40
- run: dockerBuild impl:icestorm impl icestorm
- run: dockerBuild impl:ecp5 impl ecp5
- run: dockerBuild impl:prjtrellis impl prjtrellis
- run: dockerBuild impl:pnr impl pnr
- run: dockerBuild impl:latest impl latest

- run: dockerTest impl
- run: dockerTest impl:ice40 impl--ice40
- run: dockerTest impl:icestorm impl--icestorm
- run: dockerTest impl:ecp5 impl--ecp5
- run: dockerTest impl:prjtrellis impl--prjtrellis
- run: dockerTest impl:pnr impl--pnr
- run: dockerTest impl:latest impl

- name: Login to DockerHub
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'
Expand All @@ -54,5 +65,20 @@ jobs:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}

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

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

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

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

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

- run: dockerPush impl:latest
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'
15 changes: 15 additions & 0 deletions .github/workflows/nextpnr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,16 @@ jobs:

- run: dockerBuild nextpnr:ice40 nextpnr ice40
- run: dockerBuild nextpnr:icestorm nextpnr icestorm
- run: dockerBuild pkg:nextpnr-ice40 nextpnr pkg-ice40
- run: dockerBuild nextpnr:ecp5 nextpnr ecp5
- run: dockerBuild nextpnr:prjtrellis nextpnr prjtrellis
- run: dockerBuild pkg:nextpnr-ecp5 nextpnr pkg-ecp5
- run: dockerBuild pkg:nextpnr-all nextpnr pkg-all
Copy link
Collaborator

@eine eine Jan 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, rename all to generic and make pkg:nextpnr-generic contain that one only. I think we don't need a pkg:nextpnr-all.

- run: dockerBuild nextpnr nextpnr

- run: dockerTestPkg nextpnr-ice40
- run: dockerTestPkg nextpnr-ecp5
- run: dockerTestPkg nextpnr-all
- run: dockerTest nextpnr:ice40
- run: dockerTest nextpnr:icestorm
- run: dockerTest nextpnr:ecp5
Expand All @@ -68,11 +74,20 @@ jobs:
- run: dockerPush nextpnr:icestorm
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'

- run: dockerPush pkg:nextpnr-ice40
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-ecp5
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'

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

- run: dockerPush pkg:nextpnr-all
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'
1 change: 1 addition & 0 deletions base.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ FROM base AS build
RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
clang \
git \
make

ENV CC clang
Expand Down
54 changes: 44 additions & 10 deletions impl.dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Authors:
# Unai Martinez-Corral
# Sebastian Birke
#
# Copyright 2019-2021 Unai Martinez-Corral <[email protected]>
# Copyright 2021 Sebastian Birke <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -17,20 +19,52 @@
#
# SPDX-License-Identifier: Apache-2.0

FROM hdlc/nextpnr
FROM hdlc/ghdl:yosys AS base

COPY --from=hdlc/pkg:ghdl-yosys-plugin /ghdl /
COPY --from=hdlc/pkg:yosys /yosys /

RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
libffi-dev \
libgnat-8 \
libreadline-dev \
tcl-dev \
graphviz \
xdot \
libboost-all-dev \
libomp5-7 \
make \
&& apt-get autoclean && apt-get clean && apt-get -y autoremove \
&& rm -rf /var/lib/apt/lists \
&& yosys-config --exec mkdir -p --datdir/plugins \
&& yosys-config --exec ln -s /usr/local/lib/ghdl_yosys.so --datdir/plugins/ghdl.so
&& rm -rf /var/lib/apt/lists

#---

FROM base AS ice40

COPY --from=hdlc/pkg:nextpnr-ice40 /nextpnr-ice40 /

#---

FROM ice40 AS icestorm

COPY --from=hdlc/pkg:icestorm /icestorm /

#---

FROM base AS ecp5

COPY --from=hdlc/pkg:nextpnr-ecp5 /nextpnr-ecp5 /

#---

FROM ecp5 AS prjtrellis

COPY --from=hdlc/pkg:prjtrellis /prjtrellis /

#---

FROM base AS pnr

COPY --from=hdlc/pkg:nextpnr-all /nextpnr-all /
eine marked this conversation as resolved.
Show resolved Hide resolved

#---

FROM pnr AS latest

COPY --from=hdlc/pkg:icestorm /icestorm /
COPY --from=hdlc/pkg:prjtrellis /prjtrellis /
40 changes: 29 additions & 11 deletions nextpnr.dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Authors:
# Anton Blanchard
# Unai Martinez-Corral
# Sebastian Birke
#
# Copyright 2019-2021 Unai Martinez-Corral <[email protected]>
# Copyright 2021 Sebastian Birke <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -29,7 +31,7 @@ RUN apt-get update -qq \

#---

FROM hdlc/build:dev AS build
FROM hdlc/build:dev AS build-aptrequirements

ENV LDFLAGS "-Wl,--copy-dt-needed-entries"

Expand All @@ -40,13 +42,17 @@ RUN apt-get update -qq \

#---

FROM build AS build-ice40
FROM build-aptrequirements AS build-gitfetch
eine marked this conversation as resolved.
Show resolved Hide resolved

RUN git clone https://github.com/YosysHQ/nextpnr.git /tmp/nextpnr \
&& mkdir /tmp/nextpnr/build/

#---

FROM build-gitfetch AS build-ice40
COPY --from=hdlc/pkg:icestorm /icestorm/usr/local/share/icebox /usr/local/share/icebox

RUN mkdir -p /tmp/nextpnr/build \
&& cd /tmp/nextpnr \
&& curl -fsSL https://codeload.github.com/YosysHQ/nextpnr/tar.gz/master | tar xzf - --strip-components=1 \
&& cd build \
RUN cd /tmp/nextpnr/build \
&& cmake .. \
-DARCH=ice40 \
-DBUILD_GUI=OFF \
Expand All @@ -67,13 +73,15 @@ COPY --from=hdlc/pkg:icestorm /icestorm /

#---

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

#---

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

RUN mkdir -p /tmp/nextpnr/build \
&& cd /tmp/nextpnr \
&& curl -fsSL https://codeload.github.com/YosysHQ/nextpnr/tar.gz/master | tar xzf - --strip-components=1 \
&& cd build \
RUN cd /tmp/nextpnr/build \
&& cmake .. \
-DARCH=ecp5 \
-DBUILD_GUI=OFF \
Expand All @@ -94,6 +102,11 @@ COPY --from=hdlc/pkg:prjtrellis /prjtrellis /

#---

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

#---

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

Expand All @@ -108,5 +121,10 @@ RUN cd /tmp/nextpnr/build \

#---

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

#---

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

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

./ghdl.sh
./yosys.sh
./nextpnr--ecp5.sh
30 changes: 30 additions & 0 deletions test/impl--ice40.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env sh

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

./ghdl.sh
./yosys.sh
./nextpnr--ice40.sh
32 changes: 32 additions & 0 deletions test/impl--icestorm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env sh

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

./ghdl.sh
./yosys.sh

./nextpnr--ice40.sh
./icestorm.sh
32 changes: 32 additions & 0 deletions test/impl--pnr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env sh

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

./ghdl.sh
./yosys.sh

./nextpnr--ecp5.sh
./nextpnr--ice40.sh
Loading