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.

measuring time - DSP 674

Expert 1100 points

Hello,

Does anyone know what  is the simplest way to measure time on DSP 674 on Netra ?

Thanks.

  • Alla,

    There is no DSP 674. Which device do you mean to ask about?

    Which board are you using, your own or an EVM?

    What kind of time do you want to measure, GMT or DSP clock cycles or between two events or other?

    Regards,
    RandyP

  • RandyP,

     

     

    I'm using netra ti 816x , the dsp core is c674x. I'm using 3'rd party board (z3).

    I want to measure DSP clock cycles of some functions. 

     

    Thanks,

    Alla.

     

  • Alla,

    You can use the following in some cases:

    #include <c6h.x>

    unsigned int uCalTime, ulStartTime, uEndTime, uBenchTime;

    main()
    {

     TSCL = 0;

     ullStartTime = TSCL;
     ullCalTime = TSCL;
     ullCalTime -= ullStartTime;

     ullStartTime = TSCL;
     <code to be measured>
     ullEndTime = TSCL;
     ullBenchTime = ullEndTime - ullStartTime - ullCalTime;

    }

    But the TSC (described in CPU & Instruction Set Reference Guide) is 64-bits, while just the TSCL half will overflow every 4G cycles. If this is a problem, then you will need to use a full 64-bit access. The version above is useful in most cases.

    Regards,
    RandyP

     

    If you need more help, please reply back. If this answers the question, please click  Verify Answer  , below.

  • Thank you very much, it is very helpful.