| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about 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 any of three modes: Normal, Accelerator, or Processor-in-the-loop (PIL).
Simulink executes a Normal mode submodel interpretively, as if the submodel were an atomic subsystem implemented directly within the parent model. Normal mode:
Requires no delay for code generation or compilation
Works with most Simulink tools
Executes slower than Accelerator mode
Works with only one instance of each model used in a reference hierarchy
Simulation results for a given model are essentially identical in either Normal or Accelerator mode. Trivial differences may occur due to differences in the optimizations and libraries used.
Simulink executes an Accelerator mode submodel by creating a MEX-file (or simulation target) for the submodel, then running the MEX-file. See Model Reference Simulation Targets for more information. Accelerator mode:
Takes time for code generation and compilation
Does not work with most Simulink tools.
Executes faster than Normal mode
Works with multiple instances of each model used in a reference hierarchy
Simulation results for a given model are essentially identical in either Normal or Accelerator mode. Trivial differences may occur due to differences in the optimizations and libraries used.
Simulink executes a PIL-mode referenced model by:
Creating both a MEX-file and a model reference target for the submodel.
Executing cross-compiled object code on a target processor or an equivalent instruction set simulator.
Simulink PIL mode:
Is designed for verifying deployment code on target processors
Requires Real-Time Workshop® Embedded Coder™ software
Works with only one branch (top model and subordinates) in a hierarchy
For more information, see Verifying Compiled Object Code with Processor-in-the-Loop Simulation in the Real-Time Workshop Embedded Coder documentation.
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, Accelerator, or Processor-in-the-loop (PIL).
When a parent model executes in Normal mode, it can contain Normal mode, Accelerator mode, and PIL mode submodels. At most one instance of a given model can execute in Normal mode. A submodel can execute in Normal mode only if every model that is superior to it in the hierarchy also executes in Normal mode. A Normal mode path then extends from the top model through the model reference hierarchy down to the Normal mode submodel.
When a parent model executes in Accelerator mode, all subordinate models must also execute in Accelerator mode. When a Normal mode model is subordinate to an Accelerator mode model, Simulink posts a warning and temporarily overrides the Normal mode specification. When a PIL-mode model is subordinate to an Accelerator mode model, an error occurs.
When a parent model executes in PIL mode, all subordinate models also execute in PIL mode regardless of the simulation mode specified by their Model blocks. The PIL mode Model block uses the model reference targets of the blocks beneath. Only one branch (top model and all subordinates) in a model reference hierarchy can execute in PIL mode. For more information, see Verifying Compiled Object Code with Processor-in-the-Loop Simulation in the Real-Time Workshop Embedded Coder documentation, and Creating Model Components in the Real-Time Workshop documentation.
You can use Simulink Accelerator mode (see Accelerating Models) or Rapid Accelerator mode (see Testing and Refining Concept Models With Standalone 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 displays an error message.
Be careful not confuse Accelerator mode execution of a referenced model with:
Accelerator mode execution of a freestanding or top model, as described in Accelerating Models
Rapid Accelerator mode execution of a freestanding or top model, as described in Testing and Refining Concept Models With Standalone Rapid Simulations.
While the different types of acceleration share many capabilities and techniques, they are implemented differently, and have different requirements and limitations.
![]() | Converting a Subsystem to a Referenced Model | Viewing a Model Reference Hierarchy | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |