Hi,

We see that the standard C function "clock_t clock()" is implemented and can be used for the ADSP21489. My question is -- exactly how is this implemented internally? Does the ADSP21489 have a kind of "master timer" that is always running (like, for example, modern Intel processors in the PC) and which gives high resolution timing information? If so, where can we find documentation about that timer.

Thank you,

Marc

Hi Marc,

Regarding “We see that the standard C function "clock_t clock()" is implemented and can be used for the ADSP21489. My question is -- exactly how is this implemented internally? Does the ADSP21489 have a kind of "master timer" that is always running (like, for example, modern Intel processors in the PC) and which gives high resolution timing information? If so, where can we find documentation about that timer.”

>> This function does not make use of any internal timer.

In C, the clock function is defined to return the number of implementation dependent clock “ticks” that have elapsed since the program began, so this function basically returns the number of processor clock that the application has used.

So in order to evaluate the amount of time the application takes , we generally use this function at the start and end of the function. And on subtracting the two, we obtain the number of processor clock (PCLK) cycles taken by the application. In this way it is used to measure the cycle counts.

Using above method applications can be benchmarked with respect to how many processor cycles they use.

Since we typically benchmark application with respect to how much time (for example, in seconds) that they take, so we divide this value with the processor clock rate to achieve the time taken.

Hope this helps.

Please let me know in case you have any further queries/doubts.

Thanks,

Harshit