This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA2SX: Measure run-time in milli-seconds on EVE

Part Number: TDA2SX

Hello TI,

I would like to measure the run-time of some special code-segments.

Plan is to set starttime on ARP32, than runs some codes on ARP32, switch to VCOP for running some operations and than go back to ARP32 to take further stuff. Than I measure second time and build difference. Thus I would get the complete time. With this difference I calculate my run-time.

I am not sure about the documentation with EVE benchmarking. For general, there are two methods to mesaure run-time.

  1. With _tsc_gettime(), that read TCSL register.
  2. SCTM_Counter with VCOP_BUSY as config

When I look at your example code, I see that differences between start and end times were always multiplicated by 2. Reason of TI is, that VCOP runs twice cycle frequency than ARP32. 

But I don't get this reason. The processor runs with this frequency. Why is it important to mulitplicate with 2? And why you do this by both methods? --> Look above

It is possible to get my run-time in milli-seconds with following steps:

  • t_start = _tsc_gettime();
    Do some stuff on ARP32 and VCOP
    t_end = _tsc_gettime();
    (t_end - t_start) / 250.000 = t in ms
    Or I have to do like this ((t_end - t_start)<<1) / 250.000
    Thank you Slight smile

  • Hi,

    But I don't get this reason. The processor runs with this frequency. Why is it important to mulitplicate with 2? And why you do this by both methods? --> Look above

        SCTM and ARP32 modules runs at half the clock frequency of VCOP and typically all the performances are reported in terms of VCOP cycles and that's the reason of multiplication by 2. Now in-order to convert to time if you are measuring in terms of VCOP clock then you should divide the cycles by its clock frequency ( typically this is 500MHz, but depends on actual device). 

     So if you are simply reading the tsc counter then following should be enough : 

        (t_end - t_start) / 250.000 = t in ms ( no need to multiply by 2)

       The same equation can also be written in terms of VCOP frequency as : 

        (t_end - t_start) << 1 / 500.000   ( here we have multiplied by 2 because we are reporting the cycles in terms of VCOP cycles)

       Hope this clarifies your doubt.


    Regards,

    Anshu