| Simulink® | ![]() |
| On this page… |
|---|
About Referenced Model Simulation Modes |
Simulink® executes the top model in a model reference hierarchy just as it would if no referenced models existed. All Simulink simulation modes are available to the top model. Simulink can execute a referenced model in either of two modes:
Normal mode — Simulink executes the submodel interpretively, as if the submodel were an atomic subsystem implemented directly within the parent model. Normal mode is slower than Accelerator mode, and works with only one instance of a given model in a reference hierarchy, but it requires no delay for code generation and works with most Simulink tools.
Accelerator mode — Simulink creates a MEX-file for the submodel, then executes the submodel by running the MEX-file. Accelerator mode is faster than Normal mode, and works with multiple submodel instances, but it requires compilation and does not work with most Simulink tools.
Simulation results for a given model are essentially identical in either mode. Trivial differences may occur due to differences in the optimizations and libraries used.
Note Do not confuse Accelerator mode execution of a referenced model with:
While the different types of acceleration share many capabilities and techniques, they are implemented differently, and have somewhat different requirements and limitations. |
The Model block for each instance of a referenced model controls its simulation mode. The default referenced model simulation mode is Accelerator mode. To set or change a submodel's simulation mode:
Access the Model block's parameter dialog box. (See Navigating a Model Block.)
Set the Simulation mode field to Normal or Accelerator.
Simulink models execute in Normal mode by default. When a top model executes in Normal mode, it can contain both Normal mode and Accelerator mode submodels. When the same submodel appears more than once in a hierarchy, at most one of these instances can specify Normal mode. All the rest must specify Accelerator mode.
Accelerator mode takes precedence over Normal mode when the two are mixed. Thus a model that executes in Normal mode can include submodels that execute in Accelerator mode, but a model that executes in Accelerator mode cannot include any submodels that execute in Normal mode. When a Normal mode submodel is subordinate to an Accelerated mode submodel, Simulink posts a warning and temporarily overrides the Normal mode specification.
You can use Simulink Accelerator mode (see Accelerating Models) or Rapid Accelerator mode (see Running Rapid Simulations) to achieve faster execution of any Simulink model, including a top model in a model reference hierarchy.
When you execute a top model in Simulink Accelerator mode or Rapid Accelerator mode, all submodels execute in Accelerator mode. For any submodel that specifies Normal mode, Simulink posts a warning and temporarily overrides the Normal mode specification.
![]() | Converting a Subsystem to a Referenced Model | Simulation Targets | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |