Simulating a model that uses model referencing differs in some ways from simulating a standalone model that does not use model referencing.
Simulink® executes the top model in a model reference hierarchy the same way that it executes models without model referencing. All the Simulink simulation modes are available to the top model. To achieve faster execution of a top model in a model reference hierarchy, you can use Simulink accelerator mode or rapid accelerator mode. For details about accelerator mode, see the Acceleration documentation. For information about rapid accelerator mode, see Accelerate, Refine, and Test Hybrid Dynamic System on Host Computer by Using RSim System Target File.
When you execute a top model in Simulink accelerator mode or rapid accelerator mode, all referenced models execute in accelerator mode.
You can simulate a referenced model in one of these modes:
For more information about using these simulation modes for referenced models, see Comparison of Simulation Modes for Referenced Models.
The simulation modes used for referenced models depend on the simulation mode of the parent model. For details, see Parent and Referenced Model Simulation Modes.
The Model block for each instance of a referenced model controls the simulation mode of the instance. To set or change the simulation mode for a referenced model:
Access the block parameter dialog box for the Model block. (See Navigating a Model Block.)
Set the Simulation mode parameter.
Click OK or Apply.
You can use rapid accelerator mode for the top model in a model reference hierarchy, but not for referenced models.
The different simulation modes for referenced models share many capabilities and techniques, but they have different implementations, requirements, and limitations.
Tip Accelerator mode execution of a referenced model is different than:
For more information about accelerator mode execution of a referenced model, see Model Referencing Simulation Targets.
|Simulation Mode||Description||When to Use|
|Normal||Executes referenced model interpretively.|
Simulink executes a normal mode referenced model interpretively. Compared to other simulation modes, normal mode:
You can use normal mode with multiple instances of a referenced model. For details, see Simulate Models with Multiple Referenced Model Instances.
Executes the referenced model by creating a MEX-file (a simulation target) for the referenced model, then running the MEX-file.
For more information, see Model Referencing Simulation Targets.
Executes referenced model by generating production code. This code is compiled for, and executed on, the host platform.
SIL mode provides a convenient alternative to PIL simulation when the target hardware is not available.
Executes referenced model by generating production code. This code is cross-compiled for, and executed on, a target processor or an equivalent instruction set simulator.
Note: Simulation results for a given model are nearly identical in normal and accelerator modes. Trivial differences can occur, depending on differences in the optimizations and libraries that you use.
The simulation modes you can use for a referenced model depends on the simulation mode of its parent model.
|Parent Model Simulation Mode||Referenced Model Simulation Modes|