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.

Using CLK functions in DSP/BIOS under Codec Engine

Other Parts Discussed in Thread: OMAP3530

Hello,

I would like to query the high resolution clock in DSP/BIOS within my own codec in Codec Engine (iUniversal; on the target device, not in CCS). What files do I need to #include and how do I have to change makefiles or any configuration files?

The functions I would like to use are CLK_countspms(), CLK_cpuCyclesPerHtime(), CLK_gethtime().

The codec is based on a template created with the codec generation wizard, the server was created in a similar way (wizard). The application is based on a Codec Engine example.

My setup:
OMAP 3530
codec_engine_2_26_02_11
dsplink_linux_1_65_00_03
xdctools_3_20_08_88
bios_5_41_10_36
TMS320C6000 C/C++ CODE GENERATION TOOLS 7.3.0

Please understand that I do not want to update to SYS/BIOS at the moment.

I want to use the CLK functions for profiling. Using CE_DEBUG as explained in the following link significantly increases my DSP CPU load.
http://processors.wiki.ti.com/index.php/Codec_Engine_Profiling#Profiling_DSP-side_process.28.29_calls_in_an_ARM.2BDSP_environment


Thank you very much.

  • Alex,

    I think you just need this include:

    #include <clk.h>

    And probably no need to change any makefile or other configuration settings (unless the CLK module is disabled in your configuration, but I doubt that).

    Note that on OMAP3530 the high resolution time value from CLK_gethtime() is in units of DSP cycles (directly from the C64x+ timestamp counter).  And CLK_cpuCyclesPerHtime() should return a value of “1”, regardless of other configuration parameters. 

    Scott

  • Hi Scott,

    thank you for your reply.

    I had to #include std.h and clk.h with the absolute path within BIOS into my codec source code. What is the clean way of providing the include path when using a BASH environment variable for the absolute path to BIOS? I guess I have to somehow modify config.bld, package.xs, or some other file.

    Furthermore, CLK_countspms() yields 360000. As I believe the DSP core in my OMAP3530 is 430 MHz, shouldn't the result be 430000 instead?

    Other than that, it seems to work. Thanks again.

  • Alex,

    OK, thanks.  I didn’t realize you were adding this to the actual codec source, but thought the calls were being added to a component that was already making BIOS calls.  Usually the codec sources are left OS-free to simplify portability.  Yes, I expect there will be some configuration tweaks that are needed to avoid using absolute paths.  If you need to do this, let me know and I’ll ask the CE team to see what they recommend.

    Yes, if the DSP is running at 430MHz, and you have CLK configured for 1msec ticks, I would have expected 430000 from CLK_countspms().  It seems that the clock configuration (via GEL file, or ARM-side code?) is off?  Maybe the device is running at a lower operating point during this benchmark?

    Scott