aboutsummaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2022-04-08 14:05:03 +0100
committergatecat <gatecat@ds0.me>2022-04-08 18:42:39 +0100
commit92a58a2631a30ac3f4c0291ecd1f2f01a912b9e9 (patch)
treeaf4d4919e27a49d01c1c8607c817d07644e22303 /.github
parent49f178ed94b5fad00d25dbd12adea0bf4732f803 (diff)
downloadnextpnr-92a58a2631a30ac3f4c0291ecd1f2f01a912b9e9.tar.gz
nextpnr-92a58a2631a30ac3f4c0291ecd1f2f01a912b9e9.tar.bz2
nextpnr-92a58a2631a30ac3f4c0291ecd1f2f01a912b9e9.zip
ci: Restructure and move entirely to GH actions from Cirrus
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to '.github')
-rw-r--r--.github/ci/build_common.sh55
-rw-r--r--.github/ci/build_ecp5.sh24
-rw-r--r--.github/ci/build_generic.sh25
-rw-r--r--.github/ci/build_gowin.sh23
-rw-r--r--.github/ci/build_ice40.sh27
-rw-r--r--.github/ci/build_machxo2.sh21
-rw-r--r--.github/ci/build_mistral.sh6
-rw-r--r--.github/ci/build_nexus.sh23
-rw-r--r--.github/workflows/arch_ci.yml95
-rw-r--r--.github/workflows/mistral_ci.yml29
10 files changed, 299 insertions, 29 deletions
diff --git a/.github/ci/build_common.sh b/.github/ci/build_common.sh
new file mode 100644
index 00000000..2a2d8447
--- /dev/null
+++ b/.github/ci/build_common.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+# Install latest Yosys
+function build_yosys {
+ PREFIX=`pwd`/.yosys
+ YOSYS_PATH=${DEPS_PATH}/yosys
+ mkdir -p ${YOSYS_PATH}
+ git clone --recursive https://github.com/YosysHQ/yosys ${YOSYS_PATH}
+ pushd ${YOSYS_PATH}
+ git reset --hard ${YOSYS_REVISION}
+ make -j`nproc` PREFIX=$PREFIX
+ make install PREFIX=$PREFIX
+ popd
+}
+
+function build_icestorm {
+ PREFIX=`pwd`/.icestorm
+ ICESTORM_PATH=${DEPS_PATH}/icestorm
+ mkdir -p ${ICESTORM_PATH}
+ git clone --recursive https://github.com/YosysHQ/icestorm ${ICESTORM_PATH}
+ pushd ${ICESTORM_PATH}
+ git reset --hard ${ICESTORM_REVISION}
+ make -j`nproc` PREFIX=${PREFIX}
+ make install PREFIX=${PREFIX}
+ popd
+}
+
+function build_trellis {
+ PREFIX=`pwd`/.trellis
+ TRELLIS_PATH=${DEPS_PATH}/prjtrellis
+ mkdir -p ${TRELLIS_PATH}
+ git clone --recursive https://github.com/YosysHQ/prjtrellis ${TRELLIS_PATH}
+ pushd ${TRELLIS_PATH}
+ git reset --hard ${TRELLIS_REVISION}
+ mkdir -p libtrellis/build
+ pushd libtrellis/build
+ cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} ..
+ make -j`nproc`
+ make install
+ popd
+ popd
+}
+
+function build_prjoxide {
+ PREFIX=`pwd`/.prjoxide
+ PRJOXIDE_PATH=${DEPS_PATH}/prjoxide
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y ;\
+ mkdir -p ${PRJOXIDE_PATH}
+ git clone --recursive https://github.com/gatecat/prjoxide ${PRJOXIDE_PATH}
+ pushd ${PRJOXIDE_PATH}
+ git reset --hard ${PRJOXIDE_REVISION}
+ cd libprjoxide
+ PATH=$PATH:$HOME/.cargo/bin cargo install --root $PREFIX --path prjoxide
+ popd
+}
diff --git a/.github/ci/build_ecp5.sh b/.github/ci/build_ecp5.sh
new file mode 100644
index 00000000..2d09a6f6
--- /dev/null
+++ b/.github/ci/build_ecp5.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+function get_dependencies {
+ :
+}
+
+function build_nextpnr {
+ mkdir build
+ pushd build
+ cmake .. -DARCH=ecp5 -DTRELLIS_INSTALL_PREFIX=${GITHUB_WORKSPACE}/.trellis -DWERROR=on -DBUILD_GUI=on -DUSE_IPO=off
+ make nextpnr-ecp5 -j`nproc`
+ popd
+}
+
+function run_tests {
+ export PATH=${GITHUB_WORKSPACE}/.trellis/bin:${GITHUB_WORKSPACE}/.yosys/bin:$PATH
+ make -j $(nproc) -C tests/ecp5/regressions NPNR=$(pwd)/build/nextpnr-ecp5
+}
+
+function run_archcheck {
+ pushd build
+ ./nextpnr-ecp5 --um5g-25k --package CABGA381 --test
+ popd
+}
diff --git a/.github/ci/build_generic.sh b/.github/ci/build_generic.sh
new file mode 100644
index 00000000..49a73d3a
--- /dev/null
+++ b/.github/ci/build_generic.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+function get_dependencies {
+ :
+}
+
+function build_nextpnr {
+ mkdir build
+ pushd build
+ cmake .. -DARCH=generic -DWERROR=on
+ make nextpnr-generic -j`nproc`
+ popd
+}
+
+function run_tests {
+ export PATH=${GITHUB_WORKSPACE}/.yosys/bin:$PATH
+ ( export NPNR=$(pwd)/build/nextpnr-generic && cd tests/generic/flow && ./run.sh )
+}
+
+function run_archcheck {
+ pushd build
+ # TODO
+ # ./nextpnr-generic --uarch example --test
+ popd
+}
diff --git a/.github/ci/build_gowin.sh b/.github/ci/build_gowin.sh
new file mode 100644
index 00000000..430cd2b0
--- /dev/null
+++ b/.github/ci/build_gowin.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+function get_dependencies {
+ pip3 install apycula==${APYCULA_REVISION}
+}
+
+function build_nextpnr {
+ mkdir build
+ pushd build
+ cmake .. -DARCH=gowin -DWERROR=on -DBUILD_GUI=on -DUSE_IPO=off
+ make nextpnr-gowin -j`nproc`
+ popd
+}
+
+function run_tests {
+ :
+}
+
+function run_archcheck {
+ pushd build
+ ./nextpnr-gowin --device GW1N-UV4LQ144C6/I5 --test
+ popd
+}
diff --git a/.github/ci/build_ice40.sh b/.github/ci/build_ice40.sh
new file mode 100644
index 00000000..ea9234cc
--- /dev/null
+++ b/.github/ci/build_ice40.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+function get_dependencies {
+ :
+}
+
+function build_nextpnr {
+ mkdir build
+ pushd build
+ cmake .. -DARCH=ice40 -DICESTORM_INSTALL_PREFIX=${GITHUB_WORKSPACE}/.icestorm -DWERROR=on -DBUILD_TESTS=on -DBUILD_GUI=on
+ make nextpnr-ice40 nextpnr-ice40-test -j`nproc`
+ popd
+}
+
+function run_tests {
+ export PATH=${GITHUB_WORKSPACE}/.yosys/bin:${GITHUB_WORKSPACE}/.icestorm/bin:$PATH
+ (cd build && ./nextpnr-ice40-test)
+ (export NEXTPNR=$(pwd)/build/nextpnr-ice40 && cd ice40/smoketest/attosoc && ./smoketest.sh)
+ make -j $(nproc) -C tests/ice40/regressions NPNR=$(pwd)/build/nextpnr-ice40
+}
+
+function run_archcheck {
+ pushd build
+ ./nextpnr-ice40 --hx8k --package ct256 --test
+ ./nextpnr-ice40 --up5k --package sg48 --test
+ popd
+}
diff --git a/.github/ci/build_machxo2.sh b/.github/ci/build_machxo2.sh
new file mode 100644
index 00000000..c81a538b
--- /dev/null
+++ b/.github/ci/build_machxo2.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+function get_dependencies {
+ :
+}
+
+function build_nextpnr {
+ mkdir build
+ pushd build
+ cmake .. -DARCH=machxo2 -DTRELLIS_INSTALL_PREFIX=${GITHUB_WORKSPACE}/.trellis -DWERROR=on -DUSE_IPO=off
+ make nextpnr-machxo2 -j`nproc`
+ popd
+}
+
+function run_tests {
+ :
+}
+
+function run_archcheck {
+ :
+}
diff --git a/.github/ci/build_mistral.sh b/.github/ci/build_mistral.sh
index 3c809b0e..807c6206 100644
--- a/.github/ci/build_mistral.sh
+++ b/.github/ci/build_mistral.sh
@@ -1,5 +1,7 @@
#!/bin/bash
+export MISTRAL_PATH=${DEPS_PATH}/mistral
+
function get_dependencies {
# Fetch mistral
mkdir -p ${MISTRAL_PATH}
@@ -17,6 +19,10 @@ function build_nextpnr {
popd
}
+function run_tests {
+ :
+}
+
function run_archcheck {
pushd build
./nextpnr-mistral --device 5CEBA2F17A7 --test
diff --git a/.github/ci/build_nexus.sh b/.github/ci/build_nexus.sh
new file mode 100644
index 00000000..e8acd9b6
--- /dev/null
+++ b/.github/ci/build_nexus.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+function get_dependencies {
+ :
+}
+
+function build_nextpnr {
+ mkdir build
+ pushd build
+ cmake .. -DARCH=nexus -DOXIDE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/.prjoxide
+ make nextpnr-nexus -j`nproc`
+ popd
+}
+
+function run_tests {
+ :
+}
+
+function run_archcheck {
+ pushd build
+ ./nextpnr-nexus --device LIFCL-40-9BG400CES --test
+ popd
+}
diff --git a/.github/workflows/arch_ci.yml b/.github/workflows/arch_ci.yml
new file mode 100644
index 00000000..5bf83630
--- /dev/null
+++ b/.github/workflows/arch_ci.yml
@@ -0,0 +1,95 @@
+# CI for everything other than the sui generis FPGA interchange arrangements
+
+name: Arch CI tests
+
+on: [push, pull_request]
+
+jobs:
+ Build-nextpnr:
+ strategy:
+ fail-fast: false
+ matrix:
+ arch: [mistral, ice40, ecp5, generic, nexus, machxo2, gowin]
+ runs-on: ubuntu-latest
+ env:
+ DEPS_PATH: ${{ github.workspace }}/deps
+ YOSYS_REVISION: bd7ee79486d4e8788f36de8c25a3fb2df451d682
+ ICESTORM_REVISION: 9f66f9ce16941c6417813cb87653c735a78b53ae
+ TRELLIS_REVISION: 48486ebd1e03e4ac42c96299e881adf9d43bc241
+ PRJOXIDE_REVISION: c3fb1526cf4a2165e15b74f4a994d153c7695fe4
+ MISTRAL_REVISION: ebfc0dd2cc7d6d2159b641a397c88554840e93c9
+ APYCULA_REVISION: 0.2a4
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: recursive
+
+ - uses: actions/setup-python@v2
+
+ - name: Install
+ run: |
+ sudo apt-get update
+ sudo apt-get install git make cmake libboost-all-dev python3-dev libeigen3-dev tcl-dev lzma-dev libftdi-dev clang bison flex swig qt5-default iverilog
+
+ - name: Cache yosys installation
+ uses: actions/cache@v2
+ id: cache-yosys
+ with:
+ path: .yosys
+ key: cache-yosys-${{ env.YOSYS_REVISION }}-r2
+
+ - name: Build yosys
+ run: |
+ source ./.github/ci/build_common.sh
+ build_yosys
+ if: steps.cache-yosys.outputs.cache-hit != 'true'
+
+ - name: Cache icestorm installation
+ uses: actions/cache@v2
+ id: cache-icestorm
+ with:
+ path: .icestorm
+ key: cache-icestorm-${{ env.ICESTORM_REVISION }}
+ if: matrix.arch == 'ice40'
+
+ - name: Build icestorm
+ run: |
+ source ./.github/ci/build_common.sh
+ build_icestorm
+ if: matrix.arch == 'ice40' && steps.cache-icestorm.outputs.cache-hit != 'true'
+
+ - name: Cache trellis installation
+ uses: actions/cache@v2
+ id: cache-trellis
+ with:
+ path: .trellis
+ key: cache-trellis-${{ env.TRELLIS_REVISION }}
+ if: matrix.arch == 'ecp5' || matrix.arch == 'machxo2'
+
+ - name: Build trellis
+ run: |
+ source ./.github/ci/build_common.sh
+ build_trellis
+ if: (matrix.arch == 'ecp5' || matrix.arch == 'machxo2') && steps.cache-trellis.outputs.cache-hit != 'true'
+
+ - name: Cache prjoxide installation
+ uses: actions/cache@v2
+ id: cache-prjoxide
+ with:
+ path: .prjoxide
+ key: cache-prjoxide-${{ env.PRJOXIDE_REVISION }}
+ if: matrix.arch == 'nexus'
+
+ - name: Build prjoxide
+ run: |
+ source ./.github/ci/build_common.sh
+ build_prjoxide
+ if: matrix.arch == 'nexus' && steps.cache-prjoxide.outputs.cache-hit != 'true'
+
+ - name: Execute build nextpnr
+ run: |
+ source ./.github/ci/build_${{ matrix.arch }}.sh
+ get_dependencies
+ build_nextpnr
+ run_tests
+ run_archcheck
diff --git a/.github/workflows/mistral_ci.yml b/.github/workflows/mistral_ci.yml
deleted file mode 100644
index b0bbfb52..00000000
--- a/.github/workflows/mistral_ci.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-name: Mistral CI tests
-
-on: [push, pull_request]
-
-jobs:
- Build-nextpnr:
- runs-on: ubuntu-latest
- steps:
-
- - uses: actions/checkout@v2
- with:
- submodules: recursive
-
- - uses: actions/setup-python@v2
-
- - name: Install
- run: |
- sudo apt-get update
- sudo apt-get install git make cmake libboost-all-dev python3-dev libeigen3-dev tcl-dev lzma-dev clang bison flex swig
-
- - name: Execute build nextpnr
- env:
- MISTRAL_PATH: ${{ github.workspace }}/deps/mistral
- MISTRAL_REVISION: ebfc0dd2cc7d6d2159b641a397c88554840e93c9
- run: |
- source ./.github/ci/build_mistral.sh
- get_dependencies
- build_nextpnr
- run_archcheck