Target Language Compiler | ![]() ![]() |
Invoking TLC to Generate Code
Typically, rtwgen
and TLC (as seen in the first section) are called directly from the Real-Time Workshop build procedure since the structure and arguments may change from release to release. However, while working with the TLC code, it may be a good idea to call rtwgen
and TLC directly from the MATLAB prompt.
To generate the model
.rtw
file from the MATLAB prompt, it is typically enough to say
rtwgen('
model
'
,'
OutputDirectory'
,'
<build_directory>'
)
However, you may want to add the output option to place the file in the build directory. This generates the model
.rtw
file. However, you may specify other options to rtwgen
such as whether or not to have case sensitivity for identifiers. For more details, type
help rtwgen
Once the .rtw
file generates, to run the Target Language Compiler on this file, type
tlc -rbuild_directory/model
.rtwfile
.tlc
This generates output as directed by file.tlc
. Options to TLC include:
-I
path
, which specifies paths to look for files included by the %<include>
directive-r
model
.rtw
-a
ident
=
expression
, which assigns a value to the TLC identifier ident
. This is discussed in Configuring TLC.help tlc
![]() | A Basic Example | Code Generation Concepts | ![]() |