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.

AM2634: Simulink generated code optimization

Part Number: AM2634

Tool/software:

Hi!

I am using simulink generated code in 1 core of an AM2634 to run control loops. We are quickly hitting compute limits of the core and overrunning the allotted time for the control loops.

Does TI have any suggestions for how to optimize the simulink generated code? The generated code has one input struct, one output struct, and one step function (with minimal branches). 

We have been using the `-O2` compiler flag for compiler optimization, but are there any more suggestions? Thanks!

  • TI has no specific suggestions regarding how to optimize generated C code, including code generated by Simulink.  

    Please learn about all of the optimization options from the tiarmclang online manual.  With regard to performance, the most aggressive option is -flto -Ofast.  Keep in mind for link time optimization (-flto) to have the most impact, all of the code and libraries must use it.  If that doesn't help, then for one source file that contains functions with this behavior:

    hitting compute limits of the core and overrunning the allotted time for the control loops

    Please follow the directions in the article How to Submit a Compiler Test Case.

    Thanks and regards,

    -George