Documentation

Simulation Mode Override Behavior in Model Reference Hierarchy

When the top model contains aModelblock, the simulation mode of the top model can override the simulation mode of theModelblock. The model referenced by theModelblock can be a parent model that containsModelblocks at lower levels of the model hierarchy. When you simulate the model hierarchy, the simulation mode used by a parent model can override the simulation mode of anyModelblocks it contains.

You can specify the simulation mode of a top model to be normal, accelerator, rapid accelerator, SIL, or PIL. With aModelblock, you can specify all modesexceptrapid accelerator. This table shows how the software determines the effective simulation mode of aModelblock in a model hierarchy.

Simulation Mode Used by Parent Model Simulation Mode of Model Block
Normal Accelerator SIL PIL
Normal Compatible Compatible Compatible Compatible
Accelerator Overridden Compatible

Compatible if top model mode is accelerator.

Error if parent block mode is accelerator.

Compatible if top model mode is accelerator.

Error if parent block mode is accelerator.

Rapid accelerator(top model only) Overridden Compatible Error Error
SIL Overridden Overridden Compatible Error
PIL Overridden Overridden Error Compatible

The different types of behavior are:

  • Compatible — The software simulates theModelblock in the mode specified for it.

  • Error — The simulation produces an error. For example, if a top model specifies rapid accelerator mode but contains aModelblock in SIL or PIL mode, then running a simulation produces an error: the rapid accelerator mode cannot override the SIL and PIL mode ofModelblocks. This behavior avoids the risk of false positives, that is, the simulation of a model in rapid accelerator mode does not lead to the conclusion that generated source or object code ofModelblocks is tested or verified.

  • Overridden — The simulation mode of the top model or parent model overrides the simulation mode of theModelblock. For example, if a top model or parent model that you configured for a SIL simulation contains aModelblock with normal or accelerator simulation mode, then the software simulates the referenced model in SIL mode. The override behavior:

    • Allows aModelblock in the model hierarchy to have SIL or PIL mode.

    • Makes lower-level referenced models execute in SIL or PIL mode if you simulate the top model or parent model in SIL or PIL mode. You do not have to switch the simulation mode of every referenced model in the hierarchy.

多pleModelblocks, starting at the top of a model hierarchy, can execute in SIL or PIL mode. However, if code coverage or code execution profiling is enabled, only oneModelblock can execute at a time in SIL or PIL mode.

Note

You can view your model hierarchy in the Model Dependency Viewer. In the Referenced Model Instances view, the software displaysModelblocks differently to indicate their simulation modes, for example, normal, accelerator, SIL, and PIL. In this view, the software does not indicate the simulation mode of the top model.

Related Topics