+ Post New Thread
Results 1 to 4 of 4

20th March 2020, 14:46 #1
 Join Date
 Apr 2017
 Posts
 6
 Helped
 0 / 0
 Points
 575
 Level
 5
How to evaluate the energy of an arithmetic operation
Hi,
I have an ALU described in SV, with the corresponding Testbench that takes some input vectors, feeds them into the ALU, gets the result and then compares with the expected result.
The Testbench dumps a VCD file that, combined with the gatelevel netlist, is fed to PrimeTime for time_based and average power evaluation. And I get the power waveform showing how the power varies in time. The Waveform is in FSDB format, and I can visualize it using the Synopsys Verdi tool.
Now, what I would like to do, is for each particular instruction (say addition, multiplication ...) in the testbench I would like to estimate the amount of energy spent. Since, some operations like addition would take only one cycle, but others (like sqrt/div) are iterative and they take more cycles. So I guess reasoning about energy per operation would be a more meaningful metric, say to compare the energy effeciency of several ALU architectures for example. (Am I right ?)
So my question is, is there any standard/usual/easy way to do this process?
I thought actually about coding a whole Python tool that would go throught the power waveform and integrate over time for each instruction. It could take a lot of time to build and test it. Any recommendations about that?
Is it possible to do this kind of stuff in Verdi itself? Or is PrimeTime capable of outputting the Energy values instead of time_based power?

Advertisement

21st March 2020, 04:12 #2
 Join Date
 Jan 2019
 Location
 Taiwan
 Posts
 14
 Helped
 2 / 2
 Points
 291
 Level
 3
Re: How to evaluate the energy of an arithmetic operation
The power report of PrimeTimePX does give us the average power consumption of a circuit. You can multiply the reported power by the total simulation time to get the amount of energy consumed by each function.
Let's say you have 7 different functions. You can write 7 different testbenches, each one tests for a single function of your circuit. They should have different simulation time (e.g. 1st function 1 cycle, 2nd function 2 cycles etc.); and you can have PrimeTimePX to report power for each simulation waveform.

Advertisement

21st March 2020, 10:10 #3
 Join Date
 Apr 2016
 Posts
 1,915
 Helped
 337 / 337
 Points
 9,182
 Level
 22

Advertisement

26th March 2020, 16:04 #4
 Join Date
 Apr 2017
 Posts
 6
 Helped
 0 / 0
 Points
 575
 Level
 5
Re: How to evaluate the energy of an arithmetic operation
Thank you for you answers!
I actually came across something that could simplify things (since I actually have a few dozens of instructions, so running each benchmark alone will take a hell lot of time).
So apparently when using the read_vcd command in PrimeTime, it is possible to specify a boolean condition using the `when` argument. So now, I have a full testbench that performs all the instructions and I record everything in a VCD or FSDB activity file, then I read the VCD multiple times (one for each instruction i). I have an input signal in the ALU called "op" which specifies the operation to perform. So the idea is to record the vcd when op is equal to the instruction i 's binary opcode. I find this way more 'automatable'. What do you think guys?
+ Post New Thread
Please login