Main Content

Exploring TI C2000 Toolchain Options

Toolchains provide the necessary tools and environment to develop, compile, and debug applications for Texas Instruments® C2000™ processors. You can generate executable files in different formats using the various toolchain options.

The Texas Instruments C2000 processors are supported by various toolchain options, enabling you to generate executable files in different formats. C2000 Microcontroller Blockset supports the following toolchains.

  • C28x

    • Texas Instruments Code Composer Studio™: Generates an executable in common object file application binary interface (COFF ABI) format.

    • Texas Instruments Code Composer Studio - EABI (C2000): Generates an executable in the ELF application binary interface (EABI) format.

  • ARM®

    • Texas Instruments Code Composer Studio (ARM)

Configuring Toolchain Options for Code Generation

To configure the toolchain options required for code generation, complete these steps.

  1. In the Configuration Parameters window, expand the Code Generation pane.

    Code generation

  2. The Generate code only option under Build process enables you to generate code versus building the model on an executable. For more information, refer to Generate code only (Simulink Coder).

  3. You can choose the Build Configuration options to get the required compiler flags for the code compilation.

    • Faster builds

    • Faster run

    • Debug

    • Specify

    Use the Specify option to edit the Tool Options column to add any additional flags. For more information, see Build configuration (Simulink Coder) and Enhance Code Execution Speed in TI C2000 Simulink Applications.

Comparing COFF and EABI Binary Formats

The COFF and EABI formats differ in how they interpret the double data type for Texas Instruments C2000 processors:

  • COFF ABI Format:

    • Interprets double data type in Simulink® as 32-bit floating point for C28x processors.

    • Suitable for applications where 32-bit precision is sufficient.

  • EABI Format:

    • Interprets double data type in Simulink as 64-bit floating point for TI F2838x (C28x) processors.

    • Enabling EABI on FPU32 processors can result in longer execution times, especially for processors that emulate 64-bit operations in software.

Data Type Interpretation

TypeCOFF ABI FormatEABI Format
doubleIEEE 32-bit single precisionIEEE 64-bit double precision
floatIEEE 32-bit single precisionIEEE 32-bit single precision
long doubleIEEE 64-bit double precisionIEEE 64-bit double precision

Interoperability Format Consideration

This list details the COFF and EABI interoperability format considerations.

  • File Compatibility: Recompile all libraries and precompiled object files to match the EABI format if using EABI. There is no compatibility between COFF and EABI formats.

  • Source Code Access: Obtain access to source code to recompile objects and libraries as needed.

  • Consistent File Formats: Ensure all referred files, including libraries (.lib), source files (.c/.h/.asm), and linker command files (.cmd), are in the same format as supported by the toolchain to avoid linker errors. Custom files must match the toolchain format.

  • Linker Command Files: Use proper formatting with correct section names as supported by the toolchain. In EABI mode, all sections are eligible for removal via conditional linking by default. Explicitly retain needed but unreferenced sections when migrating from COFF to EABI.

  • TMU and Fast Integer Division:

    • Enable TMU1 and fast integer division only with EABI format, while TMU0 is supported in both COFF and EABI formats. You can configure these options in the build settings (Configset -> Hardware Board -> Build options).

    • TMU hardware instructions are replaced only in relaxed floating-point.

    • TMU0 supports math operations like product, division, square root, sine cosine, inverse tan and TMU1 supports logarithmic and exponential operations.

  • Automatic CRL Triggering: Fast integer division code replacement libraries (CRLs) are automatically triggered when matching division operations are used, but this feature is supported only in the EABI format.

Processor and Toolchain Compatibility

This table details processors with their corresponding toolchain, TMU, and fast integer division support. Compiler format support depends on the availability of source, headers, and libraries in TI C2000Ware. For processors supporting both COFF and EABI toolchains in Simulink, linker command files are updated to match the correct formatting required by the toolchain.

Processor Support Table

This table summarizes the support for different Texas Instruments C2000 processors, highlighting the toolchain formats, TMU support, and fast integer division capabilities. Ensure that all files match the required format for the chosen toolchain to avoid compatibility issues.

TargetHardware Support TypeSimulink Toolchain SupportTMU SupportFast Integer Division
F28P5xFPU (Single precision floating point)EABITMU1Yes
F28P6xFPU64 (Double precision floating point)EABITMU1Yes
F280013xFPU (Single precision floating point)COFF (default) and EABITMU1No
F280015xFPU (Single precision floating point)COFF (default) and EABITMU1No
F28003xFPU (Single precision floating point)COFF (default) and EABITMU0Yes
F2838xFPU64 (Double precision floating point)EABITMU0Yes
F2837xFPU (Single precision floating point)COFF (default) and EABITMU0No
F28002xFPU (Single precision floating point)COFF (default) and EABITMU0Yes
F28004xFPU (Single precision floating point)COFF (default) and EABITMU0No
F2807xFPU (Single precision floating point)COFF (default) and EABITMU0No

Managing Double Data Types on Single Precision FPU Processors in EABI Format

In C2000 Microcontroller Blockset, managing double data types on processors with a single-precision floating point unit (FPU) is important for optimizing performance and ensuring compatibility with the EABI standard.

The lists explains how to manage double data types on single FPU processors using the EABI format.

  • Explicitly set data types to single for optimized model performance, as double data types are default.

  • Enable the Use data type replacement to override precision of ‘double’ in generated code parameter and set Number of bits for double to 32. Toolchain

    This enables the Specify custom data type names parameter and replace the double data type with the replacement option mwReal32_T, which typedefs to the float data type in generated code for both the COFF and EABI formats.

    • When you set the Number of bits for double to 32-bit precision, the model behaves differently during simulation and code generation as the data type replacement is applicable only in code generation.

    • Similarly, when you set Number of bits for double to 64,Simulink generates the replacement option mwReal64_T, which typedef to double data type in the generated code in EABI and typedef to long double in the COFF format.

  • Set the data type for all C2000 blocks to float, you require 64-bit precision double precision. To find instances of double data types in the Simulink model, go to Configuration Parameters -> Hardware Implementation -> Target hardware resources -> Build options and click the Analyze double data type usage button.

    • Use the Analyze double data type usage option to identify usage of the double data type in the entire model. Once you click the Analyze double data type usage button, Simulink compiles the entire model and generates an HTML report with the list of double data types used in the model. The double data type usage report is categorized into two:

      • Blocks with explicitly set double data type: list of all the double data types set explicitly in the model.

      • Blocks with inheriting double data type: list of all the double data types inherited because of the data type set in other blocks.

      Click the hyperlinks in the generated HTML, report to highlight a section in the model and modify the data type.

      For constants used in blocks such as constant, saturation limits etc. it is recommended to cast the number as per the required data type. For example, use single(3) instead of directly using 3.

  • It is recommended to use C99 language standard under Configuration Parameters -> Code Generation -> Language standard. This will ensure to add –c99 flag for compiler option and will allow the code to be generated with the c99 format. With C99 standard, the math operations will generate separate variants for single and double precision formats and the single precision formats will be more efficient in execution time and memory with FPU (Single precision floating point) processors.

  • Select the Enable TMU parameter to ensure all the supported math operations are executed at a faster rate. Selecting this parameter might result in less accurate results due to the floating point mode being relaxed.

See Also

| |