Previously, the build tools for the FPGA bitfiles would try and autodetect the Vivado executable, but would allow for a `vivado_lab` executable. However, Vivado Lab Edition can't build bitfiles nor run testbenches. Its only use with the USRP FPGA build tooling is to run `viv_jtag_program` and `viv_jtag_list` (which are command-line proxies for probing FPGAs attached to JTAG, and for programming bitfiles over JTAG, e.g. to an X3x0). When Vivado Lab and Vivado were present, it was possible that we ran into issues where Vivado Labs would be preferred, and then builds or testbenches would fail. We therefore remove the ability to use Vivado Lab. Running the Vivado Lab Edition with the GUI, and loading and probing bitfiles is of course still possible, but tools like `rfnoc_image_builder` can no longer accidentally try to use Vivado Lab instead of regular Vivado. Original-commit: 21c4c591a51d520c7aac7108e853e59c4953f953
92 lines
2.0 KiB
Bash
Executable File
92 lines
2.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
#------------------------------------------
|
|
# Parse command line args
|
|
#------------------------------------------
|
|
|
|
function help {
|
|
cat <<EOHELP
|
|
|
|
Usage: $0 [--help|-h] [--no-color] [<vivado args>]
|
|
|
|
--no-color : Don't colorize command output
|
|
--help, -h : Shows this message.
|
|
|
|
EOHELP
|
|
}
|
|
|
|
viv_args=""
|
|
colorize=1
|
|
for i in "$@"; do
|
|
case $i in
|
|
-h|--help)
|
|
help
|
|
exit 0
|
|
;;
|
|
--no-color)
|
|
colorize=0
|
|
;;
|
|
*)
|
|
viv_args="$viv_args $i"
|
|
;;
|
|
esac
|
|
done
|
|
|
|
#------------------------------------------
|
|
# Colorize
|
|
#------------------------------------------
|
|
|
|
# VIV_COLOR_SCHEME must be defined in the environment setup script
|
|
if [ $colorize -eq 0 ]; then
|
|
VIV_COLOR_SCHEME=none
|
|
fi
|
|
|
|
case "$VIV_COLOR_SCHEME" in
|
|
default)
|
|
CLR_OFF='tput sgr0'
|
|
ERR_CLR='tput setaf 1'
|
|
CRIWARN_CLR='tput setaf 1'
|
|
WARN_CLR='tput setaf 3'
|
|
;;
|
|
*)
|
|
CLR_OFF=''
|
|
ERR_CLR=$CLR_OFF
|
|
CRIWARN_CLR=$CLR_OFF
|
|
WARN_CLR=$CLR_OFF
|
|
esac
|
|
|
|
trim() {
|
|
local var="$*"
|
|
var="${var#"${var%%[![:space:]]*}"}" # remove leading whitespace characters
|
|
var="${var%"${var##*[![:space:]]}"}" # remove trailing whitespace characters
|
|
echo -n "$var"
|
|
}
|
|
|
|
VIVADO_COMMAND="vivado"
|
|
|
|
$VIVADO_COMMAND $viv_args 2>&1 | while IFS= read -r line
|
|
|
|
do
|
|
if [[ $line != \#* ]]; then # Ignore script output
|
|
case $(trim $line) in
|
|
*FATAL:*|*Fatal:*)
|
|
eval $ERR_CLR; echo "$line"; eval $CLR_OFF
|
|
;;
|
|
*ERROR:*|*Error:*)
|
|
eval $ERR_CLR; echo "$line"; eval $CLR_OFF
|
|
;;
|
|
*CRITICAL[[:space:]]WARNING:*|*Crtical[[:space:]]Warning:*)
|
|
eval $CRIWARN_CLR; echo "$line"; eval $CLR_OFF
|
|
;;
|
|
*WARNING:*|*Warning:*)
|
|
eval $WARN_CLR; echo "$line"; eval $CLR_OFF
|
|
;;
|
|
*)
|
|
echo "$line"
|
|
esac
|
|
else
|
|
echo "$line"
|
|
fi
|
|
done
|
|
exit ${PIPESTATUS[0]}
|