aboutsummaryrefslogtreecommitdiffstats
path: root/machxo2/examples/demo-vhdl.sh
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-07-01 20:17:02 +0100
committerGitHub <noreply@github.com>2021-07-01 20:17:02 +0100
commitfe38e70dc1cd84a60e2fe05f7153c8deed1c16e9 (patch)
tree5752e4a2be0793539691580c02ea85933544c47f /machxo2/examples/demo-vhdl.sh
parent55c663f7ac63253124cffd1efec8b9b400658a3d (diff)
parent41d09f71871184aabbd7495a485e257fc0450d40 (diff)
downloadnextpnr-fe38e70dc1cd84a60e2fe05f7153c8deed1c16e9.tar.gz
nextpnr-fe38e70dc1cd84a60e2fe05f7153c8deed1c16e9.tar.bz2
nextpnr-fe38e70dc1cd84a60e2fe05f7153c8deed1c16e9.zip
Merge pull request #747 from cr1901/machxo2
MachXO2 Checkpoint 1
Diffstat (limited to 'machxo2/examples/demo-vhdl.sh')
-rw-r--r--machxo2/examples/demo-vhdl.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/machxo2/examples/demo-vhdl.sh b/machxo2/examples/demo-vhdl.sh
new file mode 100644
index 00000000..4bdab54a
--- /dev/null
+++ b/machxo2/examples/demo-vhdl.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+if [ $# -lt 1 ]; then
+ echo "Usage: $0 prefix"
+ exit -1
+fi
+
+if ! grep -q "LOC" $1.vhd; then
+ echo "$1.vhd does not have LOC constraints for tinyfpga_a."
+ exit -2
+fi
+
+if [ ! -z ${TRELLIS_DB+x} ]; then
+ DB_ARG="--db $TRELLIS_DB"
+fi
+
+set -ex
+
+${YOSYS:-yosys} -p "ghdl --std=08 prims.vhd ${1}.vhd -e;
+ attrmap -tocase LOC
+ synth_machxo2 -json ${1}-vhdl.json"
+${NEXTPNR:-../../nextpnr-machxo2} --1200 --package QFN32 --no-iobs --json $1-vhdl.json --textcfg $1-vhdl.txt
+ecppack --compress $DB_ARG $1-vhdl.txt $1-vhdl.bit
+tinyproga -b $1-vhdl.bit