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 add optimization parameter on Codec Engine?

Dear experts,

 

I am working on Codec Engine, but where to add the optimization parameters?

I add "-mt -o3 -k" in file "examples/config.bld", but, however, it seems it doesn't affect the performance at all, the executable time of DSP side is still same.

What i am wrong? urgently requested, I have spent long time to figure it out. Thank you very much!

 

David

 

  • David,

    Perhaps you could show directly what you did in config.bld?

    The options that you add are in addition to ones already added by the platform.  Your options can be specified as a "prefix" or "suffix" to the platform options, e.g., ccOpts.prefix = "-mt -o3 -k" which would place these options on the command line *before* the ones provided by the platform.  I believe -O2 is used by default, and that -O3 might not give any additional performance on top of -O2 for most C code.  Also, depending on how you added your options in config.bld, the pre-packaged options from the platform might be overriding your's, if they come after your's on the cl6x command line (many options can be re-specified, and the "last" one wins).

    Your executable file is built using 'make', and there should be a file with a .mak extension somewhere under the 'package/cfg' subdirectory of  your executable directory.  This file would contain all the options for the cl6x command, and you could see if your added options are present.

    Finally, you can get "verbose" builds where the complete cl6x command line is displayed during the build.  You can set the env var XDCOPTIONS=v to get a noisy build.

    Regards,

    - Rob

  • Thanks, Dear Rob,

    I made the change on the config.bld as the following, but does not work, I can see the "-k -o3 -mw" are presented when compiling, but the result never change.  thank you!

     

    ================  This is the original one ======================

     *  ======== DSP target ========

     */

    // //original one 

    var remarks =  " " +

    //   "-pdr "     + // enable remarks

       "-pden "    + // enumerate remarks

    //   "-pds=880 " + // variable never referenced

    //   "-pds=552 " + // variable set but not used

    //   "-pds=238 " + // controlling expression is constant

    //   "-pds=681 " + // call cannot be inlined

    //   "-pds=452 " + // long long type is not standard

       "-pds=195 " + // zero used for undefined preprocessing id (setjmp.h)

       "";

     

    ====================   The following is mine ==================

     

     

    var remarks =  " " +

    //   "-pdr "     + // enable remarks

       "-oe -s "      + // enumerate remarks

       "-o3 "         + // add

       "-k "        + // add

       "-mw "        + // add

    //   "-pds=880 " + // variable never referenced

    //   "-pds=552 " + // variable set but not used

    //   "-pds=238 " + // controlling expression is constant

    //   "-pds=681 " + // call cannot be inlined

    //   "-pds=452 " + // long long type is not standard

    //   "-pds=195 " + // zero used for undefined preprocessing id (setjmp.h)

       "";

     

     

     

  • dear David:

            how did you fix this problem?  I encountered this problem too...the configuration is same to you ,but it doesn't work ..

    thanks

  • Can you ensure that the "remarks" variable is actually added to the options variable?  Something similar to the following:
        C64P.ccOpts.prefix += remarks;

    Regards,

    - Rob

     

  • the question has fixed.  the problem is that :you have to leave a blank space  after the compile option ....

        "-o2"+
       "-mt"+
    would cause an warning :

    WARNING: invalid compiler option --o2-mt (ignored) 

         "-o2    "+
       "-mt    "+

    after add the blank space , it works well .....

      Q:  how to add  compile option for single file ?

    for example: In order to know the situation of  software pipelining ,  I want the compiler to generate the   assembling file   for  my   sorting.c file .   but how to add the "-k" option for this file .

    I've tried to add the "-k" option in the "remarks ", but nothing happened.

  • Aaron,
    adding -k option to 'remarks' should generate the assembly file for all sources built by XDCtools. The generated file might be in a different directory from the one with the source file. If you set the environment variable XDCOPTIONS to "v" and post the command line that builds sorting.c, it would be easier to see if '-k' ended up on the command line and where you should look for the generated assembly file.

    Once we figure out that, you can try to add -k only for selected source files. It can be done passing optional attributes to a function call addObjects(), which is invoked somewhere in your package.bld.

  • well, I finally found that the "-k" option really works ,but the  assemble file is not the *.asm as generated in ccs .

    the assemble file generated  in CE  is " *.s64P " file . it is in the package /lib/lib directory of current project dir.

     

    another qustion : in ce, the "-mf5" option  was ignored.  the compiler give an warning  : I cann't interpretation it...