Other Parts Discussed in Thread: HALCOGEN
Tool/software:
Hi TI Team,
I am using the RTI module on the TMS570LC4357 processor for timing analysis. I enabled the RTI driver in HALCoGen, generated the code, and initialized it as follows:
volatile uint64 i = 0; uint32 get_start_tick, get_end_tick = 0; float elapsed_time_ms = 0; uint32 rti_clock_freq = (75 * 1000000); // 75 MHz rtiInit(); rtiStartCounter(rtiREG1, rtiCOUNTER_BLOCK0); get_start_tick = rtiGetCurrentTick(rtiREG1, rtiCOMPARE0); for (i = 0; i < 1000000; i++); // Dummy loop to check the timing get_end_tick = rtiGetCurrentTick(rtiREG1, rtiCOMPARE0); rtiStopCounter(rtiREG1, rtiCOUNTER_BLOCK0); elapsed_time_ms = (float)((get_end_tick - get_start_tick) * 1000) / rti_clock_freq;

I assumed this approach would give the elapsed time in microseconds, so I multiplied the result by 1000 to convert it to milliseconds. I calculated the elapsed time and obtained approximately 0.0834 ms.
Could you please confirm if my assumptions and function usage from the RTI module are correct, or if I am missing something?
Thank you!