lowobservable.coax/interface2/firmware/generate_bitstream_inc.sh
2021-03-29 16:38:10 -05:00

16 lines
354 B
Bash
Executable File

#!/bin/bash
BITSTREAM=../fpga/rtl/top.bin
if [ ! -f $BITSTREAM ]; then
echo "Bitstream '$BITSTREAM' not found." >&2
exit 1
fi
if [ ! $BITSTREAM -nt "src/bitstream.inc" ]; then
echo "Bitstream '$BITSTREAM' is not newer than generated include file, skipping." >&2
exit
fi
xxd -i $BITSTREAM | tail -n +2 | head -n -2 > src/bitstream.inc