Real-Time Workshop User's Guide | ![]() ![]() |
Target Language Compiler Variables and Options
The Target Language Compiler supports extended code generation variables and options in addition to those included in the code generation options categories of the Real-Time Workshop page.
There are two ways to set TLC variables and options:
Assigning Target Language Compiler Variables
The %assign statement lets you assign a value to a TLC variable, as in
%assign MaxStackSize = 4096
This is also known as creating a parameter name/parameter value pair.
The %assign statement is described in the Target Language Compiler Reference Guide. It is recommended that you write your %assign
statements in the Configure RTW code generation settings
section of the system target file.
The following table lists the code generation variables you can set with the %assign statement.
Variable |
Description |
MaxStackSize= N |
When Local block outputs is enabled, the total allocation size of local variables that are declared by all functions in the entire model may not exceed MaxStackSize (in bytes). N can be any positive integer. |
MaxStackVariableSize= N |
When Local block outputs is enabled, this limits the size of any local variable declared in a function to N bytes, where N>0 . A variable whose size exceeds MaxStackVariableSize will be allocated in global, rather than local, memory |
FunctionInlineType= mode " |
Controls how functions are inlined. There are two modes: Using CodeInsertion , the code is actually inserted where the function call would have been made. PragmaInline directs the Target Language Compiler to declare the function when the appropriate compiler directive occurs. |
PragmaInlineString= "string" |
If FunctionInlineType is set to PragmaInline , this should be set to the directive that your compiler uses for inlining a function (for example, for Microsoft Visual C/C++, "__inline" ). |
WarnNonSaturatedBlocks= value |
Flag to control display of overflow warnings for blocks that have saturation capability, but have it turned off (unchecked) in their dialog. These are the options:
|
BlockIOSignals=value |
Supports monitoring signals in a running model. See Signal Monitoring via Block Outputs. Setting the variable causes the model _bio.c file to be generated. These are the options: |
ParameterTuning=value |
Setting the variable to 1 causes a parameter tuning file (model _pt.c) to be generated. model _pt.c contains data structures that enable a running program to access model parameters independent of external mode. See Parameter Tuning via model_pt.c. |
Setting Target Language Compiler Options
You can enter TLC options directly into the System target file field in the Target configuration category of the Real-Time Workshop page, by appending the options and arguments to the system target filename. This is equivalent to invoking the Target Language Compiler with options on the MATLAB command line.
The common options are shown in the table below.
![]() | Configuring the Generated Code via TLC | Making an Executable | ![]() |