From ca8d4ea0ca5fa27bab7a9740344e75b97d3c3acf Mon Sep 17 00:00:00 2001 From: Christos Spirotis Date: Tue, 14 Jan 2020 15:00:59 +0000 Subject: [PATCH] GIS-7972 Improve build_image.sh and elogic_version.sh --- autobuild/synthesis/build_image.sh | 12 +++++++++++- autobuild/synthesis/elogic_version.sh | 22 +++++++++++++--------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/autobuild/synthesis/build_image.sh b/autobuild/synthesis/build_image.sh index c664301..6374954 100644 --- a/autobuild/synthesis/build_image.sh +++ b/autobuild/synthesis/build_image.sh @@ -88,11 +88,20 @@ FW_VER=(${BUILD_STAMP//./ }) # Check if script to generate version package exists if [ -f "output_files/create_pkg.sh" ]; then + # Create folder to export version outputs + rm -rf "$WORKSPACE/version" + if [ $? -ne 0 ]; then exit 1; fi + + mkdir "$WORKSPACE/version" + if [ $? -ne 0 ]; then exit 1; fi + # Write Major/Minor to version folder - printf '%02x_%02x\n' $FW_MAJOR $FW_MINOR > "$WORKSPACE/version/elogic_version.txt" + printf '%02x%02x\n' $FW_MAJOR $FW_MINOR > "$WORKSPACE/version/elogic_version.txt" + if [ $? -ne 0 ]; then exit 1; fi # Generate RTL version package sh output_files/create_pkg.sh $FW_MAJOR $FW_MINOR ${FW_VER[0]} ${FW_VER[1]} ${FW_VER[2]} ${FW_VER[3]} + if [ $? -ne 0 ]; then exit 1; fi fi quartus_sh --flow compile ${QPF_TOP} 2>&1 | tee -a "$WORKSPACE/output.txt" @@ -166,6 +175,7 @@ if [ -f "create_cpp.sh" ]; then if [ $? -ne 0 ]; then popd; exit 1; fi sh ./create_cpp.sh $FW_MAJOR $FW_MINOR ${FW_VER[0]} ${FW_VER[1]} ${FW_VER[2]} ${FW_VER[3]} + if [ $? -ne 0 ]; then exit 1; fi fi diff --git a/autobuild/synthesis/elogic_version.sh b/autobuild/synthesis/elogic_version.sh index 8771efa..d434da6 100644 --- a/autobuild/synthesis/elogic_version.sh +++ b/autobuild/synthesis/elogic_version.sh @@ -1,16 +1,20 @@ #!/bin/bash -v -FIRMWARE_VERSION=`"$SOPC_BIN/qsys-script" --system-file="$PROJECT_DIR/${QSYS_TOP}.qsys" --cmd="puts [get_instance_parameter_value sysid_qsys id]" --package-version="${QSYS_PKG_VER}"` -if [ $? -ne 0 ]; then exit 1; fi +if [ -f "$PROJECT_DIR/${QSYS_TOP}.qsys" ]; then -# Create folder to export version outputs -rm -rf "$WORKSPACE/version" -if [ $? -ne 0 ]; then exit 1; fi + FIRMWARE_VERSION=`"$SOPC_BIN/qsys-script" --system-file="$PROJECT_DIR/${QSYS_TOP}.qsys" --cmd="puts [get_instance_parameter_value sysid_qsys id]" --package-version="${QSYS_PKG_VER}"` + if [ $? -ne 0 ]; then exit 1; fi -mkdir "$WORKSPACE/version" -if [ $? -ne 0 ]; then exit 1; fi + # Create folder to export version outputs + rm -rf "$WORKSPACE/version" + if [ $? -ne 0 ]; then exit 1; fi -printf %x $FIRMWARE_VERSION > "$WORKSPACE/version/elogic_version.txt" -if [ $? -ne 0 ]; then exit 1; fi + mkdir "$WORKSPACE/version" + if [ $? -ne 0 ]; then exit 1; fi + + printf %x $FIRMWARE_VERSION > "$WORKSPACE/version/elogic_version.txt" + if [ $? -ne 0 ]; then exit 1; fi + +fi exit 0 \ No newline at end of file