Main Content

Extending Embedded and Generic Real-Time System Target Files

Simulink® Coder™ and Embedded Coder® use system target files (STFs) to generate code for interfacing with specific real-time operating systems. The Target Language Compiler (TLC) uses STFs and various other target files to convert a model into generated code. In addition to including STFs for ready-to-run configurations, Simulink Coder and Embedded Coder allow you to extend STFs to support third-party and custom target hardware. For more information on TLC files and STFs, including a list of available STFs, see Configure a System Target File (Simulink Coder) and Target Language Compiler Basics (Simulink Coder).

Generic real-time (GRT) is a Simulink Coder STF that you can use when you generate code from a Simscape™ model for hardware-in-the-loop (HIL) simulation. To generate code for HIL simulation, you must configure your Simscape model to use a fixed step, local solver. To learn about Simscape solver configurations that support HIL simulation, see Solvers for Real-Time Simulation.

Embedded real-time (ERT) is an Embedded Coder STF for deploying production-quality code for real-time execution of the algorithm for your Simulink controller. Do not deploy code that you generate from a Simscape model to production platforms. Simscape models contain constructs that are not compatible with performance-related Embedded Coder Model Advisor checks, such as “Check for blocks not recommended for C/C++ production code deployment”. For more information, see Embedded Coder Model Advisor Checks for Standards, Guidelines, and Code Efficiency (Embedded Coder).

To extend ERT or GRT system target files and create hardware-specific, standalone applications, use the toolchain build process approach. The toolchain approach generates optimized makefiles and supports custom toolchains. For information, see Customize System Target Files (Simulink Coder) and Support Toolchain Approach with Custom Target (Simulink Coder).

Third-party vendors supply additional system target files for the Simulink Coder product. For more information about third-party products, see the MathWorks Connections Program Web page: https://www.mathworks.com/products/connections.

Related Topics