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.

TMS320F2812: SW slower with CCS v11.20 than with CCS v3.3

Part Number: TMS320F2812
Other Parts Discussed in Thread: CCSTUDIO

Hi,

 I hope you can help me.

I have to modify program of a TMS320F2812 from an old project. Project was compiled with CCS V3.3 and I use CCS v11.2.0

My problem is that the same code compiled with CCS V11.2.0 is slower than one compiled with CCS v3.3. To test that, I use a script which used the same compiling options but only the compiler cl2000 matches to the desired version.

To test my SW, I enable a GPIO during my algorithm execution which have to be executed every 20µs. With compiler of CCS V3.3, my algorithm is executed in 12µs but with CCS V11.2.0 it executed in  30µs.

I don’t understand why there is this gap : Is there a compiling option I forgotten with CCS v11.2.0 ?

 

Best regards

  • Hello,

    To test that, I use a script which used the same compiling options but only the compiler cl2000 matches to the desired version.

    Can you clarify this statement? Are you using the same exact compiler version between the two CCS versions? Are you passing in the same compiler options between the two version?

    To test my SW, I enable a GPIO during my algorithm execution which have to be executed every 20µs. With compiler of CCS V3.3, my algorithm is executed in 12µs but with CCS V11.2.0 it executed in  30µs.

    How exactly are you doing this benchmarking?

    Are you running the 3.3 compiled program in CCS 11.2.0 also?

    Thanks

    ki

  • Hello

    Thank you for your reply.

    I actually don't use CCS. I only use a script launched via the window command interface. And to compile my SW, I call the cl2000 compiler from the CCSv3.3 installation repository or from the CCSv11.2 installation repository like this:

    C:/CCStudio_v3.3/C2000/cgtools/bin/cl2000 -g -k -q -ss -pdsw225 -al -as -o2 -include_path="example_path" --advice:performance=all --diag_warning=225 --diag_wrap=off --display_error_number --abi=coffabi --c_src_interlist --asm_directory="my_asm_folder" --list_directory="my_list_folder" --temp_directory="my_directory" --preproc_with_compile --obj_directory="obj_directory" -ml -mt -v28 "my_file.c"

    or

    C:/ti/ccs1120/ccs/tools/compiler/ti-cgt-c2000_21.6.0.LTS/bin/cl2000 -g -k -q -ss -pdsw225 -al -as -o2 -include_path="example_path" --advice:performance=all --diag_warning=225 --diag_wrap=off --display_error_number --abi=coffabi --c_src_interlist --asm_directory="my_asm_folder" --list_directory="my_list_folder" --temp_directory="my_directory--preproc_with_compile --obj_directory="obj_directory-ml -mt -v28 "my_file.c"

    So only compiler path change between v3.3 or v11.2.0 and compiler option are strictly identical for both version.

    For my test, I use an oscilloscope to measure the activation time of my GPIO while running my algorithm.

    To be more precise, JTAG interface is not available on my card so I program the DSP with UART interface (SCI).

    Best regards

    KMERY

  • So only compiler path change between v3.3 or v11.2.0
    C:/CCStudio_v3.3/C2000/cgtools/bin/cl2000
    C:/ti/ccs1120/ccs/tools/compiler/ti-cgt-c2000_21.6.0.LTS/bin/cl2000

    I can see that you are using version 21.6.0 of the C2000 compiler in CCS 11.2.0.

    What version of the compiler are you using in CCS 3.3?

    In my CCS 3.3 install, I can see that it comes with version 5.2.1 of the CCS compiler

  • Hi,

    Indeed, compiler version is v4.1.3 for CCS v3.3 and v21.6.0 for CCS 11.2.0

    Best regards 

    KMERY

  • Indeed, compiler version is v4.1.3 for CCS v3.3 and v21.6.0 for CCS 11.2.0

    That is quite a difference in versions. LIkely something changed between the versions that is causing the discrepancy like some default setting. I will bring this thread to the attention of the compiler experts for further investigation.

    Thanks

    ki

  • I clicked wrong... How can I re-open this thread ?

    I just wanted to add : I also tested with older version available on TI website and I have the same problem with compiler v5.2.1

    Best regards

    KMERY

  • I want to narrow the scope of the problem down to 1 function that runs slower.  To do that, I will use code size as a proxy for execution time.  That is not precisely accurate.  But for this analysis, precise accuracy is not needed.  

    Please follow the directions in the article Find Source of Code Size Increase to find the functions which have increased in size the most.  Visually inspect the assembly code generated by the compiler for a few of those functions.  Make your best guess on which one has slowed down the most.  For the source file which contains that function, please follow the directions in the article How to Submit a Compiler Test Case.  But do it two times.  Once with the older compiler, and again with the newer compiler.

    I'm sorry to ask you to do so much work.  But I don't see a better way to advance the issue.

    Thanks and regards,

    -George

  • Hello,

    Thanks for your feedback.

    I followed your instructions and generated the most different files in *.pp format. There are many differents at the begining of these files.

    Do you need to see them ?

    Thanks and regards,

    KMERY

  • I presume you only picked one source file for preprocessing.  That source file contains the function you guess has slowed down the most between the compilers.  For that source file, please follow the directions in the article How to Submit a Compiler Test Case.  Not one time, but two times.  Once with the older compiler.  Then a second time with the newer compiler.  That produces two different .pp files.  Be sure they have different names that reflect the version of the compiler used.  Put them in a zip file, then attach it to your next post.

    Thanks and regards,

    -George

  • Yes I follow instruction from your link. I will send you the pp files in private message.

    Best regards

  • Thank you for sending in the two test cases.  I cannot run them.  I built both of them down to assembly code, and compared a few different ways.  Based on that comparison, I do not expect to see a large difference in execution time.  In fact, code generated by compiler version 21.6.0.LTS should be a little bit faster.  The key function has very few loops or if statements.  It mostly runs one time from the start to the end.  There is a large group of lines that has no loops or if statements.  This appears to be the most compute intensive part of the function.  I isolated the instructions for these lines and compared.  The total number of instructions is similar.  The total number of instructions which read or write to memory is also similar.  Version 21.6.0.LTS has fewer instructions.  But not by a lot.  

    Thus, I am confident that the compiler is not the reason for the performance difference.  There must be something else.

    Consider the access speed of the memory that is executed from, or the access speed of the memory that is read or written.  Is it possible this access speed is different, and that explains the performance difference?

    Thanks and regards,

    -George

  • Hello,
    Thank you for your analysis.
    In fact, to save more execution time I removed the FOR loops from my PROCESS.
    I'm testing my software on the same board with the same software code, including *.cmd files.
    As my issue is with algorithm execution time, is it possible that the DSP is not using its Arithmetic Logic Unit (ALU) with 21.6.0 LTS ?

    Best regards,

    KMERY

  • is it possible that the DSP is not using its Arithmetic Logic Unit (ALU)

    No.  

    You already build with the compiler option -ss.  This causes the compiler to keep the compiler generated assembly file.  This file has the same name as the C source file, with the extension changed to .asm.  Inspect it to see the instructions generated by the compiler.  Many ALU instructions are used by both versions of the compiler.

    Thanks and regards,

    -George