@@ -92,7 +92,7 @@ if [[ ${target} == *"ethos-u55"* ]]; then
9292 -C mps3_board.uart0.shutdown_on_eot=1 \
9393 -a " ${elf_file} " \
9494 ${data_file} \
95- --timelimit ${timeout} 2>&1 | tee ${log_file} || true # seconds
95+ --timelimit ${timeout} 2>&1 | sed ' s/\r$// ' | tee ${log_file} || true # seconds
9696 echo " [${BASH_SOURCE[0]} ] Simulation complete, $? "
9797elif [[ ${target} == * " ethos-u85" * ]]; then
9898 ${nobuf} ${fvp_model} \
@@ -104,13 +104,28 @@ elif [[ ${target} == *"ethos-u85"* ]]; then
104104 -C mps4_board.uart0.shutdown_on_eot=1 \
105105 -a " ${elf_file} " \
106106 ${data_file} \
107- --timelimit ${timeout} 2>&1 | tee ${log_file} || true # seconds
107+ --timelimit ${timeout} 2>&1 | sed ' s/\r$// ' | tee ${log_file} || true # seconds
108108 echo " [${BASH_SOURCE[0]} ] Simulation complete, $? "
109109else
110110 echo " Running ${elf_file} for ${target} is not supported"
111111 exit 1
112112fi
113113
114+ echo " Checking for a etdump in log"
115+ ! grep " #\[RUN THIS\]" ${log_file} > /dev/null
116+ if [ $? != 0 ]; then
117+ echo " Found ETDump in log!"
118+ echo " #!/bin/sh" > etdump_script.sh
119+ sed -n ' /^#\[RUN THIS\]$/,/^#\[END\]$/p' ${log_file} >> etdump_script.sh
120+ # You can run etdump_script.sh if you do
121+ # $ chmod a+x etdump_script.sh
122+ # $ ./etdump_script.sh
123+ # But lets not trust the script as a bad patch would run bad code on your machine
124+ grep " >etdump.bin" etdump_script.sh | cut -d\" -f2- | cut -d\" -f1 > etdump.base64
125+ base64 -d etdump.base64 > etdump.bin
126+ python3 -m devtools.inspector.inspector_cli --etdump_path etdump.bin --source_time_scale cycles --target_time_scale cycles
127+ fi
128+
114129echo " Checking for problems in log:"
115130! grep -E " ^(F|E|\\ [critical\\ ]|Hard fault.|Info: Simulation is stopping. Reason: CPU time has been exceeded.).*$" ${log_file}
116131if [ $? != 0 ]; then
0 commit comments