Calculate time to execute instructions?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Calculate time to execute instructions?

639 Views
stevenstarnes
Contributor III

Hello,

   I am using a T2080 with a 1.8Ghz clock and I am trying to calculate the time to execute a while loop. I have the assembly instructions for the while loop and calculated based on the timing execution table in the E6500 reference manual that each loop will take 29 cycles to complete. The loop is a polling a loop that should be exited after 100ms (decrementer interrupt) so my formula to calculate my timeout variable would be:

((1.8Ghz/ 1000) * 100ms) / 29 cycles =  ~6206896 iterations through my  while loop. 

This value is way to high and I have been printing my count variable in the loop and getting approximately 10300 iterations through my while loop. If someone could help guide me along the correct path that would be much appreciated. Thank you.

Labels (1)
0 Kudos
1 Reply

547 Views
bpe
NXP Employee
NXP Employee

e6500 core is a pipelined, multiple execution units architecture with
sophisticated instruction dispatch mechanism, so it may be not quite
obvious where it spends extra cycles and why. Beside that, if your
loop is polling a memory location, the timing will depend on the
cache policy, bus timing (if cache-inhibited), coherency protocol.
The suggestion in this regard is to us CodeWarrior Trace and Analysis
tools to see what exactly happens. More details can be found at the
link below:

https://freescale.sdlproducts.com/LiveContent/content/en-US/CodeWarrior_PA_Knowledge_Center/GUID-B68...


Have a great day,
Platon

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------