UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor bharat1995
Visitor
561 Views
Registered: ‎07-11-2018

Measure power consumption of a code on an ARM processor on linux (of Zedboard) using cross-compiled PAPI

Hi,

I have been trying to measure power consumption of he algorithms that I have been working on so far and was sure that PAPI(tool) supports calling hardware events and there is a way to measure power consumed by the Arm processor running Digilent's linux, on the Zynq 7000 series all-programmable SoC of the Zedboard.

However, I have dug into how to cross-compile and configure PAPI on a regular X86_64 architecture like with an intel Skylake processor but, could have any luck as to how exactly PAPI could be configured for ARM A9 first and then cross-compile a piece of code such that it would spit out how much power got consumed by running the algorithm.

Is there any other way to measure power consumed by a code (say a matrix multiplication c/c++ code) with say some calls in it, reading hardware counters.

I tried to configure PAPI on an intel X86_64 processor for use on Arm Cortex A9 with armv7l architecture, using the options as follows:

./configure --with-CPU=arm --with-arch=armv7l --with-os=linux --with-libpfm4 --with-perf-tools --with-ffsll --with-waltimer=cycle --with-virtualtimer=clock_cputime_id --with-tls=__thread CC="arm-linux-gnueabi-gcc" CXX="arm-linux-gnueabi-g++" --host=arm-none-linux-gnueabi

I wasn't sure as to these options would configure properly for the arm processor and am looking for help with this and also after I configure it, How do I measure the power and which of the specific functions in PAPI would measure power consumption? And how do I frame them properly?

Any help is appreciated. You can also email me at bharadwaj.gorthy@gmail.com if any.

Thank you

0 Kudos
3 Replies
Xilinx Employee
Xilinx Employee
508 Views
Registered: ‎06-30-2010

Re: Measure power consumption of a code on an ARM processor on linux (of Zedboard) using cross-compiled PAPI

Apologies but i am not familiar with PAPI, does it use an I2C bus to read out the current and voltage at the time the command is run to give a power reading?

On our demo boards we have either a Maxim or TI Pm Bus that can be used to measure the power on each of the rails.

There is an associated resolution of this bus as well, how long will the function be active?

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Visitor bharat1995
Visitor
470 Views
Registered: ‎07-11-2018

Re: Measure power consumption of a code on an ARM processor on linux (of Zedboard) using cross-compiled PAPI

Hi jheslip,

PAPI is a Performance API tool which can be cross-compiled for ARM processors on any of the boards as a matter of fact and should work on the Zedboard to. The way how PAPI works is that it has function calls which interact with the hardware performance counters that are there on the ARM processors. Whilst there are 6 hardware performance counters on the ARM processor in the Zedboard or any ARM Cortext-A9 MPCore processor to that fact, these ARM processors do not have the hardware counters that can probe into the Power rails is what I have found out.

 

However, I was able to get a rough estimate of power from the pins on J21 by reading an ideal power consumption and after booting linux on the Arm processor and running the code on it gave another reading and by subtracting the run-time power from the idle power, I roughly estimated it to be the power that was consumed by the entire process but was never able to measure the consumption on a fine-grain level.

 

You said, and I quote, " On our demo boards we have either a Maxim or TI Pm Bus that can be used to measure the power on each of the rails. " 

My query on this is that how do you do it? and what are the demo boards that you were referring to. I am sure the zc702 is much more sophisticated than the Zedboard but I was working on the zedboards and I did not find a way to measure power "when a code was implemented on an ARM processor with linux running on it" and not using any of the Vivado tools.


And I did not properly understand your question and the rest in this particular sentence that you mentioned in the last that
" There is an associated resolution of this bus as well, how long will the function be active? "


Looking forward for a reply. Thank you for responding to my post.

0 Kudos
Xilinx Employee
Xilinx Employee
440 Views
Registered: ‎06-30-2010

Re: Measure power consumption of a code on an ARM processor on linux (of Zedboard) using cross-compiled PAPI

hi @ bharat1995 I can't comment on the PAPI support, perhaps another user can. I did have a look in the TRM and SW DEV guide and did not see any mention of it.

Regarding the following:
You said, and I quote, " On our demo boards we have either a Maxim or TI Pm Bus that can be used to measure the power on each of the rails. "

Depending on the board we have a PM bus that is either from TI or maxim that will allow you to monitor each of the rails via a USB cable that you get for free when you contact the respective company. The Zed board does not have this functionality.

For this:
" There is an associated resolution of this bus as well, how long will the function be active? "
ThePM Bus has an update frequency so if the function you are calling is very fast then you may not catch it, however, it looks like you are just measuring the power when the ARM is active and if so the PM Bus would catch that.
-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos