artiq-zynq/local_run.sh

40 lines
899 B
Bash
Raw Normal View History

2020-06-05 11:45:56 +08:00
#!/usr/bin/env bash
set -e
impure=0
load_bitstream=1
2020-09-01 09:41:02 +08:00
board_host="192.168.1.52"
2020-06-05 11:45:56 +08:00
2020-09-01 09:41:02 +08:00
while getopts "ilb:" opt; do
2020-06-05 11:45:56 +08:00
case "$opt" in
\?) exit 1
2020-06-05 11:45:56 +08:00
;;
i) impure=1
;;
l) load_bitstream=0
;;
2020-09-01 09:41:02 +08:00
b) board_host=$OPTARG
;;
2020-06-05 11:45:56 +08:00
esac
done
load_bitstream_cmd=""
2020-06-05 11:45:56 +08:00
cd openocd
if [ $impure -eq 1 ]; then
if [ $load_bitstream -eq 1 ]; then
2020-09-01 09:41:02 +08:00
load_bitstream_cmd="-g ../build/gateware/top.bit"
fi
2020-09-01 09:41:02 +08:00
openocd -f zc706.cfg -c "load_image ../build/firmware/armv7-none-eabihf/debug/szl; resume 0; exit"
sleep 5
artiq_netboot $load_bitstream_cmd -f ../build/runtime.bin -b $board_host
2020-06-05 11:45:56 +08:00
else
if [ $load_bitstream -eq 1 ]; then
2020-09-01 09:41:02 +08:00
load_bitstream_cmd="-g ../result/top.bit"
fi
2020-09-01 09:41:02 +08:00
openocd -f zc706.cfg -c "load_image ../result/szl.elf; resume 0; exit"
sleep 5
artiq_netboot $load_bitstream_cmd -f ../result/runtime.bin -b $board_host
2020-06-05 11:45:56 +08:00
fi