summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLokesh B V <lokesh.bv@arm.com>2019-12-26 19:26:21 +0530
committerThomas Abraham <thomas.abraham@arm.com>2020-04-07 00:44:23 +0530
commita4ac4339842dc1397bf4adc78608835d4a51162c (patch)
treea61b13b5c6da78746b2c566daf4ac0bff265c6b5
parent29d07c2dc4a5eed6f894330cd54647ca8a990dd0 (diff)
platform/rdn1edge: run_model script bug fixes and refactoring
Fix bugs related handling of the model binary path, passing the correct set of model parameters and handling model launch failuers. While at it, refactor the handling of parameters for handling automated runs. Change-Id: Ia67db0713cc39df1e808c7328efe3108aaf58110 Signed-off-by: Lokesh B V <lokesh.bv@arm.com>
-rwxr-xr-xrdinfra/platforms/rdn1edge/run_model.sh59
1 files changed, 30 insertions, 29 deletions
diff --git a/rdinfra/platforms/rdn1edge/run_model.sh b/rdinfra/platforms/rdn1edge/run_model.sh
index 68d3eec..89777f8 100755
--- a/rdinfra/platforms/rdn1edge/run_model.sh
+++ b/rdinfra/platforms/rdn1edge/run_model.sh
@@ -46,14 +46,16 @@ AUTOMATE="false"
source $PWD/../../../sgi/sgi_common_util.sh
# Check that a path to the model has been provided
-if [ ! -e "$MODEL" ]; then
+if [ "$MODEL" == "" ]; then
#if no model path has been provided, assign a default path
MODEL="../../../../fastmodel/refinfra/models/Linux64_GCC-4.9/FVP_RD_N1_edge"
- if [ ! -f "$MODEL" ]; then
- echo "ERROR: you should set variable MODEL to point to a valid " \
- "RD-N1-Edge model binary, currently it is set to \"$MODEL\""
- exit 1
- fi
+fi
+
+# Check that the path to the model exists.
+if [ ! -f "$MODEL" ]; then
+ echo "ERROR: you should set variable MODEL to point to a valid RD-N1-Edge" \
+ "model binary, currently it is set to \"$MODEL\""
+ exit 1
fi
#Path to the binary models
@@ -132,23 +134,6 @@ while test $# -gt 0; do
shift
if test $# -gt 0; then
AUTOMATE=$1
- MODEL_PARAMS="$MODEL_PARAMS \
- -C css.scp.terminal_uart_aon.start_telnet=0 \
- -C css.mcp.terminal_uart0.start_telnet=0 \
- -C css.mcp.terminal_uart1.start_telnet=0 \
- -C css.terminal_uart_ap.start_telnet=0 \
- -C css.terminal_uart1_ap.start_telnet=0 \
- -C soc.terminal_s0.start_telnet=0 \
- -C soc.terminal_s1.start_telnet=0 \
- -C soc.terminal_mcp.start_telnet=0 \
- -C board.terminal_0.start_telnet=0 \
- -C board.terminal_1.start_telnet=0 \
- -C css.pl011_uart1_ap.out_file="ap-uart1" \
- -C soc.pl011_uart_mcp.out_file="soc-mcp-uart0" \
- -C css.mcp.pl011_uart1_mcp.out_file="css-mcp_uart1" \
- -C css.mcp.pl011_uart0_mcp.out_file="css-mcp_uart0" \
- -C board.pl011_uart0.out_file="board-uart0" \
- -C board.pl011_uart1.out_file="board-uart1""
fi
shift
;;
@@ -238,6 +223,22 @@ create_nor_flash_image "$PWD/nor1_flash.img"
echo "NOR2 flash image: $PWD/nor2_flash.img"
create_nor_flash_image "$PWD/nor2_flash.img"
+if [ "$AUTOMATE" == "true" ] ; then
+ MODEL_PARAMS="$MODEL_PARAMS \
+ -C disable_visualisation=true \
+ -C css.scp.terminal_uart_aon.start_telnet=0 \
+ -C css.mcp.terminal_uart0.start_telnet=0 \
+ -C css.mcp.terminal_uart1.start_telnet=0 \
+ -C css.terminal_uart_ap.start_telnet=0 \
+ -C css.terminal_uart1_ap.start_telnet=0 \
+ -C soc.terminal_s0.start_telnet=0 \
+ -C soc.terminal_s1.start_telnet=0 \
+ -C soc.terminal_mcp.start_telnet=0 \
+ -C board.terminal_0.start_telnet=0 \
+ -C board.terminal_1.start_telnet=0 \
+ "
+fi
+
echo
echo "Starting model "$MODEL_TYPE
echo " MODEL_PARAMS = "$MODEL_PARAMS
@@ -272,14 +273,14 @@ PARAMS="-C css.cmn600.mesh_config_file=$PATH_TO_MODEL/RD_N1_E1_cmn600.yml \
${EXTRA_MODEL_PARAMS}"
if [ "$AUTOMATE" == "true" ] ; then
- ${MODEL} $PARAMS ${MODEL_PARAMS} ${EXTRA_MODEL_PARAMS} 2>&1 &
+ ${MODEL} ${PARAMS} 2>&1 &
else
- ${MODEL} $PARAMS ${MODEL_PARAMS} ${EXTRA_MODEL_PARAMS} 2>&1
+ ${MODEL} ${PARAMS} 2>&1
fi
-if [ "$?" == "0" ] ; then
- echo "Model launched with pid: "$!
- export MODEL_PID=$!
-else
+if [ "$?" != "0" ] ; then
echo "Failed to launch the model"
export MODEL_PID=0
+elif [ "$AUTOMATE" == "true" ] ; then
+ echo "Model launched with pid: "$!
+ export MODEL_PID=$!
fi