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.

Codec Engine Algorithm Compiler Options

Other Parts Discussed in Thread: SYSBIOS, CCSTUDIO

I am using CCSv5 under Linux.  I used gencodecpkg to create an IUNIVERSAL algorithm for use with codec engine on a DaVinci DM6467T.  I want to optimize the algorithm for speed, and need some insight into compiler options.  I read through chapter 9 of the C6000 workshop book, and want to try a few of the compiler options.  Where can I see what options are already being set, and how do I modify them?

Thanks.

  • Here's the link to the course and book I referred to.

    Book:

    http://software-dl.ti.com/trainingTTO/trainingTTO_public_sw/bios/SYSBIOS_Workshop_Student_Guide_Rev6_20.pdf

    Course:

    http://processors.wiki.ti.com/index.php/C6000_Embedded_Design_Workshop_Using_BIOS

  • When creating an Codec package from scratch using the Codec Engines GenCodePkg, you'll have a config.bld file at the root of the package.  This file will contain a "targ.ccOpts.suffix" line which includes the compiler option used for a particular chosen target (e.g. 64P, C674, etc).  This is where you can add any additional compiler options to your algorithm build.  The targets used (e.g. ti.targets.C64P) in addition to the "targ.ccOpts.suffix" line contains a base set of options.  You can see what these base options are in the RTSC (XDCTools documentation) available in docs directory of your XDCTools installation, in CCStudio help, or online at:

    http://rtsc.eclipse.org/docs-tip/Existing_Targets

  • You can also find additional info on the Codec Engine GenCodecPkg on TI's Wiki:

    http://processors.wiki.ti.com/index.php/Codec_Engine_GenCodecPkg_Wizard_FAQ

  • Thanks for the help.  Getting close, but not quite there yet.

    In short, how do I force optimization level 3 (-O3)?  In detail...

    Modifications to defaults:

    1) makefile - added verbose option for XDC, to print all compilation commands
    XDCOPTIONS := -v

    2) config.bld - removed two options to from targ.ccOps.prefix, added four ptions to targ.ccOpts.suffix
    targ.ccOpts.prefix = " ";
    targ.ccOpts.suffix = "-mi10 -mo --verbose -k -mw -O3"

    The resulting command, printed to the consle when I select Project->Build All, that compiles my algorith source file, generic.c, is as follows:

    #
    # cl64P generic.c ...
    /home/suas/dvsdk/dvsdk_3_10_00_19/ti_cgt_c6000_7_3_0/bin/cl6x -c    -mv64p -eo.o64P -ea.s64P -mi10 -mo --verbose -k -mw -O3 -Dxdc_target_name__=C64P -Dxdc_target_types__=ti/targets/std.h -Dxdc_bld__profile_release -Dxdc_bld__vers_1_0_7_3_0 -O2  -I. -I/home/suas/dvsdk/dvsdk_3_10_00_19/codec_engine_2_25_05_16/packages -I/home/suas/dvsdk/dvsdk_3_10_00_19/xdais_6_25_02_11/packages -I./ -I/home/suas/dvsdk/dvsdk_3_10_00_19/xdctools_3_16_01_27/packages -I../.. -I/home/suas/dvsdk/dvsdk_3_10_00_19/ti_cgt_c6000_7_3_0/include -fs=./package/lib/lib/release/generic -fr=./package/lib/lib/release/generic -fc generic.c
    TMS320C6x C/C++ Compiler                v7.3.0

    Where does the -O2 come from (after the defines, before the includes)?  How do I eliminate it?  When the compiler sees both -O2 and -O3, -O2 wins (maybe the last argument wins?).  Here's the output, indicating optimization level 2, taken from "../dvsdk_3_10_00_19/cs2dm6467_1_00_00_10/packages/gr/generic/package/lib/lib/release/generic/generic.s64P"

    ;******************************************************************************
    ;* TMS320C6x C/C++ Codegen                                        Unix v7.3.0 *
    ;* Date/Time created: Fri Mar  2 13:17:00 2012                                *
    ;******************************************************************************
        .compiler_opts --abi=coffabi --c64p_l1d_workaround=default --endian=little --hll_source=on --long_precision_bits=40 --mem_model:code=near --mem_model:const=data --mem_model:data=far_aggregates --object_format=coff --silicon_version=6500 --symdebug:skeletal

    ;******************************************************************************
    ;* GLOBAL FILE PARAMETERS                                                     *
    ;*                                                                            *
    ;*   Architecture      : TMS320C64x+                                          *
    ;*   Optimization      : Enabled at level 2                                   *
    ;*   Optimizing for    : Speed                                                *
    ;*                       Based on options: -o2, no -ms                        *
    ;*   Endian            : Little                                               *
    ;*   Interrupt Thrshld : 10                                                   *
    ;*   Data Access Model : Far Aggregate Data                                   *
    ;*   Pipelining        : Enabled                                              *
    ;*   Speculate Loads   : Enabled with threshold = 0                           *
    ;*   Memory Aliases    : Presume are aliases (pessimistic)                    *
    ;*   Debug Info        : DWARF Debug for Program Analysis w/Optimization      *
    ;*                                                                            *
    ;******************************************************************************

  • -O2 comes from the profile options that are automatically added when you select a profile ('release' in your case). I don't know if Codec Engine offers any other way to change profile options, but one way to do it is to add the following to your config.bld:
    targ.profiles["release"].compileOpts.copts = "";

  • Thanks Sasha and Arnie.  Those two parts combined did the trick.

    Now, on to see if I can get any real software pipelining out of this thing. 

    Appreciate your help.