PDA

View Full Version : Cycle count


Paul
06-08-2008, 05:27 PM
i have an issue regarding cycle count. When we are getting the cycle count using get_cycle(),what is the timer unit. Moreover is there any clock inside the csx board..

Thanks

Dangermouse
06-09-2008, 12:44 PM
Hi Paul,

When we are getting the cycle count using get_cycle(),what is the timer unit.

The Cn Standard Library Reference Manual describes the get_cycles() function as returning the number of cycles since the device was booted, by calling this at the beginning and end of the code you want to time you get an absolute number of cycles. To convert this into time you need to know the clock frequency of the device.

You can determine the clock frequency in two ways:

To obtain the frequency as a one-off, run csreset -v and the frequency is displayed
To obtain the frequency within a program, call the CSAPI_status function from your host code with the CSU_ProcCoreFrequency status type, see the Runtime User Guide for more information


Moreover is there any clock inside the csx board.

There is no real time clock on the board, you will need to use the cycle counters where possible or the host's clock instead. Can you give more details of what you are trying to do?

Hope this helps,
Tom.