I have a C application running on TI CC2650 SENSORTAG microcontroller that performs gesture recognition. Is there any way I can figure out its estimated power usage probably through Raspberry Pi or something, so that I can use it to compare the actual power consumed when I synthesize it on a FPGA? This is an academic project targetted at Hardware acceleration.
-
11\$\begingroup\$ Why not just run it on the pi and measure the power consumed? Its a lot faster (and easier) than formulating some 'estimate' which you have no means of verifying anyway without a physical comparison. \$\endgroup\$– JIm DeardenCommented Aug 2, 2017 at 10:40
-
3\$\begingroup\$ Is there a way to estimate power? Yes. Will it give a meaningful number? Probably not unless you put so much time and effort into it that it would be easier to build it and measure the power draw. And as Jim pointed out what use is an estimate when you have no idea how accurate it is? \$\endgroup\$– AndrewCommented Aug 2, 2017 at 10:44
-
6\$\begingroup\$ One ascii character = 0.00015 Volts of power consumption \$\endgroup\$– HarrichaelCommented Aug 2, 2017 at 15:52
-
\$\begingroup\$ @Harrichael That means I have to multiply 0.00015 volts with the number of ASCII characters in my program? \$\endgroup\$– Shankhadeep MukerjiCommented Aug 2, 2017 at 16:23
-
6\$\begingroup\$ @ShankhadeepMukerji: Harrichael's comment is clearly trolling, because volts is not a unit of power measurement. Do yourself a favor and get in the habit of checking dimensional consistency. \$\endgroup\$– Ben VoigtCommented Aug 2, 2017 at 20:04
2 Answers
Your equivalent question is to measure the length of a plank without a measure.
You can always eyeball it. The Mic datasheet will provide the current consumption under various conditions, with different peripherals turned on. That's your best bet.
What you are trying to do won't really work. First a "C program" doesn't consume a particular amount of power.
A particular program performing a particular task on a particular processor may cause a reasonably measurable increase in power draw by that processor, or not. The power draw of a processor will only change significantly if it would otherwise go into some kind of low power mode if the "program" wasn't running. On many small systems, not doing one thing only means doing more of other things. The only effect of running a particular piece of code might be to respond with higher latency to new events, for example.
Even if you can measure a reasonably repeatable power increase in one processor due to running a particular program, that is little indication of anything useful for the same task performed some other way using different technology. You really should not expect the power increase due to a RPi running a particular program to have a meaningful correlation to the power required to run a FPGA that performs the same function.
-
3\$\begingroup\$ Actually there is a way I have found in some literature. The Microcontroller has a instruction set where each instruction needs a specific amount of power. He can translate his program into assembler code to get all instruction. Than he knows exactly what instructions are executed and can calculate the consumed power by adding the required power for each instruction. The only problem is finding out the power consumption per Instruction. Maybe it can be found in the datasheet or he can ask the TI support for some information \$\endgroup\$– S.GCommented Aug 2, 2017 at 11:23
-
3\$\begingroup\$ @S.G The main problem here is the C -> FPGA translation, estimating how much power it would take on a Raspberry Pi is likely easier. \$\endgroup\$– pipeCommented Aug 2, 2017 at 11:25
-
8\$\begingroup\$ @S.G: It seems he wants to find the power required on a RPi, then use that to estimate power for the same task implemented in a FPGA. Basically, that's just plain not going to work. \$\endgroup\$ Commented Aug 2, 2017 at 11:40
-
3\$\begingroup\$ @S.G: Nobody knows or cares about the power consumption of individual instructions executed. Just think about how the data processed will have a great influence. \$\endgroup\$– JimmyBCommented Aug 2, 2017 at 11:51
-
5\$\begingroup\$ @S.G "the power consumption is influenced by the amount of data" - Not only the amount of data, but also the data itself. The most obvious example:
if ( x == y ) { doSomething(); }
- Vastly different resource use depending on whether or notx==y
at runtime. More subtle differences may be found in things likex++
. This may require a little more (or less?) power if x overflows for instance. \$\endgroup\$– JimmyBCommented Aug 2, 2017 at 12:24