aboutsummaryrefslogtreecommitdiffstats
path: root/.github/ci
diff options
context:
space:
mode:
Diffstat (limited to '.github/ci')
-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
8 files changed, 204 insertions, 0 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
+}