Target Language Compiler | ![]() ![]() |
Available Target Files
Target files are the set of files that are interpreted by the Target Language Compiler to transform the intermediate Real-Time Workshop code (model
.rtw
) produced by Simulink into target-specific code.
Target files provide you with the flexibility to customize the code generated by the Compiler to suit your specific needs. By modifying the target files included with the Compiler, you can dictate what the compiler produces. For example, if you use the available system target files, you produce generic C code from your Simulink model. This executable C code is not platform specific.
All of the parameters used in the target files are read from the model
.rtw
file and looked up using block scoping rules. You can define additional parameters within the target files using the %assign
statement. The block scoping rules and the %assign
statement are discussed in Directives and Built-In Functions.
Target files are written using target language directives. Directives and Built-in Functions, provides complete descriptions of the target language directives.
model.rtw, contains a thorough description of the model
.rtw
file, which is useful for creating and/or modifying target files.
Model-Wide Target Files and System Target Files
Model-wide target files are used on a model-wide basis and provide basic information to the Target Language Compiler, which transforms the model
.rtw
file into target-specific code.
The system target file is the entry point for the Target Language Compiler. It is analogous to the main()
routine of a C program. System target files oversee the entire code generation process. For example, the system target file, grt.tlc
, sets up some variables for codegenentry.tlc
, which is the entry point into the Real-Time Workshop target files. For a complete list of available system target files for Real-Time Workshop, see the Real-Time Workshop documentation.
There are four sets of model-wide target files, one for each of the basic code formats that the Real-Time Workshop supports. The following table lists the model-wide target files associated with each of the basic code formats.
Block Target Files
Block target files are files that control a particular Simulink block. Typically, there is a block target file for each Simulink basic building block. These files control the generation of inline code for the particular block type. For example, the target file, gain.tlc
, generates corresponding code for the Gain block.
The file genmap.tlc
(included by codegenentry.tlc
) tells TLC which .tlc
files to include for particular blocks.
Note Functions declared inside a block file are local. Functions declared in all other target files are global. |
![]() | TLC Files | Summary of Target File Usage | ![]() |