@@ -22,6 +22,7 @@ data_file=""
22
22
target=" ethos-u55-128"
23
23
timeout=" 600"
24
24
etrecord_file=" "
25
+ trace_file=" "
25
26
26
27
help () {
27
28
echo " Usage: $( basename $0 ) [options]"
@@ -31,6 +32,7 @@ help() {
31
32
echo " --target=<TARGET> Target to build and run for Default: ${target} "
32
33
echo " --timeout=<TIME_IN_SEC> Maximum target runtime, used to detect hanging, might need to be higer on large models Default: ${timeout} "
33
34
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"
34
36
exit 0
35
37
}
36
38
@@ -42,6 +44,7 @@ for arg in "$@"; do
42
44
--target=* ) target=" ${arg#* =} " ;;
43
45
--timeout=* ) timeout=" ${arg#* =} " ;;
44
46
--etrecord=* ) etrecord_file=" ${arg#* =} " ;;
47
+ --trace_file=* ) trace_file=" ${arg#* =} " ;;
45
48
* )
46
49
;;
47
50
esac
86
89
87
90
log_file=$( mktemp)
88
91
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
+
89
100
if [[ ${target} == * " ethos-u55" * ]]; then
90
101
${nobuf} ${fvp_model} \
91
102
-C ethosu.num_macs=${num_macs} \
92
103
-C mps3_board.visualisation.disable-visualisation=1 \
93
104
-C mps3_board.telnetterminal0.start_telnet=0 \
94
105
-C mps3_board.uart0.out_file=' -' \
95
106
-C mps3_board.uart0.shutdown_on_eot=1 \
107
+ " ${extra_args_u55[@]} " \
96
108
-a " ${elf_file} " \
97
109
${data_file} \
98
110
--timelimit ${timeout} 2>&1 | sed ' s/\r$//' | tee ${log_file} || true # seconds
@@ -105,6 +117,7 @@ elif [[ ${target} == *"ethos-u85"* ]]; then
105
117
-C mps4_board.telnetterminal0.start_telnet=0 \
106
118
-C mps4_board.uart0.out_file=' -' \
107
119
-C mps4_board.uart0.shutdown_on_eot=1 \
120
+ " ${extra_args_u85[@]} " \
108
121
-a " ${elf_file} " \
109
122
${data_file} \
110
123
--timelimit ${timeout} 2>&1 | sed ' s/\r$//' | tee ${log_file} || true # seconds
0 commit comments