Power Capture in CWNANO

Hello everyone, I am working with CWNANO board and I want to analyze parts of the power consumption curve that corresponds to multiplication operation performed in the target followed by parts that correspond to addition operation.
So I am doing something like f=xy+(x+y) and capturing the power consumption from this operation. But how do I create a one on one mapping between the C code and the power consumption trace i.e. how do I know which lines in the C code correspond to the trace? Any help is appreciated.

Thanks for your reply. I am fairly new to this but I am using CWNANO and I don’t think it will work on CWNANO. But I get your point that I may have to analyze the waveforms manually and correlate it to the assembly instructions from the .lss file generated during the build.

My power consumption plot looks like this. I am trying to multiply two numbers and add it to the result for a 100 iterations in a for loop. I assume the power actual operation starts from 10000 samples? Do the first 10000 samples correspond to other non-related operations being performed in the target side MCU?

That is between you and your compiler! :wink:

One simple thing you can do is look at how many cycles the TIO4 line is high. If you raise TIO4 at the start of your target operation, and clear it at the end, then you know how long it takes. From there you can change the time where TIO4 is cleared, etc…
With the nano you’ll need to measure TIO4 with an external scope or logic analyzer (with other CW capture devices you can simply read scope.adc.trig_count; that feature is not available on the nano).