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.

How to evaluate the execution time of a routine for c6747?

1. I want to use the hardware timer on c6747 to get the execution time of a routine. For some old version DSP, I add a head file called csl_timer.h, but there is no csl for 6747. I also download cslr package, and there is no csl_timer.h yet. How can I deal with it? (The development environment I am using is ccs 5.4)

2. Run --> Clock --> Enable. Is this an accurate method to evaluate the execution time?

  • Hi qinancy,

    Thanks for your post.

     In my opinion, the easiest way to accomplish this is to use either the profiler within CCS or the on-chip timers. The profiler is used to measure cycle counts for entire functions, ranges of code, etc. Also, if you are interested, you could use the pseudo code as below:

    ---------------------------------------------------------------------------------------
    /*Random code*/
    int cycle_count = 0;
    int clock_start, clock_stop, overhead;

    /* Configure timer registers */
    timer_config();

    /* Determine timer start/stop overhead */
    clock_start = timer_count_value; // Current count value
    start_timer();
    stop_timer();
    clock_stop = timer_count_value; // New current count value
    overhead = clock_stop - clock_start; // Overhead to start and stop the timer. This can be saved and reused later in the program

    clock_start = timer_count_value;
    start_timer();
    run_your_function_here();
    stop_timer();
    clock_stop = timer_count_value;

    cycle_count = clock_stop - clock_start - overhead; // # of cycles to execute function
     -------------------------------------------------------------------------------------------------------------------------------------
     
    Alternatively, you could find CSL timer examples from the BIOSPSP package which can be found here:

    http://software-dl.ti.com/dsps/dsps_registered_sw/sdo_sb/targetcontent/psp/bios_psp/1.30.xx/1.30.00.05/BIOSPSP_01_30_00_05_Setup.exe

    The example would be located as per below directory after installation of above package:

    \packages\ti\pspiom\cslr\evm6747\examples\timer\

    I hope, the above would help you better.

    Thanks & regards,

    Sivaraj K

    ------------------------------------------------------------------------------
    Please click the
    Verify Answer button on this post if it answers your question.
    ------------------------------------------------------------------------------