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.

CCS 3.3 code execution speed

Hi,

I have some timing issue with CCS3.3 (CGT 6.1.9) vs. CCS2.2.

WIhave a working project built on CCS2.2 for C6711. This project contains ADC_ISR that is triggered every 97.6 us. The ISR execution time is 80us for code compiled on 2.2.
Whereas the same code when compiled on CCS3.3 takes more than 100us for execution.

The optimization used for both is Function O2. Can anyboby provide inputs on how to bring back the speed similar to CCS2.2.

 

Thanks,

Mona Gandhi.

 

  • Mona,

    Are you using the same Code Generation tools (CGT) for both CCS? The difference might be either because of different CGT version or compiler settings (please check that the compiler settings are same).

    Thanks,
    Gaurav

  • Gaurav,

    For CCS2.2 we are using the CGT v4.32.

    For CCS 3.3 we are using CGT v6.1.9.

    Compiler settings are same for both.

    Thanks,

    Mona Gandhi.

  • Mona,

    The change in CGT is most probably the reason behind the change in performance (kepping other things constant). CCS version should not have anything to do with this.

    To confirm this, please change the CGT version in your CCS3.3 setup (Help --> About --> Component Manager).

    Thanks,
    Gaurav

  • Gaurav,

    On changing the CGT version to 4.32 (the one which is used for CCS2.2)  in CCS3.3 I get the following error.

    Build Error: Cannot run cl6x

    Thanks,

    Mona Gandhi.

  • Mona,

    This is a compiler/CGT specific question. I am moving this post to compiler forum.

    Regards,
    Gaurav

  • In situations like this, it is usually the case that 1 or 2 loops have degraded in performance.  First we have to find these loops.  Then we focus on why the performance changed.  

    Add -mw to both builds.  That option causes the compiler to keep the assembly (.asm) files, and emit a comment block on each loop.  See http://processors.wiki.ti.com/index.php/C6000_Compiler:_Tuning_Software_Pipelined_Loops#Establishing_a_Baseline .  Inspect the .asm files.  Focus on the lines "SOFTWARE PIPELINE INFORMATION" and "ii = number".  ii stands for "initiation interval".  The lower, the better.  More detail on ii is here: http://processors.wiki.ti.com/index.php/C6000_Compiler:_Tuning_Software_Pipelined_Loops#Introduction .  You want to find the loops for which the ii degraded (increased) the most.

    Once we have the problem isolated to 1 or 2 loops, we can move on from there.

    Thanks and regards,

    -George

  • George,

    CCS2.2 provides the software pipeline instructions as below for 1 loop.

    ;*----------------------------------------------------------------------------*
    ;*   SOFTWARE PIPELINE INFORMATION
    ;*
    ;*      Loop source line                 : 333
    ;*      Loop opening brace source line   : 334
    ;*      Loop closing brace source line   : 334
    ;*      Known Minimum Trip Count         : 1
    ;*      Known Max Trip Count Factor      : 1
    ;*      Loop Carried Dependency Bound(^) : 10
    ;*      Unpartitioned Resource Bound     : 2
    ;*      Partitioned Resource Bound(*)    : 2
    ;*      Resource Partition:
    ;*                                A-side   B-side
    ;*      .L units                     1        0    
    ;*      .S units                     2*       2*   
    ;*      .D units                     1        0    
    ;*      .M units                     0        0    
    ;*      .X cross paths               0        0    
    ;*      .T address paths             1        0    
    ;*      Long read paths              0        0    
    ;*      Long write paths             0        0    
    ;*      Logical  ops (.LS)           0        0     (.L or .S unit)
    ;*      Addition ops (.LSD)          0        3     (.L or .S or .D unit)
    ;*      Bound(.L .S .LS)             2*       1    
    ;*      Bound(.L .S .D .LS .LSD)     2*       2*   
    ;*
    ;*      Searching for software pipeline schedule at ...
    ;*         ii = 10 Schedule found with 2 iterations in parallel
    ;*
    ;*      Register Usage Table:
    ;*          +---------------------------------+
    ;*          |AAAAAAAAAAAAAAAA|BBBBBBBBBBBBBBBB|
    ;*          |0000000000111111|0000000000111111|
    ;*          |0123456789012345|0123456789012345|
    ;*          |----------------+----------------|
    ;*       0: |*  *            |*   *           |
    ;*       1: |*  *            |*   *           |
    ;*       2: |*  *            |*   *           |
    ;*       3: |*  *            |*   *           |
    ;*       4: |** *            |*   *           |
    ;*       5: |*  *            |*   *           |
    ;*       6: |*  *            |*   *           |
    ;*       7: |*  **           |*   **          |
    ;*       8: |*  **           |**  *           |
    ;*       9: |*  *            |*   *           |
    ;*          +---------------------------------+
    ;*
    ;*      Done
    ;*
    ;*      Loop is interruptible
    ;*      Collapsed epilog stages     : 1
    ;*      Prolog not removed
    ;*      Collapsed prolog stages     : 0
    ;*
    ;*      Minimum required memory pad : 0 bytes
    ;*
    ;*      Minimum safe trip count     : 1
    ;*----------------------------------------------------------------------------*

    For others  it says

    ;*----------------------------------------------------------------------------*
    ;*   SOFTWARE PIPELINE INFORMATION
    ;*      Disqualified loop: Loop contains a call
    ;*----------------------------------------------------------------------------*

     

    Unfortunately CCS3.3 does not generate even 1 software pipeline instruction.

    It says

    ;*----------------------------------------------------------------------------*
    ;*   SOFTWARE PIPELINE INFORMATION
    ;*      Disqualified loop: Loop contains a call
    ;*----------------------------------------------------------------------------*

    for all the loops.

     

     

    Alternately, I want to use CGT 4.32 in CCS3.3 for which I get an error as below:


    Build error: Cannot run cl6x.

    Can you please suggest some workaround?

     

  • Even for the one loop which is software pipelined, you get a high ii.  You can probably do a lot better.  The information here suggests you have a loop carried dependency.  See http://processors.wiki.ti.com/index.php/C6000_Compiler:_Tuning_Software_Pipelined_Loops#Eliminating_Loop-Carried_Dependencies for more information on that.  But let's set this aside for a moment ...

    How can one version of the compiler think a loop contains a call, while a different version does not?  Please place the function which contains this loop into a file by itself.  Make sure it can build down to an object file (no link necessary).  Preprocess that file as described here http://processors.wiki.ti.com/index.php/Preprocess_Complex_Source_Code_for_Bug_Submissions .  Then post it here for us to see.

    Mona Gandhi said:

    Alternately, I want to use CGT 4.32 in CCS3.3 for which I get an error as below:

    Build error: Cannot run cl6x.

    Can you please suggest some workaround?

    Configure CCS to use the new compiler as described here http://processors.wiki.ti.com/index.php/Compiler_Installation_and_Selection .  Note you are combining a compiler and CCS that were released several years apart.  I think they will work together.  But they may not.

    Thanks and regards,

    -George