User`s guide

The Build Process
2-17
Computes work vector sizes, such as those used by S-functions. (For more
information about work vectors, refer to the Simulink Writing S-Functions
documentation.)
When Simulink completes this processing, Real-Time Workshop reads your
model file (
model.mdl) and compiles an intermediate representation of the
model. This intermediate description is stored, in a language-independent
format, in the ASCII file
model.rtw. The model.rtw file is the input to the
next stage of the build process.
model.rtw files are similar in format to Simulink model (.mdl) files, but are
only used for automated code generation. For a general description of the
model.rtw file format, see “model.rtw File Contents” in the Target Language
Compiler (TLC) documentation.
Code Generation
During code generation, Real-Time Workshop uses the TLC and a supporting
TLC function library to transform the intermediate model description stored
in
model.rtw into target-specific code.
The target language compiled by the TLC is an interpreted programming
language designed to convert a model description to code. The TLC executes
a TLC program comprising several target files (
.tlc scripts). The TLC scripts
specify how to generate code from the model, using the
model.rtw file as
input.
The TLC
1 Reads the model.rtw file.
2 Compiles and executes commands in a system target file.
The system target file is the entry point or main file. You select it from
those available on the MATLAB path with the System target file browser
or you can type the name of any such file on your system prior to building.
3 Compiles and executes commands in block target files.
For each block in a Simulink model, there is a block target file that
specifies how to translate that block into target-specific code.