18
18
# Usage help
19
19
function usage
20
20
{
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."
22
34
}
23
35
24
36
# Default arguments for script and strategy
25
37
strategy=DEFAULT
26
38
vivado_script=" create_dcp_from_cl.tcl"
27
- block =0
39
+ foreground =0
28
40
29
41
# Parse command-line arguments
30
42
while [ " $1 " != " " ]; do
@@ -35,7 +47,7 @@ while [ "$1" != "" ]; do
35
47
-strategy ) shift
36
48
strategy=$1
37
49
;;
38
- -block ) block =1
50
+ -foreground ) foreground =1
39
51
;;
40
52
-h | -H | -help ) usage
41
53
exit
@@ -98,11 +110,14 @@ vivado -version >/dev/null 2>&1 || { echo >&2 "ERROR - Please install/enable Viv
98
110
99
111
# Run vivado
100
112
cmd=" vivado -mode batch -nojournal -log $logname -source $vivado_script -tclargs $timestamp $strategy "
101
- if [[ " $block " == " 0" ]]; then
113
+ if [[ " $foreground " == " 0" ]]; then
102
114
nohup $cmd > $timestamp .nohup.out 2>&1 &
103
115
104
116
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"
105
118
echo " AWS FPGA: You can set up an email notification upon Vivado run finish by following the instructions in TBD"
106
119
else
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."
107
122
$cmd
108
123
fi
0 commit comments