Target Language Compiler | ![]() ![]() |
Overview of the Code Generation Process
Figure 1-1 shows how the Target Language Compiler works with its target files and Real-Time Workshop output to produce code. When generating code from a Simulink model using Real-Time Workshop, the first step in the automated process is to generate a model
.rtw
file. The model
.rtw
file includes all of the model-specific information required for generating code from the Simulink model. model
.rtw
is passed to the Target Language Compiler, which uses it in combination with a set of included system target files and block target files to generate the code.
Only the final executable file is written directly to the current directory. For all other files created during code generation, including the model
.rtw
file, a build directory is used. This directory is created by Real-Time Workshop right in the current directory and is named .
model
_
target
_rtw
, where target
is the abbreviation for the target environment, e.g., grt
is the abbreviation for the generic real-time target.
As of Release 13 (version 5), files placed in the build directory include
model
.c
model
.h
model
_private.h
defining parameters and data structures private to the generated code.
model
.mk
, for building the application.
Note that in previous releases, generated source files were packaged as follows:
model
.c
model
.h
and model
_export.h
)
model
_reg.h
) that registers the model's SimStruct
, sets up allocated data, and initializes nonfinite parameters
model
_prm.h
) that has information about all the parameters contained in the model
Figure 1-1: The Target Language Compiler Process
![]() | Overview of the TLC Process | Capabilities | ![]() |