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.

Code size Compiler version TI v6.4.3 versus TI v6.2.11

Other Parts Discussed in Thread: CCSTUDIO, TMS320F2812

After updating CCS to 6.1.0 with new compiler version 6.4.3 code size is much more bigger than before.

When I change back do compiler version 6.2.11 code size is smaller and fit into memory.

But when I switch back I got 5 warnings in profect,log:

!CONFIGURATION: 'com.ti.ccstudio.buildDefinitions.C2000.Release.776703799' [Thu Apr 16 10:48:37 CEST 2015]
    !TOOL: 'com.ti.ccstudio.buildDefinitions.C2000_6.2.exe.compilerRelease.1628245080'
        !WARNING: Unresolved option: com.ti.ccstudio.buildDefinitions.C2000_6.2.compilerID.ADVICE__PERFORMANCE
    !TOOL: 'com.ti.ccstudio.buildDefinitions.C2000_6.2.exe.linkerRelease.262994007'
        !WARNING: Unresolved option: com.ti.ccstudio.buildDefinitions.C2000_6.2.linkerID.COMPRESS_DWARF
!CONFIGURATION: 'com.ti.ccstudio.buildDefinitions.C2000.Release.776703799' [Thu Apr 16 11:20:40 CEST 2015]
    !TOOL: 'com.ti.ccstudio.buildDefinitions.C2000_6.2.exe.compilerRelease.1924627109'
        !WARNING: Unresolved option: com.ti.ccstudio.buildDefinitions.C2000_6.2.compilerID.ADVICE__PERFORMANCE
    !TOOL: 'com.ti.ccstudio.buildDefinitions.C2000_6.2.exe.linkerRelease.969556622'
        !WARNING: Unresolved option: com.ti.ccstudio.buildDefinitions.C2000_6.2.linkerID.COMPRESS_DWARF
!CONFIGURATION: 'com.ti.ccstudio.buildDefinitions.C2000.Release.776703799' [Thu Apr 16 13:04:06 CEST 2015]
    !TOOL: 'com.ti.ccstudio.buildDefinitions.C2000_6.2.exe.compilerRelease.1138908242'
        !WARNING: Unresolved option: com.ti.ccstudio.buildDefinitions.C2000_6.2.compilerID.ADVICE__PERFORMANCE

