| Simulink® | ![]() |
| On this page… |
|---|
A simulation target, or SIM target, is a MEX-file that implements a referenced model that executes in Accelerator mode. Simulink invokes the simulation target as needed during simulation to compute the behavior and outputs of the referenced model. Simulink uses the same simulation target for all Accelerator mode instances of a given referenced model anywhere in a reference hierarchy.
Be careful not to confuse a submodel's simulation target with any of these other types of target:
Hardware target — A platform for which Real-Time Workshop generates code
System target — A file that tells Real-Time Workshop how to generate code for particular purpose
Rapid Simulation target (RSim) — A system target file supplied with Real-Time Workshop
Model reference target — A library module that contains Real-Time Workshop code for a referenced model
Simulink creates a simulation target only for a submodel that has one or more Accelerator mode instances in a reference hierarchy. A submodel that executes only in Normal mode always executes interpretively and does not use a simulation target. When one instance of a submodel executes in Normal mode, and one or more instances execute in Accelerator mode, Simulink creates a simulation target for the Accelerator mode instance(s), but the Normal mode instance does not use it.
Because Accelerator mode requires code generation, it imposes some requirements and limitations that do not apply to Normal mode. Aside from these constraints, you can generally ignore simulation targets and their details when you execute a referenced model in Accelerator mode. See Limitations on Accelerator Mode Referenced Models for details.
If a simulation target does not exist at the beginning of a simulation, or when you update a parent model's block diagram, Simulink by default generates the needed target from the referenced model. If the simulation target already exists, Simulink by default checks whether the submodel has changed significantly since the target was last generated. If so Simulink by default regenerates the target to reflect changes in the model.
You can change this default behavior to change the rebuild criteria or specify that Simulink always or never rebuilds targets. See Rebuild options for details. You can command Simulink to generate simulation targets for Accelerator mode referenced models at any time by updating the model's diagram or by executing the slbuild command with appropriate arguments at the MATLAB command line.
While generating a simulation target, Simulink displays status messages at the MATLAB command line to enable you to monitor the target generation process, which entails generating and compiling code and linking the compiled target code with compiled code from standard code libraries to create an executable file.
Simulink creates simulation targets in a subdirectory of the working directory. This subdirectory is named slprj. If slprj does not exist, Simulink creates it. Subdirectories in slprj provide separate places for simulation code, Real-Time Workshop code, and other files.
You can reduce the time that Simulink spends checking whether any or all simulation targets need to be rebuilt by setting configuration parameter values as follows:
In all referenced models throughout the hierarchy, set Configuration Parameters > Diagnostics > Data Validity > Signal resolution to Explicit only. (See Signal resolution.)
In any referenced model for which you want to minimize change checking time, set Configuration Parameters > Model Referencing > Rebuild options to If any changes in known dependencies detected. (See Rebuild options.)
These parameter values exist in a referenced model's configuration set, not in the individual Model block, so setting either value for any instance of a referenced model sets it for all instances of that model.
![]() | Referenced Model Simulation Modes | Simulink Model Referencing Requirements | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |