Debian Codegraph @

himbaechel/uarch/xilinx/examples/bitgen_xray.sh

raw
1 #!/usr/bin/env bash
2 set -e
3
4 if [ -z "$PRJXRAY" ]; then
5 echo "\$PRJXRAY must be set to a path to the prjxray repo"
6 exit 2
7 fi
8 if [ -z "$PRJXRAY_DB" ]; then
9 echo "\$PRJXRAY_DB must be set to a path to the prjxray-db repo"
10 exit 2
11 fi
12
13 if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then
14 echo "Usage: bitgen_xray.sh <device> <design.fasm> <design.bit>"
15 exit 2
16 fi
17
18 DEVICE="$1"
19
20 FRAMES="$3.frames"
21
22 if [[ "$DEVICE" =~ xc7a.* ]]; then
23 FAMILY=artix7
24 elif [[ "$DEVICE" =~ xc7z.* ]]; then
25 FAMILY=zynq7
26 elif [[ "$DEVICE" =~ xc7k.* ]]; then
27 FAMILY=kintex7
28 else
29 echo "Unknown device $DEVICE"
30 exit 2
31 fi
32
33 python3 ${PRJXRAY}/utils/fasm2frames.py --part "${DEVICE}" --db-root "${PRJXRAY_DB}/${FAMILY}" "$2" "$FRAMES"
34 ${PRJXRAY}/build/tools/xc7frames2bit --part_file "${PRJXRAY_DB}/${FAMILY}/${DEVICE}/part.yaml" --part_name ${DEVICE} --frm_file "$FRAMES" --output_file "$3"