Skip to content

Power Profiling an ARM Application

Asbjørn Djupdal edited this page Jan 17, 2020 · 3 revisions

Introduction

This guide is a short tutorial on how to perform power profiling of an embedded application. You should first read the General Power Measurements guide, as it will provide useful background.

In addition to perform power measurements, as was done in the General Power Measurements guide, Lynsyn can also at the same time perform program counter (PC) measurements of the system being measured. This makes it possible to correlate the power measurements with the application source code, and thus see which parts of the application is responsible for the energy consumption.

Tool Configuration

JTAG PC sampling requires that the Lynsyn board knows about the JTAG chain on the board it is measuring. Most of the information is automatically probed by Lynsyn, but some properties of the devices on the JTAG chain can not be automatically determined. Those must, therefore, be specified by the user through a config file. The provided config file already has information about several common devices, but if your system has extra devices not present in the provided config file, information about these must be entered.

See JTAG device list for more information on this.

Connecting Lynsyn Lite

Lynsyn Lite Connected

Just as for the General Power Measurements guide, you will also in this guide need to connect Lynsyn Lite to the target systems power supply. Here we will also do PC sampling, so JTAG must also be connected. Connect the target JTAG port on Lynsyn Lite to the JTAG connector on the target system. This might require an adapter if the target board uses a JTAG connector different from the ARM 20 pin connector. The picture above shows all connections.

Lynsyn Lite ports

The picture above shows the orientation of the JTAG connector on the Lynsyn Lite. Make sure to orient the JTAG cable correctly, with pin 1 at the upper left.

Power Profiling an Application

Open the lynsyn_viewer application. The following window should appear:

Lynsyn Viewer

Press the "Profile" toolbar button. If Lynsyn was correctly connected and the target platform is turned on, the following window will appear:

Profile Dialog

To do a full application power profile with a specified start and stop, do the following:

  • Select "Use Breakpoints"
  • Fill in a start breakpoint. One possibility is "main", which will then start profiling at the start of the application.
  • Fill in a stop breakpoint. One possibility is "_exit", which will stop profiling at the end of the application.
  • Fill in the name (and path) of the elf file of the application you want to profile.
  • Select the CPU core(s) where the application will be running.

Press OK. Lynsyn will now monitor the target and wait until the target reaches the start breakpoint. Manually start the application on the target and lynsyn will start sampling. When the application exits, lynsyn will stop sampling and the lynsyn_viewer will show the profile data:

Profile graph

This graph is the same one you got from the General Power Measurements guide, but has some extra information on the bottom. There you can see the active functions of the application on the same time scale as the power measurements.

Table View

In addition, there is another profile view that is useful when doing PC sampling. Click the "Profile Table" tab and the profile table as shown above appears.

The table shows the list of all functions with time, energy and average power spent by each function. Note that this table shows "self" data, not accumulative data. This means that a function will only show the time/power/energy for the part that is exclusivly within the function itself, not including any called functions.