I am trying to measure the clock cycles needed to execute a piece of code on the TMS32064x + DSP that comes with the OMAP ZOOM 3430 MDK. I look at the "Programmers Guide" of the DSP chip, and it says that the DSP supports the clock () function.
What I'm doing is really simple, I'm just doing
start = clock(); for (i=0;i<100;i++){ /* do something here */ } stop = clock(); total = stop - start;
and then put the values ββ"start", "stop" and "total" in the previously allocated shared memory with an ARM processor. Then I just print it on the screen from the ARM side.
The problem is that in my first performance I always get the same βcommonβ value, and then in my next runs I always get 0! The start and stop values ββare the same as the full value.
The strangest thing is that they seem to follow a little pattern! I put the output below:
# ./sampleapp Total = 63744 Start clock() value = 0x000000f9 Stop clock() value = 0x0000f9f9 # ./sampleapp Total = 4177526784 Start clock() value = 0x00f9f9f9 Stop clock() value = 0xf9f9f9f9 # ./sampleapp Total clock cyles = 0 Start clock() value = 0xf9f9f9f9 Stop clock() value = 0xf9f9f9f9
Clock () is obviously not working correctly, but I'm not sure if it is because I am doing it wrong or because this type of thing is not supported by the hardware that I have. Any ideas why this might happen?
c ++ c embedded clock omap
Can bal
source share