Can you explain what is difference between compiler version 6.4.3 and 6.2.11?

  • When building with the 6.4.3 compiler you use the compiler option --advice_performance and the linker option --compress_dwarf.  Both of these options are new with the 6.4.x release.  You see those messages because you have changed compiler versions to 6.2.x, where those options are not supported.

    Steve four said:
    Can you explain what is difference between compiler version 6.4.3 and 6.2.11?

    Another resource to check ... See the README.txt file in the base directory of the compiler installation.  That directory name will be similar to ...

    C:\ti\ccsv6\tools\compiler\ti-cgt-c2000_6.4.3

    More general advice to consider ... Try using the Optimizer Assistant to find the best speed and size compiler settings.  You might find a better compromise with 6.4.3.

    Thanks and regards,

    -George

  • Hi,

    I made several tests also with Optimizer Assistant result is the same: Program does not fit any more in Flash.

    I use TMS320F2812 DSP.

    Map with CV 6.4.4:

    ******************************************************************************
                 TMS320C2000 Linker PC v6.4.4                      
    ******************************************************************************
    SECTION ALLOCATION MAP

     output                                  attributes/
    section   page    origin      length       input sections
    --------  ----  ----------  ----------   ----------------
    .cinit     0    00000000    000004c6     FAILED TO ALLOCATE
    serial_data
    *          0    003d7800    00000001     
                      003d7800    00000001     license.obj (serial_data)

    start
    *          0    003d8000    0000000e     
                      003d8000    0000000e     DSP281x_CodeStartBranch.obj

    .text      0    003d8010    000191ec     
                      003d8010    000071d7     menu.obj (.text)
                      003df1e7    00003968     Text.obj (.text)
                      003e2b4f    0000253e     MotCalc.obj (.text)
                      003e508d    00001dac     EEprom.obj (.text)
                      003e6e39    00001d1d     x.obj (.text)
                      003e8b56    00001752     Regel.obj (.text)
                      003ea2a8    00000fc2     trajgen.obj (.text)
                      003eb26a    00000e99     x.obj (.text)
                      003ec103    00000aa5     LCD.obj (.text)
                      003ecba8    00000975     RS232.obj (.text)
                      003ed51d    000008bb     config DSP.obj (.text)
                      003eddd8    00000491     x.obj (.text:retain)
                      003ee269    00000474     x.obj (.text)
                      003ee6dd    0000044a     x.obj (.text)
                      003eeb27    000003d0     x.obj (.text)
                      003eeef7    0000036f     Regel_x.obj (.text)
                      003ef266    000002fd     IOKom.obj (.text)
                      003ef563    000002fd     Regel_x.obj (.text)
                      003ef860    000002eb     Regel_x.obj (.text)
                      003efb4b    000002ba     Regel_x.obj (.text)
                      003efe05    000002af     CAN.obj (.text)
                      003f00b4    00000222     Regel_x.obj (.text)
                      003f02d6    00000199     DSP281x_InitPeripherals.obj (.text)
                      003f046f    0000015b     IO2Kom.obj (.text)
                      003f05ca    00000153     x.obj (.text:retain)
                      003f071d    0000014f     DSP281x_DefaultIsr.obj (.text:retain)
                      003f086c    0000011e     Flash281x_API.obj (.text)
                      003f098a    000000cd     Regel.obj (.text:retain)
                      003f0a57    000000ab     Resolver.obj (.text)
                      003f0b02    0000009f     rts2800_ml.lib : exp.obj (.text)
                      003f0ba1    0000008f                    : _log.obj (.text)
                      003f0c30    00000088                    : pow.obj (.text)
                      003f0cb8    00000083                    : fs_div.obj (.text)
                      003f0d3b    0000007c     DSP281x_SysCtrl.obj (.text)
                      003f0db7    00000078     rts2800_ml.lib : fs_add.obj (.text)
                      003f0e2f    00000065     x.obj (.text:retain)
                      003f0e94    0000005a     rts2800_ml.lib : fs_mpy.obj (.text)
                      003f0eee    00000051                    : sqrt.obj (.text)
                      003f0f3f    00000048     DSP281x_Adc.obj (.text)
                      003f0f87    00000044     rts2800_ml.lib : boot.obj (.text)
                      003f0fcb    00000041                    : ldexp.obj (.text)
                      003f100c    0000002a                    : l_div.obj (.text)
                      003f1036    00000029                    : fs_tol.obj (.text)
                      003f105f    00000025                    : fs_toi.obj (.text)
                      003f1084    00000022                    : i_div.obj (.text)
                      003f10a6    00000021                    : fs_toul.obj (.text)
                      003f10c7    0000001d                    : fs_tou.obj (.text)
                      003f10e4    0000001d                    : memcpy.obj (.text)
                      003f1101    0000001a                    : i_tofs.obj (.text)
                      003f111b    0000001a                    : l_tofs.obj (.text)
                      003f1135    00000019                    : args_main.obj (.text)
                      003f114e    00000019                    : exit.obj (.text)
                      003f1167    00000019                    : prolog.obj (.text)
                      003f1180    00000017                    : fs_cmp.obj (.text)
                      003f1197    00000014                    : frexp.obj (.text)
                      003f11ab    00000013                    : ul_tofs.obj (.text)
                      003f11be    00000011     DSP281x_PieVect.obj (.text)
                      003f11cf    00000010     rts2800_ml.lib : u_tofs.obj (.text)
                      003f11df    0000000c                    : epilog.obj (.text)
                      003f11eb    0000000b                    : u_div.obj (.text)
                      003f11f6    00000005                    : fs_neg.obj (.text)
                      003f11fb    00000001                    : _lock.obj (.text)

    Map with CV 6.2.11:  

    ******************************************************************************
                 TMS320C2000 Linker PC v6.2.11                     
    ******************************************************************************
    SECTION ALLOCATION MAP

     output                                  attributes/
    section   page    origin      length       input sections
    --------  ----  ----------  ----------   ----------------
    .pinit     0    003d8010    00000000     UNINITIALIZED

    serial_data
    *          0    003d7800    00000001     
                      003d7800    00000001     license.obj (serial_data)

    start
    *          0    003d8000    0000000e     
                      003d8000    0000000e     DSP281x_CodeStartBranch.obj

    .text      0    003d8010    0001820b     
                      003d8010    00006ab6     menu.obj (.text)
                      003deac6    00003968     Text.obj (.text)
                      003e242e    000023ca     MotCalc.obj (.text)
                      003e47f8    00001cd2     EEprom.obj (.text)
                      003e64ca    00001b8c     x.obj (.text)
                      003e8056    0000165b     Regel.obj (.text)
                      003e96b1    00000f4a     trajgen.obj (.text)
                      003ea5fb    00000e48     x.obj (.text)
                      003eb443    00000a4a     LCD.obj (.text)
                      003ebe8d    000008a1     config DSP.obj (.text)
                      003ec72e    00000837     RS232.obj (.text)
                      003ecf65    00000477     x.obj (.text:retain)
                      003ed3dc    00000469     x.obj (.text)
                      003ed845    000003f7     x.obj (.text)
                      003edc3c    000003b4     x.obj (.text)
                      003edff0    00000364     Regel_x.obj (.text)
                      003ee354    000002ef     Regel_x.obj (.text)
                      003ee643    000002e1     IOKom.obj (.text)
                      003ee924    000002dd     Regel_x.obj (.text)
                      003eec01    000002ab     Regel_x.obj (.text)
                      003eeeac    0000029f     CAN.obj (.text)
                      003ef14b    00000221     Regel_x.obj (.text)
                      003ef36c    00000199     DSP281x_InitPeripherals.obj (.text)
                      003ef505    0000014f     DSP281x_DefaultIsr.obj (.text:retain)
                      003ef654    0000014d     IO2Kom.obj (.text)
                      003ef7a1    0000011b     x.obj (.text:retain)
                      003ef8bc    00000119     Flash281x_API.obj (.text)
                      003ef9d5    000000cb     Regel.obj (.text:retain)
                      003efaa0    000000aa     Resolver.obj (.text)
                      003efb4a    0000009d     rts2800_ml.lib : exp.obj (.text)
                      003efbe7    0000008d                    : _log.obj (.text)
                      003efc74    00000087                    : pow.obj (.text)
                      003efcfb    00000083                    : fs_div.obj (.text)
                      003efd7e    00000079     DSP281x_SysCtrl.obj (.text)
                      003efdf7    00000078     rts2800_ml.lib : fs_add.obj (.text)
                      003efe6f    00000065     x.obj (.text:retain)
                      003efed4    0000005a     rts2800_ml.lib : fs_mpy.obj (.text)
                      003eff2e    00000050                    : sqrt.obj (.text)
                      003eff7e    00000047     DSP281x_Adc.obj (.text)
                      003effc5    00000044     rts2800_ml.lib : boot.obj (.text)
                      003f0009    0000003f                    : ldexp.obj (.text)
                      003f0048    0000002a                    : l_div.obj (.text)
                      003f0072    00000029                    : fs_tol.obj (.text)
                      003f009b    00000025                    : fs_toi.obj (.text)
                      003f00c0    00000022                    : i_div.obj (.text)
                      003f00e2    00000021                    : fs_toul.obj (.text)
                      003f0103    0000001d                    : fs_tou.obj (.text)
                      003f0120    0000001a                    : i_tofs.obj (.text)
                      003f013a    0000001a                    : l_tofs.obj (.text)
                      003f0154    00000019                    : args_main.obj (.text)
                      003f016d    00000019                    : exit.obj (.text)
                      003f0186    00000019                    : prolog.obj (.text)
                      003f019f    00000017                    : fs_cmp.obj (.text)
                      003f01b6    00000014                    : frexp.obj (.text)
                      003f01ca    00000013                    : ul_tofs.obj (.text)
                      003f01dd    00000011     DSP281x_PieVect.obj (.text)
                      003f01ee    00000010     rts2800_ml.lib : u_tofs.obj (.text)
                      003f01fe    0000000c                    : epilog.obj (.text)
                      003f020a    0000000b                    : u_div.obj (.text)
                      003f0215    00000005                    : fs_neg.obj (.text)
                      003f021a    00000001                    : _lock.obj (.text)



    Also there is an other issue:

    in .asm code I do something like this:

        .if ChoiceA
            .include "Text 1.asm"
        .else
            .include "Text 2.asm"
        .endif


    When I set a Pre-define NAME (ChoiceA) in Build Properties, works.

    When I set a Undefine NAME (ChoiceA) in Build Properties, Error: [E0004] and E[0300]

    Thanks and regards



  • Perhaps you are experiencing a performance bug in the compiler which causes your code size to be higher than it should.  To pursue this, please use the technique described in this wiki article to find the one or two functions which have the largest code size increase.  Then submit a test case for those functions.  We will need preprocessed source code and the build options used to to build it.

    Thanks and regards,

    -George

  • Hi,

    during test with OFD utility I find:

    Debugging model : Suppress all symbolic debug generation
    Optimize fully ... (--optimize_with_debug, -mn) : off
    Code size 6.4.4  : 180f5h
    Code size 6.2.11: 17110h

    Debugging model : Suppress all symbolic debug generation
    Optimize fully ... (--optimize_with_debug, -mn) : on
    Code size 6.4.4  : 17383h
    Code size 6.2.11: 17110h

    Still an issue.
    I checked code delta with OFD and check functions with delta like 1 or 2

    C code:
    void Example_MemCopy(Uint16 *SourceAddr, Uint16* SourceEndAddr, Uint16* DestAddr)
    {
       while(SourceAddr < SourceEndAddr)
       {
          *DestAddr++ = *SourceAddr++;
       }
       return;
    }

    6.4.4 code:
    ;----------------------------------------------------------------------
    ; 350 | while(SourceAddr < SourceEndAddr)                                      
    ;----------------------------------------------------------------------
            MOVL      XAR4,#_Flash28_API_LoadEnd ; [CPU_U] |350|
            MOVL      XAR7,#_Flash28_API_LoadStart ; [CPU_U] |350|
            MOVL      ACC,XAR4              ; [CPU_] |350|
            CMPL      ACC,XAR7              ; [CPU_] |350|
            BF        $C$L16,LOS            ; [CPU_] |350|
            ; branchcc occurs ; [] |350|
            SUBL      ACC,XAR7              ; [CPU_]
            SUBB      ACC,#1                ; [CPU_]
            MOVL      XAR4,ACC              ; [CPU_]
            MOVL      XAR5,#_Flash28_API_RunStart ; [CPU_U] |80|
    $C$L15:    
            MOVB      ACC,#0                ; [CPU_] |350|

    6.2.11 code:
    ;----------------------------------------------------------------------
    ; 350 | while(SourceAddr < SourceEndAddr)                                      
    ;----------------------------------------------------------------------
            MOVL      XAR4,#_Flash28_API_LoadEnd ; [CPU_U] |350|
            MOVL      XAR7,#_Flash28_API_LoadStart ; [CPU_U] |350|
            MOVL      ACC,XAR4              ; [CPU_] |350|
            CMPL      ACC,XAR7              ; [CPU_] |350|
            B         $C$L16,LOS            ; [CPU_] |350|
            ; branchcc occurs ; [] |350|
            SUBL      ACC,XAR7              ; [CPU_]
            SUBB      ACC,#1                ; [CPU_]
            MOVL      XAR4,ACC              ; [CPU_]
            MOVL      XAR5,#_Flash28_API_RunStart ; [CPU_U] |80|
    $C$L15:    
            MOVB      ACC,#0                ; [CPU_] |350|

    This looks like every where when code size is different.

  • You can disable generation of BF (fast branch) instructions with the option --no_fast_branch.  There are some caveats, so please read about it in the C2000 compiler manual.

    Thanks and regards,

    -George

  • No I have next code size problem with CGT 6.4.4 and CGT 6.4.5
    I checked with OFD:
    CGT 6.4.4 use pow with code size 136
    CGT 6.4.5 use powf with code size 1093

    Why ?
  • I assume you made no changes to your source code, build options, etc.  The only change is from compiler version 6.4.4 to 6.4.5.  And now your code calls powf where it used to call pow.  Is that correct?

    Thanks and regards,

    -George

  • Yes exact. I only change the Compiler Version.

    regards

    Stephan

  • [Later edit of this post ... While the techniques discussed here are interesting, it turns out they do not help solve the original problem.  Keep that in mind while reading this one through.]

    We need to find the source file(s) which used to call pow, but now call powf instead.  This command ...

    % nm430 -f -g file.obj

    dumps out all of the global symbols from that file.  It also prepends each line of output with the name of the source file (which becomes important later).  We only want to see the calls to functions that are called, but not defined, in the file.  This command does that ...

    % nm430 -f -g file.obj | fgrep ' U ' 

    fgrep is a Unix utility.  If you are running this on a DOS shell, use "find" instead.  nm430 uses ' U ' to denote undefined global symbols.  You can further filter the output to only show symbols that contain the string "pow" ...

    % nm430 -f -g file.obj | fgrep ' U ' | fgrep pow

    Suppose your object files are spread across several directories.  This Unix (not DOS) command finds all the object files and searches them all for calls to pow.  Run it from a top level directory that contains all the object file directories ...

    % find . -name '*.obj' -print0 | xargs -0 nm430 -f -g | fgrep ' U ' | fgrep pow

    There might be a way to do that with one line from a DOS shell, but I don't know it.

    Compare the output from this exercise for both builds.  You should find one or more files that formerly call pow, but now call powf.  With that, we have narrowed the focus of the search.

    Thanks and regards,

    -George

  • Please ignore my last post. The problem is probably same as the one discussed here.  It is best if you wait for the 6.4.6 release.

    Thanks and regards,

    -George