Harrison Mutai | fa2fd89 | 2023-05-11 09:50:31 +0100 | [diff] [blame] | 1 | Runtime Instrumentation Testing - N1SDP |
| 2 | ======================================= |
| 3 | |
| 4 | For this test we used the N1 System Development Platform (`N1SDP`_), which |
| 5 | contains an SoC consisting of two dual-core Arm N1 clusters. |
| 6 | |
| 7 | The following source trees and binaries were used: |
| 8 | |
| 9 | - TF-A [`v2.9-rc0-16-g666aec401`_] |
| 10 | - TFTF [`v2.9-rc0`_] |
| 11 | - SCP/MCP `Prebuilt Images`_ |
| 12 | |
| 13 | Please see the Runtime Instrumentation `Testing Methodology`_ page for more |
| 14 | details. |
| 15 | |
| 16 | Procedure |
| 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 | |
| 89 | Results |
| 90 | ------- |
| 91 | |
| 92 | ``CPU_SUSPEND`` to deepest power level |
| 93 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 94 | |
| 95 | .. table:: ``CPU_SUSPEND`` latencies (µs) to deepest power level in |
| 96 | parallel |
| 97 | |
| 98 | +---------+------+-----------+---------+-------------+ |
| 99 | | Cluster | Core | Powerdown | Wakekup | Cache Flush | |
| 100 | +=========+======+===========+=========+=============+ |
| 101 | | 0 | 0 | 3.44 | 10.04 | 0.4 | |
| 102 | +---------+------+-----------+---------+-------------+ |
| 103 | | 0 | 1 | 4.98 | 12.72 | 0.16 | |
| 104 | +---------+------+-----------+---------+-------------+ |
| 105 | | 1 | 0 | 3.58 | 15.42 | 0.2 | |
| 106 | +---------+------+-----------+---------+-------------+ |
| 107 | | 1 | 1 | 5.24 | 17.78 | 0.18 | |
| 108 | +---------+------+-----------+---------+-------------+ |
| 109 | |
| 110 | .. table:: ``CPU_SUSPEND`` latencies (µs) to deepest power level in |
| 111 | serial |
| 112 | |
| 113 | +---------+------+-----------+---------+-------------+ |
| 114 | | Cluster | Core | Powerdown | Wakekup | Cache Flush | |
| 115 | +=========+======+===========+=========+=============+ |
| 116 | | 0 | 0 | 1.82 | 9.98 | 0.32 | |
| 117 | +---------+------+-----------+---------+-------------+ |
| 118 | | 0 | 1 | 1.96 | 9.96 | 0.18 | |
| 119 | +---------+------+-----------+---------+-------------+ |
| 120 | | 1 | 0 | 2.0 | 10.5 | 0.16 | |
| 121 | +---------+------+-----------+---------+-------------+ |
| 122 | | 1 | 1 | 2.22 | 10.56 | 0.16 | |
| 123 | +---------+------+-----------+---------+-------------+ |
| 124 | |
| 125 | ``CPU_SUSPEND`` to power level 0 |
| 126 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 127 | |
| 128 | .. table:: ``CPU_SUSPEND`` latencies (µs) to power level 0 in |
| 129 | parallel |
| 130 | |
| 131 | +---------+------+-----------+---------+-------------+ |
| 132 | | Cluster | Core | Powerdown | Wakekup | Cache Flush | |
| 133 | +=========+======+===========+=========+=============+ |
| 134 | | 0 | 0 | 1.52 | 11.84 | 0.34 | |
| 135 | +---------+------+-----------+---------+-------------+ |
| 136 | | 0 | 1 | 1.1 | 13.66 | 0.14 | |
| 137 | +---------+------+-----------+---------+-------------+ |
| 138 | | 1 | 0 | 2.18 | 9.48 | 0.18 | |
| 139 | +---------+------+-----------+---------+-------------+ |
| 140 | | 1 | 1 | 2.06 | 14.4 | 0.16 | |
| 141 | +---------+------+-----------+---------+-------------+ |
| 142 | |
| 143 | .. table:: ``CPU_SUSPEND`` latencies (µs) to power level 0 in serial |
| 144 | |
| 145 | +---------+------+-----------+---------+-------------+ |
| 146 | | Cluster | Core | Powerdown | Wakekup | Cache Flush | |
| 147 | +=========+======+===========+=========+=============+ |
| 148 | | 0 | 0 | 1.54 | 9.34 | 0.3 | |
| 149 | +---------+------+-----------+---------+-------------+ |
| 150 | | 0 | 1 | 1.88 | 9.5 | 0.16 | |
| 151 | +---------+------+-----------+---------+-------------+ |
| 152 | | 1 | 0 | 1.86 | 9.86 | 0.2 | |
| 153 | +---------+------+-----------+---------+-------------+ |
| 154 | | 1 | 1 | 2.02 | 9.64 | 0.18 | |
| 155 | +---------+------+-----------+---------+-------------+ |
| 156 | |
| 157 | ``CPU_OFF`` on all non-lead CPUs |
| 158 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 159 | |
| 160 | ``CPU_OFF`` on all non-lead CPUs in sequence then, ``CPU_SUSPEND`` on the lead |
| 161 | core to the deepest power level. |
| 162 | |
| 163 | .. table:: ``CPU_OFF`` latencies (µs) on all non-lead CPUs |
| 164 | |
| 165 | +---------+------+-----------+---------+-------------+ |
| 166 | | Cluster | Core | Powerdown | Wakekup | Cache Flush | |
| 167 | +=========+======+===========+=========+=============+ |
| 168 | | 0 | 0 | 1.86 | 9.88 | 0.32 | |
| 169 | +---------+------+-----------+---------+-------------+ |
| 170 | | 0 | 1 | 21.1 | 12.44 | 0.42 | |
| 171 | +---------+------+-----------+---------+-------------+ |
| 172 | | 1 | 0 | 21.22 | 13.2 | 0.32 | |
| 173 | +---------+------+-----------+---------+-------------+ |
| 174 | | 1 | 1 | 21.56 | 13.18 | 0.54 | |
| 175 | +---------+------+-----------+---------+-------------+ |
| 176 | |
| 177 | ``CPU_VERSION`` in parallel |
| 178 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 179 | |
| 180 | .. table:: ``CPU_VERSION`` latency (µs) in parallel on all cores |
| 181 | |
| 182 | +-------------+--------+--------------+ |
| 183 | | Cluster | Core | Latency | |
| 184 | +=============+========+==============+ |
| 185 | | 0 | 0 | 0.08 | |
| 186 | +-------------+--------+--------------+ |
| 187 | | 0 | 1 | 0.22 | |
| 188 | +-------------+--------+--------------+ |
| 189 | | 1 | 0 | 0.28 | |
| 190 | +-------------+--------+--------------+ |
| 191 | | 1 | 1 | 0.26 | |
| 192 | +-------------+--------+--------------+ |
| 193 | |
| 194 | -------------- |
| 195 | |
| 196 | *Copyright (c) 2023, Arm Limited. All rights reserved.* |
| 197 | |
| 198 | .. _v2.9-rc0-16-g666aec401: https://review.trustedfirmware.org/plugins/gitiles/TF-A/trusted-firmware-a/+/refs/heads/v2.9-rc0-16-g666aec401 |
| 199 | .. _v2.9-rc0: https://review.trustedfirmware.org/plugins/gitiles/TF-A/tf-a-tests/+/refs/tags/v2.9-rc0 |
| 200 | .. _user guide: https://gitlab.arm.com/arm-reference-solutions/arm-reference-solutions-docs/-/blob/master/docs/n1sdp/user-guide.rst |
| 201 | .. _Prebuilt Images: https://downloads.trustedfirmware.org/tf-a/css_scp_2.11.0/n1sdp/release/ |
| 202 | .. _N1SDP: https://developer.arm.com/documentation/101489/latest |
| 203 | .. _Testing Methodology: ../perf/psci-performance-methodology.html |