1Runtime Instrumentation Testing - N1SDP 2======================================= 3 4For this test we used the N1 System Development Platform (`N1SDP`_), which 5contains an SoC consisting of two dual-core Arm N1 clusters. 6 7The following source trees and binaries were used: 8 9- `TF-A v2.12-rc0`_ 10- `TFTF v2.12-rc0`_ 11- SCP/MCP `Prebuilt Images`_ 12 13Please see the Runtime Instrumentation :ref:`Testing Methodology 14<Runtime Instrumentation Methodology>` page for more details. 15 16Procedure 17--------- 18 19#. Build TFTF with runtime instrumentation enabled: 20 21 .. code:: shell 22 23 make CROSS_COMPILE=aarch64-none-elf- PLAT=n1sdp \ 24 TESTS=runtime-instrumentation all 25 26#. Build TF-A with the following build options: 27 28 .. code:: shell 29 30 make CROSS_COMPILE=aarch64-none-elf- PLAT=n1sdp \ 31 ENABLE_RUNTIME_INSTRUMENTATION=1 fiptool all 32 33#. Fetch the SCP firmware images: 34 35 .. code:: shell 36 37 curl --fail --connect-timeout 5 --retry 5 \ 38 -sLS -o build/n1sdp/release/scp_rom.bin \ 39 https://downloads.trustedfirmware.org/tf-a/css_scp_2.12.0/n1sdp/release/n1sdp-bl1.bin 40 curl --fail --connect-timeout 5 \ 41 --retry 5 -sLS -o build/n1sdp/release/scp_ram.bin \ 42 https://downloads.trustedfirmware.org/tf-a/css_scp_2.12.0/n1sdp/release/n1sdp-bl2.bin 43 44#. Fetch the MCP firmware images: 45 46 .. code:: shell 47 48 curl --fail --connect-timeout 5 --retry 5 \ 49 -sLS -o build/n1sdp/release/mcp_rom.bin \ 50 https://downloads.trustedfirmware.org/tf-a/css_scp_2.12.0/n1sdp/release/n1sdp-mcp-bl1.bin 51 curl --fail --connect-timeout 5 --retry 5 \ 52 -sLS -o build/n1sdp/release/mcp_ram.bin \ 53 https://downloads.trustedfirmware.org/tf-a/css_scp_2.12.0/n1sdp/release/n1sdp-mcp-bl2.bin 54 55#. Using the fiptool, create a new FIP package and append the SCP ram image onto 56 it. 57 58 .. code:: shell 59 60 ./tools/fiptool/fiptool create --blob \ 61 uuid=cfacc2c4-15e8-4668-82be-430a38fad705,file=build/n1sdp/release/bl1.bin \ 62 --scp-fw build/n1sdp/release/scp_ram.bin build/n1sdp/release/scp_fw.bin 63 64#. Append the MCP image to the FIP. 65 66 .. code:: shell 67 68 ./tools/fiptool/fiptool create \ 69 --blob uuid=54464222-a4cf-4bf8-b1b6-cee7dade539e,file=build/n1sdp/release/mcp_ram.bin \ 70 build/n1sdp/release/mcp_fw.bin 71 72#. Then, add TFTF as the Non-Secure workload in the FIP image: 73 74 .. code:: shell 75 76 make CROSS_COMPILE=aarch64-none-elf- PLAT=n1sdp \ 77 ENABLE_RUNTIME_INSTRUMENTATION=1 SCP_BL2=/dev/null \ 78 BL33=<path/to/tftf.bin> fip 79 80#. Load the following images onto the development board: ``fip.bin``, 81 ``scp_rom.bin``, ``scp_ram.bin``, ``mcp_rom.bin``, and ``mcp_ram.bin``. 82 83.. note:: 84 85 These instructions presume you have a complete firmware stack. The N1SDP 86 `user guide`_ provides a detailed explanation on how to get setup from 87 scratch. 88 89Results 90------- 91 92``CPU_SUSPEND`` to deepest power level 93~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 94 95.. table:: ``CPU_SUSPEND`` latencies (µs) to deepest power level in parallel (v2.12) 96 97 +---------+------+----------------+--------+----------------+ 98 | Cluster | Core | Powerdown | Wakeup | Cache Flush | 99 +---------+------+----------------+--------+----------------+ 100 | 0 | 0 | 2.58 | 24.14 | 0.28 (-69.57%) | 101 +---------+------+----------------+--------+----------------+ 102 | 0 | 0 | 4.24 (-32.27%) | 40.1 | 0.3 | 103 +---------+------+----------------+--------+----------------+ 104 | 1 | 0 | 3.58 | 35.54 | 0.28 | 105 +---------+------+----------------+--------+----------------+ 106 | 1 | 0 | 3.28 | 42.36 | 0.3 | 107 +---------+------+----------------+--------+----------------+ 108 109.. table:: ``CPU_SUSPEND`` latencies (µs) to deepest power level in parallel (v2.11) 110 111 +---------+------+----------------+--------+----------------+ 112 | Cluster | Core | Powerdown | Wakeup | Cache Flush | 113 +---------+------+----------------+--------+----------------+ 114 | 0 | 0 | 3.0 (+41.51%) | 23.14 | 1.2 (+185.71%) | 115 +---------+------+----------------+--------+----------------+ 116 | 0 | 0 | 4.6 | 35.86 | 0.3 | 117 +---------+------+----------------+--------+----------------+ 118 | 1 | 0 | 3.68 (+33.33%) | 33.36 | 0.3 | 119 +---------+------+----------------+--------+----------------+ 120 | 1 | 0 | 3.7 (+40.15%) | 38.1 | 0.28 | 121 +---------+------+----------------+--------+----------------+ 122 123.. table:: ``CPU_SUSPEND`` latencies (µs) to deepest power level in serial (v2.12) 124 125 +---------+------+-----------+--------+-------------+ 126 | Cluster | Core | Powerdown | Wakeup | Cache Flush | 127 +---------+------+-----------+--------+-------------+ 128 | 0 | 0 | 1.9 | 23.8 | 0.36 | 129 +---------+------+-----------+--------+-------------+ 130 | 0 | 0 | 2.26 | 23.86 | 0.34 | 131 +---------+------+-----------+--------+-------------+ 132 | 1 | 0 | 2.02 | 23.4 | 0.36 | 133 +---------+------+-----------+--------+-------------+ 134 | 1 | 0 | 2.24 | 23.84 | 0.36 | 135 +---------+------+-----------+--------+-------------+ 136 137.. table:: ``CPU_SUSPEND`` latencies (µs) to deepest power level in serial (v2.11) 138 139 +---------+------+-----------+--------+-------------+ 140 | Cluster | Core | Powerdown | Wakeup | Cache Flush | 141 +---------+------+-----------+--------+-------------+ 142 | 0 | 0 | 1.7 | 22.46 | 0.3 | 143 +---------+------+-----------+--------+-------------+ 144 | 0 | 0 | 2.28 | 22.5 | 0.3 | 145 +---------+------+-----------+--------+-------------+ 146 | 1 | 0 | 2.14 | 21.5 | 0.32 | 147 +---------+------+-----------+--------+-------------+ 148 | 1 | 0 | 2.24 | 22.66 | 0.3 | 149 +---------+------+-----------+--------+-------------+ 150 151``CPU_SUSPEND`` to power level 0 152~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 153 154.. table:: ``CPU_SUSPEND`` latencies (µs) to power level 0 in parallel (v2.12) 155 156 +---------+------+-----------+--------+----------------+ 157 | Cluster | Core | Powerdown | Wakeup | Cache Flush | 158 +---------+------+-----------+--------+----------------+ 159 | 0 | 0 | 1.46 | 31.7 | 0.32 | 160 +---------+------+-----------+--------+----------------+ 161 | 0 | 0 | 2.06 | 35.5 | 0.48 (+60.00%) | 162 +---------+------+-----------+--------+----------------+ 163 | 1 | 0 | 1.96 | 35.7 | 0.32 | 164 +---------+------+-----------+--------+----------------+ 165 | 1 | 0 | 2.08 | 23.38 | 0.28 | 166 +---------+------+-----------+--------+----------------+ 167 168.. table:: ``CPU_SUSPEND`` latencies (µs) to power level 0 in parallel (v2.11) 169 170 +---------+------+----------------+--------+-------------+ 171 | Cluster | Core | Powerdown | Wakeup | Cache Flush | 172 +---------+------+----------------+--------+-------------+ 173 | 0 | 0 | 0.94 (-37.33%) | 30.36 | 0.3 | 174 +---------+------+----------------+--------+-------------+ 175 | 0 | 0 | 2.12 | 33.12 | 0.28 | 176 +---------+------+----------------+--------+-------------+ 177 | 1 | 0 | 2.08 | 32.56 | 0.3 | 178 +---------+------+----------------+--------+-------------+ 179 | 1 | 0 | 2.14 | 21.92 | 0.28 | 180 +---------+------+----------------+--------+-------------+ 181 182.. table:: ``CPU_SUSPEND`` latencies (µs) to power level 0 in serial (v2.12) 183 184 +---------+------+-----------+--------+----------------+ 185 | Cluster | Core | Powerdown | Wakeup | Cache Flush | 186 +---------+------+-----------+--------+----------------+ 187 | 0 | 0 | 1.66 | 23.22 | 0.36 | 188 +---------+------+-----------+--------+----------------+ 189 | 0 | 0 | 2.58 | 23.72 | 0.78 (+85.71%) | 190 +---------+------+-----------+--------+----------------+ 191 | 1 | 0 | 2.02 | 23.84 | 0.38 | 192 +---------+------+-----------+--------+----------------+ 193 | 1 | 0 | 2.16 | 23.92 | 0.34 | 194 +---------+------+-----------+--------+----------------+ 195 196.. table:: ``CPU_SUSPEND`` latencies (µs) to power level 0 in serial (v2.11) 197 198 +---------+------+-----------+--------+-------------+ 199 | Cluster | Core | Powerdown | Wakeup | Cache Flush | 200 +---------+------+-----------+--------+-------------+ 201 | 0 | 0 | 1.64 | 21.88 | 0.34 | 202 +---------+------+-----------+--------+-------------+ 203 | 0 | 0 | 2.42 | 21.76 | 0.34 | 204 +---------+------+-----------+--------+-------------+ 205 | 1 | 0 | 2.02 | 21.14 | 0.32 | 206 +---------+------+-----------+--------+-------------+ 207 | 1 | 0 | 2.18 | 22.3 | 0.34 | 208 +---------+------+-----------+--------+-------------+ 209 210``CPU_OFF`` on all non-lead CPUs 211~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 212 213``CPU_OFF`` on all non-lead CPUs in sequence then, ``CPU_SUSPEND`` on the lead 214core to the deepest power level. 215 216.. table:: ``CPU_OFF`` latencies (µs) on all non-lead CPUs (v2.12) 217 218 +---------+------+-----------+--------+----------------+ 219 | Cluster | Core | Powerdown | Wakeup | Cache Flush | 220 +---------+------+-----------+--------+----------------+ 221 | 0 | 0 | 1.84 | 23.82 | 0.36 | 222 +---------+------+-----------+--------+----------------+ 223 | 0 | 0 | 14.18 | 31.78 | 0.56 (+86.67%) | 224 +---------+------+-----------+--------+----------------+ 225 | 1 | 0 | 13.64 | 30.54 | 0.36 | 226 +---------+------+-----------+--------+----------------+ 227 | 1 | 0 | 14.18 | 31.82 | 0.68 | 228 +---------+------+-----------+--------+----------------+ 229 230.. table:: ``CPU_OFF`` latencies (µs) on all non-lead CPUs (v2.11) 231 232 +---------+------+-----------+--------+----------------+ 233 | Cluster | Core | Powerdown | Wakeup | Cache Flush | 234 +---------+------+-----------+--------+----------------+ 235 | 0 | 0 | 1.96 | 22.44 | 0.38 | 236 +---------+------+-----------+--------+----------------+ 237 | 0 | 0 | 13.76 | 30.34 | 0.26 | 238 +---------+------+-----------+--------+----------------+ 239 | 1 | 0 | 13.46 | 28.28 | 0.24 | 240 +---------+------+-----------+--------+----------------+ 241 | 1 | 0 | 13.84 | 30.06 | 0.28 (-60.00%) | 242 +---------+------+-----------+--------+----------------+ 243 244``CPU_VERSION`` in parallel 245~~~~~~~~~~~~~~~~~~~~~~~~~~~ 246 247.. table:: ``CPU_VERSION`` latency (µs) in parallel on all cores (v2.12) 248 249 +----------+------+-------------------+ 250 | Cluster | Core | Latency | 251 +----------+------+-------------------+ 252 | 0 | 0 | 0.14 | 253 +----------+------+-------------------+ 254 | 0 | 0 | 0.2 (-28.57%) | 255 +----------+------+-------------------+ 256 | 1 | 0 | 0.2 | 257 +----------+------+-------------------+ 258 | 1 | 0 | 0.26 | 259 +----------+------+-------------------+ 260 261.. table:: ``CPU_VERSION`` latency (µs) in parallel on all cores (v2.11) 262 263 +-------------+--------+--------------+ 264 | Cluster | Core | Latency | 265 +-------------+--------+--------------+ 266 | 0 | 0 | 0.12 | 267 +-------------+--------+--------------+ 268 | 0 | 0 | 0.24 | 269 +-------------+--------+--------------+ 270 | 1 | 0 | 0.2 | 271 +-------------+--------+--------------+ 272 | 1 | 0 | 0.26 | 273 +-------------+--------+--------------+ 274 275-------------- 276 277*Copyright (c) 2023-2024, Arm Limited. All rights reserved.* 278 279.. _TF-A v2.12-rc0: https://review.trustedfirmware.org/plugins/gitiles/TF-A/trusted-firmware-a/+/refs/tags/v2.12-rc0 280.. _TFTF v2.12-rc0: https://review.trustedfirmware.org/plugins/gitiles/TF-A/tf-a-tests/+/refs/tags/v2.12-rc0 281.. _user guide: https://gitlab.arm.com/arm-reference-solutions/arm-reference-solutions-docs/-/blob/master/docs/n1sdp/user-guide.rst 282.. _Prebuilt Images: https://downloads.trustedfirmware.org/tf-a/css_scp_2.12.0/n1sdp/release/ 283.. _N1SDP: https://developer.arm.com/documentation/101489/latest 284