开发者

Estimate Power Consumption Based on Running Time Analysis / Code Size

开发者 https://www.devze.com 2022-12-09 03:49 出处:网络
I\'ve developed and tested a C program o开发者_JS百科n my PC and now I want to give an estimate of the power consumption required for the program to do a single run. I\'ve analysised the running time

I've developed and tested a C program o开发者_JS百科n my PC and now I want to give an estimate of the power consumption required for the program to do a single run. I've analysised the running time of the application and of invidiual function calls within the application and I know the code size both in assembly lines, but also raw C lines.

How would I give an estimate of the power consumption based on the performance analysis and/code size? I suppose it scales with the amount of lines that uses the CPU for computations or does memory access but I was hoping for a more precise answer.

Also, how would I tell the difference between the power consumption on say my PC compared to a on a microchip device?


Good luck. What you want to do is pretty much impossible on a desktop PC. Best you could probably do would be to measure the from-the-wall power draw at idle, and when running your program, with as few other programs as possible running at the same time. Average the results over 100 or so runs, and you should have a value with accuracy of a few percent (standard statistical disclaimers apply).

On a Microchip device, it should be easier to calculate the power consumption, since they publish (average) power consumption values for the various modes, and the timing is deterministic. Unfortunately, there are so many differences between a processor like that and your desktop processor (word size, pipelining, multiple-issue, multiple processes, etc, etc) that there really won't be any effective way to compare the two.


There is a paper on Intel's website that gives average energy per instruction for various processors. They give 11 nJ per instruction for Core Duo, for example. How useful that'll be for you depends on how much your code looks like the SpecInt benchmark, I guess.

0

精彩评论

暂无评论...
验证码 换一张
取 消