Real-Time Workshop |
 |
Simulation Parameters
Options on each page of the Simulation Parameters dialog box affect the generated code.
Advanced Page
- Turn on the Signal storage reuse option. The directs Real-Time Workshop to store signals in reusable memory locations. It also enables the Local block outputs option (see General Code Generation Options).
- Disabling Signal storage reuse makes all block outputs global and unique, which in many cases significantly increases RAM and ROM usage.

- Enable strict Boolean type checking by selecting the Boolean logic signals option.
- Selecting this check box is recommended. Generated code will require less memory, because a Boolean signal typically requires one byte of storage while a double signal requires eight bytes of storage.
- Select the Inline parameters check box. Inlining parameters reduces global RAM usage, since parameters are not declared in the global parameters structure. Note that you can override the inlining of individual parameters by using the Model Parameter Configuration dialog box.
- Consider using the Parameter pooling option if you have multiple block parameters referring to workspace locations that are separately defined but structurally identical. See Parameter Pooling Option for further information.
General Code Generation Options
To access these options, select General code generation options or General code generation options (cont.) from the Category menu on the Real-Time Workshop pane.
- Set an appropriate Loop rolling threshold. The loop rolling threshold determines when a wide signal should be wrapped into a
for
loop and when it should be generated as a separate statement for each element of the signal See Loop Rolling Threshold Field for details on loop rolling.
- Select the Inline invariant signals option. Real-Time Workshop will not generate code for blocks with a constant (invariant) sample time.
- Select the Local block outputs option. Block signals will be declared locally in functions instead of being declared globally (when possible). You must turn on the Signal storage reuse option in the Advanced page to enable the Local block outputs check box.
- Select the Expression folding option, discussed in Expression Folding.
- Select the Buffer reuse option. This option can reduce stack size. See Buffer Reuse Option.
| Stateflow Optimizations | | Compiler Options |  |