GIS-7972 Improve build_image.sh and elogic_version.sh

This commit is contained in:
Christos Spirotis 2020-01-14 15:00:59 +00:00
commit ca8d4ea0ca
2 changed files with 24 additions and 10 deletions

View file

@ -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

View file

@ -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