-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add: gowin nextpnr build #10
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Authors: | ||
# Unai Martinez-Corral | ||
# Lucas Teske | ||
# | ||
# Copyright 2019-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 | ||
|
||
name: 'apicula' | ||
|
||
on: | ||
pull_request: | ||
push: | ||
schedule: | ||
- cron: '0 0 * * 5' | ||
workflow_dispatch: | ||
repository_dispatch: | ||
types: [ apicula ] | ||
|
||
env: | ||
DOCKER_BUILDKIT: 1 | ||
|
||
jobs: | ||
|
||
apicula: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- run: echo "$(pwd)/.github/bin" >> $GITHUB_PATH | ||
|
||
- run: dockerBuild pkg:apicula apicula pkg | ||
- run: dockerBuild apicula apicula | ||
|
||
- run: dockerTestPkg apicula | ||
- run: dockerTest apicula | ||
|
||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USER }} | ||
password: ${{ secrets.DOCKER_PASS }} | ||
|
||
- run: dockerPush pkg:apicula | ||
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' | ||
|
||
- run: dockerPush apicula | ||
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Authors: | ||
# Unai Martinez-Corral | ||
# Lucas Teske | ||
# | ||
# Copyright 2019-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 | ||
|
||
FROM hdlc/build:build AS build | ||
|
||
RUN apt-get update -qq \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends python3-setuptools python3-pip | ||
|
||
RUN mkdir /tmp/apicula \ | ||
&& cd /tmp/apicula \ | ||
&& pip3 install apycula --target /tmp/apicula | ||
|
||
#--- | ||
|
||
FROM scratch AS pkg | ||
COPY --from=build /tmp/apicula /apicula | ||
|
||
#--- | ||
|
||
FROM hdlc/build:base | ||
RUN apt-get update -qq \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends python3-setuptools python3-pip \ | ||
&& pip3 install apycula |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,14 +92,43 @@ COPY --from=build-ecp5 /opt/nextpnr / | |
FROM ecp5 AS prjtrellis | ||
COPY --from=hdlc/pkg:prjtrellis /prjtrellis / | ||
|
||
|
||
#--- | ||
|
||
FROM build-ice40 AS build-all | ||
COPY --from=hdlc/pkg:prjtrellis /prjtrellis / | ||
FROM build AS build-gowin | ||
COPY --from=hdlc/apicula /usr/local/bin/gowin* /usr/local/bin | ||
COPY --from=hdlc/apicula /usr/local/lib/python3.7/dist-packages /usr/local/lib/python3.7/dist-packages | ||
|
||
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 \ | ||
&& cmake .. \ | ||
-DARCH=gowin \ | ||
-DBUILD_GUI=OFF \ | ||
-DBUILD_PYTHON=ON \ | ||
-DUSE_OPENMP=ON \ | ||
&& make -j $(nproc) \ | ||
&& make DESTDIR=/opt/nextpnr install | ||
|
||
#--- | ||
|
||
FROM base AS gowin | ||
COPY --from=build-gowin /opt/nextpnr / | ||
|
||
#--- | ||
|
||
FROM gowin AS apicula | ||
COPY --from=hdlc/apicula /usr/local/bin/gowin* /usr/local/bin | ||
COPY --from=hdlc/apicula /usr/local/lib/python3.7/dist-packages /usr/local/lib/python3.7/dist-packages | ||
|
||
#--- | ||
|
||
FROM build AS build-generic | ||
|
||
RUN cd /tmp/nextpnr/build \ | ||
&& cmake .. \ | ||
-DARCH=all \ | ||
-DARCH=generic \ | ||
-DBUILD_GUI=OFF \ | ||
-DBUILD_PYTHON=ON \ | ||
-DUSE_OPENMP=ON \ | ||
|
@@ -109,4 +138,7 @@ RUN cd /tmp/nextpnr/build \ | |
#--- | ||
|
||
FROM base AS all | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This last "all" stage should include all #---
FROM build AS build-all
RUN cd /tmp/nextpnr/build \
&& cmake .. \
-DARCH=generic \
-DBUILD_GUI=OFF \
-DBUILD_PYTHON=ON \
-DUSE_OPENMP=ON \
&& make -j $(nproc) \
&& make DESTDIR=/opt/nextpnr install
#---
FROM base AS all
COPY --from=build-ice40 /opt/nextpnr /
COPY --from=build-ecp5 /opt/nextpnr /
COPY --from=build-gowin /opt/nextpnr /
COPY --from=build-generic /opt/nextpnr / Note that this last image does not include icestorm, prjtrellis or apicula/apycula. We can later add another image for that, on top of this stage. But I think it's better to handle that after this PR is done. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
COPY --from=build-all /opt/nextpnr / | ||
COPY --from=build-ice40 /opt/nextpnr / | ||
COPY --from=build-ecp5 /opt/nextpnr / | ||
COPY --from=build-gowin /opt/nextpnr / | ||
COPY --from=build-generic /opt/nextpnr / |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh | ||
|
||
# Authors: | ||
# 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 | ||
|
||
./_todo.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env sh | ||
|
||
# Authors: | ||
# 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/apicula.sh | ||
|
||
./_todo.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env sh | ||
|
||
# Authors: | ||
# Unai Martinez-Corral | ||
# Lucas Teske | ||
# | ||
# 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-gowin.sh | ||
|
||
./_todo.sh |
+0 −41 | CONTEXT.md | |
+36 −27 | README.md | |
+2 −0 | all.sh | |
+9 −0 | icesprog.sh | |
+9 −0 | iverilog.sh | |
+9 −0 | nextpnr-gowin.sh | |
+1 −0 | nextpnr.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be two stages here:
and
The first one would contain artifacts of nextpnr-gowin only; and the second one would include apicula/apycula too.