Skip to content

Commit a0c0d2b

Browse files
authored
Arm backend: Remove output buffering when running Corstone FVP with tee (#8821)
Arm backend: Remove output buffering when running FVP with tee This improves the log output feedback when running the FVP so you don't have to wait for slow models without any output. Signed-off-by: Zingo Andersen <[email protected]>
1 parent e713682 commit a0c0d2b

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

backends/arm/scripts/run_fvp.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,21 @@ echo "Running ${elf_file} for ${target} run with FVP:${fvp_model} num_macs:${num
6969
echo "WARNING: Corstone FVP is not cycle accurate and should NOT be used to determine valid runtime"
7070
echo "--------------------------------------------------------------------------------"
7171

72+
# Check if stdbuf is intalled and use stdbuf -oL together with tee below to make the output
73+
# go all the way to the console more directly and not be buffered
74+
75+
if hash stdbuf 2>/dev/null; then
76+
nobuf="stdbuf -oL"
77+
else
78+
nobuf=""
79+
fi
80+
7281
log_file=$(mktemp)
7382

83+
84+
7485
if [[ ${target} == *"ethos-u55"* ]]; then
75-
${fvp_model} \
86+
${nobuf} ${fvp_model} \
7687
-C ethosu.num_macs=${num_macs} \
7788
-C mps3_board.visualisation.disable-visualisation=1 \
7889
-C mps3_board.telnetterminal0.start_telnet=0 \
@@ -82,7 +93,7 @@ if [[ ${target} == *"ethos-u55"* ]]; then
8293
--timelimit ${timeout} 2>&1 | tee ${log_file} || true # seconds
8394
echo "[${BASH_SOURCE[0]}] Simulation complete, $?"
8495
elif [[ ${target} == *"ethos-u85"* ]]; then
85-
${fvp_model} \
96+
${nobuf} ${fvp_model} \
8697
-C mps4_board.subsystem.ethosu.num_macs=${num_macs} \
8798
-C mps4_board.visualisation.disable-visualisation=1 \
8899
-C vis_hdlcd.disable_visualisation=1 \

0 commit comments

Comments
 (0)