Model Referencing Limitations

Model Architecture Limitations

Reusability in accelerator modeSee Specify Reusability of Referenced Models.
Block masksSee Use Masked Blocks in Referenced Models.
S-FunctionsUse S-Functions with Referenced Models
Goto and From blocks

Goto and From blocks cannot cross model reference boundaries.

Iterator and configurable subsystems

If the Model block references a model that contains Assignment blocks that are not in an iterator subsystem, you cannot place a Model block in an iterator subsystem.

In a configurable subsystem with a Model block, during model update, do not change the subsystem that the configurable subsystem selects.

InitFcn callback

An InitFcn callback in a top model cannot change parameters used by referenced models.

MATLAB® Function block

A MATLAB Function block in a referenced model that executes in accelerator mode cannot call MATLAB functions that are declared extrinsic for code generation.

Stateflow® charts

You cannot reference a model multiple times in the same model reference hierarchy if that model that contains a Stateflow chart that:

  • Contains exported graphical functions

  • Is part of a Stateflow model that contains machine-parented data

Signal Limitations

0-based or 1-based indexing information propagationSee Index Information Propagation.
Asynchronous rates

Referenced models can only use asynchronous rates if the model meets both of these conditions:

  • An external source drives the asynchronous rate through a root-level Inport block.

  • The root-level Inport block outputs a function-call signal. See Asynchronous Task Specification.

User-defined data type input or output

A referenced model can input or output only the user-defined data types that are fixed point or that Simulink.DataType or Simulink.Bus objects define.

Referenced model cannot access signals in multirate bus

A referenced model cannot directly access the signals in a multirate bus. To overcome this limitation, see Connect Multirate Buses to Referenced Models.

Simulation Limitations

Continuous sample time propagation

A continuous sample time cannot be propagated to a Model block that is sample-time independent.

State initialization

To initialize the states of a model that references other models with states, specify the initial states in structure or structure with time format. For more information, see State Information for Referenced Models.

Parameter tunability

When you simulate a model that references other models, under some circumstances, you lose some tunability of block parameters (for example, the Gain parameter of a Gain block). For more information, see Tunability Considerations and Limitations for Other Modeling Goals.

0-based or 1-based indexing information propagationSee Index Information Propagation.
Normal mode visibility for multiple instances of referenced model

You can simulate a model that has multiple instances of a referenced model that are in normal mode. All the instances of the referenced model are part of the simulation. However, Simulink® displays only one of the instances in a model window. The normal mode visibility setting determines which instance Simulink displays. Normal mode visibility includes the display of Scope blocks and data port values.

To set up your model to control which instance of a referenced model in normal mode has visibility and to ensure proper simulation of the model, see Configure Models with Multiple Referenced Model Instances.

Save before using accelerator mode

When you create a model, you cannot use that model as an accelerator mode referenced model until you have saved the model to disk. You can work around this limitation by setting the model to normal mode. See Simulate Model Reference Hierarchies.

Diagnostic configuration parameters in accelerator mode

For models referenced in accelerator mode, Simulink ignores certain runtime diagnostics that you set to a value other than none or Disable all. For details, see Diagnostic Configuration Parameters Ignored in Accelerator Mode.

Blocks with runtime checks in accelerator mode

Some blocks include runtime checks that are disabled when you include the block in a referenced model in accelerator mode. Examples of these blocks include Assignment, Selector, and MATLAB Function blocks).

sim command in accelerator mode

When the sim command executes a referenced model in accelerator mode, the source workspace is always the MATLAB base workspace.

Data logging and visualization in accelerator mode

These logging methods have limitations when specified for referenced models executing in accelerator mode.

  • To Workspace blocks —Logs data only if you use Timeseries format.

  • Scope, Floating Scope, and Scope Viewer blocks — No data is displayed.

  • Runtime display — Simulation data values, such as port values, do not display.

Reusability in accelerator modeSee Specify Reusability of Referenced Models.
Linearization of discrete states in accelerator mode

In accelerator mode, discrete states of model references are not exposed to linearization. These discrete states are not perturbed during linearization and, therefore, are not truly free in the trimming process.

Trimming in accelerator mode

The outputs of random blocks are not kept constant during trimming. Outputs that are not kept constant can affect the optimization process.

External mode in accelerator mode

Accelerator mode does not support the External mode option. If you enable the External mode option, accelerator mode ignores it.

Sim viewing device in rapid accelerator mode

In rapid accelerator mode, Simulink does not update a Model block with a sim viewing device.

SIL and PIL mode

See Simulation Mode Override Behavior in Model Reference Hierarchy (Embedded Coder).

Tools Limitations

Simulink Debugger breakpoints

Working with the Simulink Debugger in a parent model, you can set breakpoints at Model block boundaries. Setting the breakpoints allows you to look at the input and output values of the Model block. However, you cannot set a breakpoint inside the model that the Model block references. See Simulink Debugger for more information.

Simulink Profiler

In Normal mode, enabling the Simulink Profiler on a parent model does not enable profiling for referenced models. Enable profiling separately for each referenced model. See How Profiler Captures Performance Data.

Simulink tools that access internal data or model configurations

Simulink tools that require access to the internal data or the configuration of a model have no effect on referenced models executing in accelerator mode. Specifications made and actions taken by such tools are ignored. Examples of tools that require access to model internal data or configuration include:

  • Model Coverage

  • Simulink Report Generator™

  • Simulink Debugger

  • Simulink Profiler

Printing referenced models

You cannot print a referenced model from a top model.

Code Generation Limitations

Configuration parametersSee Configuration Parameter Requirements (Simulink Coder).
Atomic subsystems

If you generate code for an atomic subsystem as a reusable function, when you use accelerator mode, the inputs or outputs that connect the subsystem to a referenced model can affect code reuse. See Generate Reentrant Code from Subsystems (Simulink Coder) for details.

Data type replacement

Simulation target code generation for referenced models in accelerator mode does not support data type replacement.

Related Topics

Was this topic helpful?