Code Generation Limitations for Model Reference - MATLAB & Simulink (original) (raw)

Code generation limitations for model references influence how you properly set up the model reference hierarchy for code generation.

In addition to these limitations, a model reference hierarchy used for code generation must satisfy:

Storage Class Limitations

If you have Embedded Coder®, some restrictions exist on grouped storage classes in referenced models. For details, see Storage Class Limitations.

Data Logging Limitations

State Initialization Limitations

When a top model uses the model configuration parameter Initial state to specify initial conditions, Simulink Coder does not initialize the discrete states of the referenced models during code generation.

Model Reuse Limitations

If a referenced model used for code generation has at least one of the following characteristics, the model must specify the model configuration parameter**Total number of instances allowed per top model** as One. Other instances of the model can exist in the hierarchy. If you do not set the parameter toOne, or more than one instance of the model exists in the hierarchy, an error occurs. The characteristics are:

S-Functions Limitations

For additional information, see S-Functions in Referenced Models.

Subsystems Limitations

If you generate code for an atomic subsystem as a reusable function, inputs or outputs that connect the subsystem to a referenced model might prevent code reuse, as described in Generate Reentrant Code from Subsystems.

Targets Limitation

The Simulink Coder S-function target does not support model referencing.

Conditional Models Limitation

When a model contains a trigger or enable port, you cannot generate standaloneSimulink Coder code.

Local Solver Limitation

You can not generate code for a model that uses a local solver. For more information on local solvers, see Use Local Solvers in Referenced Models.

See Also

Topics