1818# Usage help
1919function usage
2020{
21- echo " usage: aws_build_dcp_from_cl.sh [ [-script <vivado_script>] | [-strategy BASIC | DEFAULT | EXPLORE | TIMING | CONGESTION] [-block] | [-h] | [-H] | [-help] | ]"
21+ echo " usage: aws_build_dcp_from_cl.sh [ [-script <vivado_script>] | [-strategy BASIC | DEFAULT | EXPLORE | TIMING | CONGESTION] [-foreground] | [-h] | [-H] | [-help] | ]"
22+ echo " "
23+ echo " By default the build is run in the background using nohup so that the"
24+ echo " process will not be terminated if the terminal window is closed."
25+ echo " The window can be closed if it is running on your computer and the"
26+ echo " network connection is lost. All build output will be redirected to a"
27+ echo " log file called *.nohup.out."
28+ echo " "
29+ echo " The -foreground option runs the build in the foreground. All output will"
30+ echo " go to the terminal and the build may be terminated if the terminal"
31+ echo " is closed. This option is useful if you want to wait for the build"
32+ echo " to complete. This option is safe if the terminal is running on the"
33+ echo " AWS instance, for example on a GUI desktop on the instance."
2234}
2335
2436# Default arguments for script and strategy
2537strategy=DEFAULT
2638vivado_script=" create_dcp_from_cl.tcl"
27- block =0
39+ foreground =0
2840
2941# Parse command-line arguments
3042while [ " $1 " != " " ]; do
@@ -35,7 +47,7 @@ while [ "$1" != "" ]; do
3547 -strategy ) shift
3648 strategy=$1
3749 ;;
38- -block ) block =1
50+ -foreground ) foreground =1
3951 ;;
4052 -h | -H | -help ) usage
4153 exit
@@ -98,11 +110,14 @@ vivado -version >/dev/null 2>&1 || { echo >&2 "ERROR - Please install/enable Viv
98110
99111# Run vivado
100112cmd=" vivado -mode batch -nojournal -log $logname -source $vivado_script -tclargs $timestamp $strategy "
101- if [[ " $block " == " 0" ]]; then
113+ if [[ " $foreground " == " 0" ]]; then
102114 nohup $cmd > $timestamp .nohup.out 2>&1 &
103115
104116 echo " AWS FPGA: Build through Vivado is running as background process, this may take few hours."
117+ echo " AWS FPGA: Output is being redirected to $timestamp .nohup.out"
105118 echo " AWS FPGA: You can set up an email notification upon Vivado run finish by following the instructions in TBD"
106119else
120+ echo " AWS FPGA: Build through Vivado is running in the foreground, this may take a few hours."
121+ echo " AWS FPGA: The build may be terminated if the network connection to this terminal window is lost."
107122 $cmd
108123fi
0 commit comments