Skip to content

Commit 3e3a660

Browse files
cartallaAWSsunandaj
authored andcommitted
Add -block option to aws_build_dcp_from_cl.sh
-block option doesn't nohup the vivado build so that the script doesn't exit until the build is complete. This makes it easier to call the script from another script and get the return code. Default behavior hasn't changed.
1 parent 24b6057 commit 3e3a660

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

hdk/cl/examples/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/build/bitstreams/*.log
44
*/build/bitstreams/*.bin
55
*.bin
6+
*/build/checkpoints
67
*/build/checkpoints/*.dcp
78
*/build/reports/*.rpt
89
*/build/reports/*.txt

hdk/common/shell_current/build/scripts/aws_build_dcp_from_cl.sh

+13-6
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@
1818
# Usage help
1919
function usage
2020
{
21-
echo "usage: aws_build_dcp_from_cl.sh [ [-script <vivado_script>] | [-strategy BASIC | DEFAULT | EXPLORE | TIMING | CONGESTION] | [-h] | [-H] | [-help] | ]"
21+
echo "usage: aws_build_dcp_from_cl.sh [ [-script <vivado_script>] | [-strategy BASIC | DEFAULT | EXPLORE | TIMING | CONGESTION] [-block] | [-h] | [-H] | [-help] | ]"
2222
}
2323

2424
# Default arguments for script and strategy
2525
strategy=DEFAULT
2626
vivado_script="create_dcp_from_cl.tcl"
27+
block=0
2728

2829
# Parse command-line arguments
2930
while [ "$1" != "" ]; do
@@ -34,6 +35,8 @@ while [ "$1" != "" ]; do
3435
-strategy ) shift
3536
strategy=$1
3637
;;
38+
-block ) block=1
39+
;;
3740
-h | -H | -help ) usage
3841
exit
3942
;;
@@ -94,8 +97,12 @@ echo "AWS FPGA: Environment variables and directories are present. Checking for
9497
vivado -version >/dev/null 2>&1 || { echo >&2 "ERROR - Please install/enable Vivado." ; return 1; }
9598

9699
# Run vivado
97-
nohup vivado -mode batch -nojournal -log $logname -source $vivado_script -tclargs $timestamp $strategy > $timestamp.nohup.out 2>&1&
98-
99-
echo "AWS FPGA: Build through Vivado is running as background process, this may take few hours."
100-
echo "AWS FPGA: You can set up an email notification upon Vivado run finish by following the instructions in TBD"
101-
100+
cmd="vivado -mode batch -nojournal -log $logname -source $vivado_script -tclargs $timestamp $strategy"
101+
if [[ "$block" == "0" ]]; then
102+
nohup $cmd > $timestamp.nohup.out 2>&1 &
103+
104+
echo "AWS FPGA: Build through Vivado is running as background process, this may take few hours."
105+
echo "AWS FPGA: You can set up an email notification upon Vivado run finish by following the instructions in TBD"
106+
else
107+
$cmd
108+
fi

0 commit comments

Comments
 (0)