Skip to content

Commit c00612f

Browse files
authored
Arm Backend: Expose PMU trace output from FVP run (#14401)
Exposes PMU trace output from an FVP. This lays part of the foundation to enable us to use this output to as a data overlay in Model Explorer visualisations. The end goal here is to be able to visualise some profiling data in Model Explorer using our Tosa Flatbuffer adapter. To enable this we need to implement a few changes: 1. Expose PMU trace output from a FVP. This gives us performance data from an FVP run. (This PR) 2. Expose Vela's debug database. This gives us generic information on operators in a our model, and can be combined with the trace output to provide more detailed profiling analysis 3. Write a script to combine the trace output and the debug database so we can visualise it in Model Explorer in Executorch. Here's a snippet of the PMU trace output: ``` { "name": "axi_enabled_cycles", "ph": "X", "ts": "1029", "pid": "DMA", "tid": "axi_enabled_cycles", "dur": "1014" } ``` cc @digantdesai @freddan80 @per @zingo @oscarandersson8218
1 parent c07521a commit c00612f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

backends/arm/scripts/run_fvp.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ data_file=""
2222
target="ethos-u55-128"
2323
timeout="600"
2424
etrecord_file=""
25+
trace_file=""
2526

2627
help() {
2728
echo "Usage: $(basename $0) [options]"
@@ -31,6 +32,7 @@ help() {
3132
echo " --target=<TARGET> Target to build and run for Default: ${target}"
3233
echo " --timeout=<TIME_IN_SEC> Maximum target runtime, used to detect hanging, might need to be higer on large models Default: ${timeout}"
3334
echo " --etrecord=<FILE> If ETDump is used you can supply a ETRecord file matching the PTE"
35+
echo " --trace_file=<FILE> File to write PMU trace output to"
3436
exit 0
3537
}
3638

@@ -42,6 +44,7 @@ for arg in "$@"; do
4244
--target=*) target="${arg#*=}";;
4345
--timeout=*) timeout="${arg#*=}";;
4446
--etrecord=*) etrecord_file="${arg#*=}";;
47+
--trace_file=*) trace_file="${arg#*=}";;
4548
*)
4649
;;
4750
esac
@@ -86,13 +89,22 @@ fi
8689

8790
log_file=$(mktemp)
8891

92+
extra_args_u55=()
93+
extra_args_u85=()
94+
95+
if [[ -n "${trace_file}" ]]; then
96+
extra_args_u55+=(-C "ethosu.extra_args=--pmu-trace ${trace_file}")
97+
extra_args_u85+=(-C "mps4_board.subsystem.ethosu.extra_args=--pmu-trace ${trace_file}")
98+
fi
99+
89100
if [[ ${target} == *"ethos-u55"* ]]; then
90101
${nobuf} ${fvp_model} \
91102
-C ethosu.num_macs=${num_macs} \
92103
-C mps3_board.visualisation.disable-visualisation=1 \
93104
-C mps3_board.telnetterminal0.start_telnet=0 \
94105
-C mps3_board.uart0.out_file='-' \
95106
-C mps3_board.uart0.shutdown_on_eot=1 \
107+
"${extra_args_u55[@]}" \
96108
-a "${elf_file}" \
97109
${data_file} \
98110
--timelimit ${timeout} 2>&1 | sed 's/\r$//' | tee ${log_file} || true # seconds
@@ -105,6 +117,7 @@ elif [[ ${target} == *"ethos-u85"* ]]; then
105117
-C mps4_board.telnetterminal0.start_telnet=0 \
106118
-C mps4_board.uart0.out_file='-' \
107119
-C mps4_board.uart0.shutdown_on_eot=1 \
120+
"${extra_args_u85[@]}" \
108121
-a "${elf_file}" \
109122
${data_file} \
110123
--timelimit ${timeout} 2>&1 | sed 's/\r$//' | tee ${log_file} || true # seconds

0 commit comments

Comments
 (0)