Skip to content
Snippets Groups Projects
Unverified Commit 1bff996f authored by Recolic Keghart's avatar Recolic Keghart
Browse files

correct return value if vivado fails

parent d49d7544
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@
_vw_bin_name="$0"
_vw_version_major="1"
_vw_version_minor="2"
_vw_version_minor="3"
_vw_version="${_vw_version_major}.${_vw_version_minor}"
[[ $_vw_version_major == 0 ]] && echo "Vivado wrapper is unfinished, and unable to work." && exit 11
......@@ -132,7 +132,7 @@ function vivado_check_and_init_template () {
[[ -z "$board" ]] && echo "You must set variable 'board'. Try \`vivadow init\` again." && return 4
[[ -d "$my_path/template/$board" ]] && return 0
"$my_path/gen_tcl.sh" init-project temp_project "$my_path/template/$board" "$board" > $temp_dir/sh.tcl
"$vivado_exec" -mode batch -source "$temp_dir/sh.tcl" -nojournal -nolog
"$vivado_exec" -mode batch -source "$temp_dir/sh.tcl" -nojournal -nolog || return $?
rm "$my_path/template/$board/temp_project.srcs/constrs_1/new/constraint.xdc"
rm -rf "$my_path/template/$board/temp_project.cache/"*
}
......@@ -180,12 +180,15 @@ function do_init () {
function do_build () {
generate_real_project
[[ $? -ne 0 ]] && echo "Generate real project failed." && clean_real_project && exit 4
[[ $? -ne 0 ]] && echo "Generate real project failed." && clean_real_project && return 4
"$my_path/gen_tcl.sh" build "$temp_dir/project/temp_project.xpr" synth_1 impl_1 write_bitstream "$top_module" $thread_num > $temp_dir/sh.tcl
"$vivado_exec" -mode batch -source "$temp_dir/sh.tcl" -nojournal -nolog
_ret=$?
[[ $_ret -ne 0 ]] && echo2 "vivado-wrapper: Error: Build failed. Please check previous error report." && clean_real_project && return $_ret
_bit_file="$temp_dir/project/temp_project.runs/impl_1/$top_module.bit"
[[ -e "$_bit_file" ]] && cp "$_bit_file" "$bit_dir/$top_module.bit" || echo "vivado-wrapper: Error: Build failed. Please check previous error report."
[[ -e "$_bit_file" ]] && cp "$_bit_file" "$bit_dir/$top_module.bit"
[[ $? -ne 0 ]] && echo2 "vivado-wrapper: Error: Build failed. Please check previous error report." && clean_real_project && return 5
clean_real_project
}
......@@ -194,6 +197,7 @@ function burn_file () {
file_to_burn="$1"
"$my_path/gen_tcl.sh" burn-file "$file_to_burn" "$device_name" > $temp_dir/sh.tcl
"$vivado_exec" -mode batch -source "$temp_dir/sh.tcl" -nojournal -nolog
return $?
}
function do_burn () {
......@@ -245,3 +249,4 @@ case $vw_cmd in
;;
esac
exit $?
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment