redpitaya-puzzlefw/fpga/make_binfile.sh

31 lines
409 B
Bash
Executable File

#!/bin/bash
set -e
. script_env
setup_vivado
if [ ! -f "$1" ]; then
echo "Usage: $0 bitfile.bit" >&2
exit 1
fi
bitfile="$(basename "$1")"
mkdir binfile_dir
cp -a "$1" "binfile_dir/$bitfile"
cat >"binfile_dir/bitstream.bif" <<EOF
all:
{
$bitfile
}
EOF
( cd binfile_dir ; bootgen -image bitstream.bif -arch zynq -process_bitstream bin )
cp -a "binfile_dir/${bitfile}.bin" .
rm -r binfile_dir