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.

DSP/BIOS PRD functions timer accuracy

Hello,

i have a project running on my c64x+ core which also includes the NDK for reception of udp streams. What i want to have established is, that a function that processes these packets is called periodically. It is quite important for me that the period time is accurate.

So i added my function to the PRD manager in the DSP/BIOS Gui to be run every 1 millisecond which works fine.

Question is how to interpret the cycles measured between two calls of this function which is around 10443XX to 10449XX cycles. The DSP is runnning at 1GHz so the cycles refer to 1.0443 to 1.0449 ms.

The way I understand the PRD is that it uses one of the DSPs timers together with HWI to trigger ticks to the CLK which runs the PRD's SWI every 1 ms, right?

Is this the best accuracy I can get for the period of calling my function or is there another way or trick to get that more precisely?

Regards,

Mathias

  • Mathias,

    DSP BIOS reserves one hw timer for himself in order to run the scheduler (because the scheduler needs a periodic interrupt from the hw timer).


    This timer will be assigned by default if you do not specify differently in the clock manager configuration. You can check the clock manager configuration to configure BIOS to use another timer

    Having one hw timer being used for driving the BIOS kernel is the typical configuration, and the timer selection by BIOS can be customized as mentioned in order to allow the application to use another timer (when available) for custom purposes.  Usage of any timer for BIOS is completely transparent to the OS and does not have any specific counter effect

    I believe the DSP/BIOS timer usage is for the following:

    - TSK-based timeouts for TSK_sleep, SEM_pend
    - Running CLK objects
    - Running PRD objects
    - Calculating CPU load

    I would advise you to look at the following application note: spra829, DSPBIOS Timers and Benchmarking Tips
    since it describes in detail how the timer is used by BIOS for its internals. In the application note there is a good diagram that shows the link relation between the timer configuration and the callback functions that are associated (like PRD_tick(),TSK_tick() ). It should also help in understanding the meaning of the timer ticks and the configuration, however I believe you got it almost right.

    Please refer to the mentioned application note for the details. Most further information about BIOS internals is mentioned in the BIOS user guide, spru423

    To add periodic functions (if you need more time-based functions), one way could be as you mentioned to add them as periodic functions in the BIOS configurations, so that basically these functions will be run (called) when the BIOS timer tick expires. Of course there will be some overhead because of the OS, and you can look into the benchmarking data (shipped with each BIOS release under \packages\ti\bios\benchmarks) to have a better indication of the cycles measured for several scenarios (like task switches, semaphores etc)


    Another possibility could be to directly use a hw timer, if available, and have this trigger  your processing task via a SWI or semaphore

    Hope this helps.