Pass fixed-size scalar root inputs by value for code generation
Specify whether a model that references this model passes its scalar inputs to this model by value.
Category: Model Referencing
Default: Off (GUI),
A model that references this model passes scalar inputs to this model by value.
The parent model passes the inputs by reference (it passes the addresses of the inputs rather than the input values).
This option is ignored in either of these two cases:
The C function prototype control is not the default.
The C++ encapsulation interface is not the default.
Passing root inputs by value allows this model to read its scalar inputs from register or local memory, which is faster than reading the inputs from their original locations.
Enabling this parameter can result in the simulation behavior differing from the generated code behavior under certain modeling semantics. Simulink® reports cases where the modeling semantics may result in inconsistent behaviors for simulation and for generated code. If the diagnostic identifies an issue, latch the function-call subsystem inputs. For more information about latching function-call subsystems, see Context-dependent inputs.
If the Context-dependent inputs diagnostic reports no issues for a model, consider enabling the Pass fixed-size scalar root inputs by value for code generation parameter, which usually generates more efficient code for such a model.
If you have a Simulink Coder™ license, selecting this option can affect reuse of code generated for subsystems. See Generate Reentrant Code from Subsystems (Simulink Coder) for more information.
For SIM targets, a model that references this model passes inputs by reference, regardless of how you set the Pass fixed-size scalar root inputs by value for code generation parameter.
The command-line values are reverse of the settings values. Therefore,
'on' in the command line corresponds to the description
of “Off” in the settings section, and
the command line corresponds to the description of “On” in the
For the diagnostic action to take when the software has to compute the input to a function-call subsystem, see Context-dependent inputs.