SPRADI0 July   2024

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
    1. 1.1 Getting Started
  5. 2Model-Based Design of eCompressor
    1. 2.1 General Texas Instruments High Voltage Evaluation (TI HV EVM) User Safety Guidelines
    2. 2.2 Block Diagram
    3. 2.3 Hardware, Software and Testing Requirements
      1. 2.3.1 Hardware setup
      2. 2.3.2 Software setup
      3. 2.3.3 Test Procedure
  6. 3 Simulink Configuration Settings
    1. 3.1 Simulink Tool Optimization
      1. 3.1.1 Optimum Code Generation
    2. 3.2 C2000 Specific Optimization
      1. 3.2.1 Using TMU Through Simulink
      2. 3.2.2 Using Software Libraries Through Simulink
      3. 3.2.3 Running Code From RAM
    3. 3.3 Performance Comparison
  7. 4 Profiling Using Simulink
    1. 4.1 Processor-in-loop (PIL) Method
    2. 4.2 C2000 Timer-Based Profiling
    3. 4.3 Code Composer Studio tools
  8. 5Summary

Using TMU Through Simulink

C2000 devices also contain accelerators such as Trigonometric Math Unit (TMU) to perform floating point trigonometric operations faster. To ensure that the generated code is using the TMU instructions, the hardware implementation tab in the hardware settings contains the option to enable TMU. This ensures that wherever trigonometric operations are to be performed, the TMU instructions are invoked. By default, TMU is enabled for the devices having TMU accelerator unless manually unchecked.

While TMU can specifically be invoked by calling the intrinsic function as described in the C2000 compiler user guide, by enabling the TMU function in the Simulink window still uses the conventional trigonometric operations and not the TMU intrinsics. The TMU is enabled by using the appropriate compiler flag in the build configuration and ensures that the hardware accelerator is correctly invoked for performing trigonometric operations. The look up table blocks such as sin-cosine LUT is still using the LUT-based approach even if TMU is enabled. The sin-cosine blocks from the Simulink Library needs to be used to generate the trigonometric operations in place of the look up table-based approach.

TIDM-02012 TMU Configuration Figure 3-4 TMU Configuration