2021-02-01 11:42:15 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2021-02-08 13:07:39 +08:00
|
|
|
if [ $# -lt 1 ]; then
|
|
|
|
echo "Usage: $0 prefix"
|
|
|
|
exit -1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! grep -q "(\*.*LOC.*\*)" $1.v; then
|
|
|
|
echo "$1.v does not have LOC constraints for tinyfpga_a."
|
|
|
|
exit -2
|
|
|
|
fi
|
|
|
|
|
2021-02-01 11:42:15 +08:00
|
|
|
if [ ! -z ${TRELLIS_DB+x} ]; then
|
|
|
|
DB_ARG="--db $TRELLIS_DB"
|
|
|
|
fi
|
|
|
|
|
2021-02-08 13:07:39 +08:00
|
|
|
set -ex
|
|
|
|
|
2023-08-30 21:28:05 +08:00
|
|
|
${YOSYS:-yosys} -p "read_verilog $1.v; synth_lattice -family xo2 -json $1.json"
|
2023-03-09 18:05:20 +08:00
|
|
|
${NEXTPNR:-../../nextpnr-machxo2} --device LCMXO2-1200HC-4SG32C --json $1.json --textcfg $1.txt
|
2021-02-08 13:07:39 +08:00
|
|
|
ecppack --compress $DB_ARG $1.txt $1.bit
|
|
|
|
tinyproga -b $1.bit
|