| SimEvents® | ![]() |
| On this page… |
|---|
Even if simultaneous events occur at the same value of the simulation clock, the application processes them sequentially. The processing sequence must reflect causality relationships among events. This table describes the multiple-phase approach the application uses to determine a processing sequence for simultaneous events for which causality considerations alone do not determine a unique correct sequence.
| Phase | Events Processed in This Phase | Processing Sequence for Multiple Events in This Phase |
|---|---|---|
| 1 | Events not on the event calendar | Arbitrary. |
| 2 | Events with priority SYS1 | Same as the scheduling sequence (FIFO). |
| 3 | Events with priority SYS2 | Same as the scheduling sequence (FIFO). |
| 4 | Events with numerical priority values | Ascending order of priority values. For equal-priority events, the sequence is random or arbitrary, depending on the model's Execution order parameter. |
When the sequence is arbitrary, you should not make any assumptions about the sequence or its repeatability.
The events with priority SYS1 enable the application to detect multiple signal updates before reacting to any of them. The events with priority SYS2 enable entities to advance in response to state changes.
For suggestions on how to use the information in the table when creating models, see Choosing an Approach for Simultaneous Events.
During a simulation, the application maintains a list, called the event calendar, of selected upcoming events that are scheduled for the current simulation time or future times. By referring to the event calendar, the application executes events at the correct simulation time and in an appropriate sequence.
The table below indicates which events appear or might appear on the event calendar. In some cases, you have a choice.
| Event | On Event Calendar | How to Cause Event to Appear on Event Calendar |
|---|---|---|
| Counter reset | Yes | |
| Discrete event subsystem execution | Maybe | Select Resolve simultaneous signal updates according to event priority in the dialog box of the Discrete Event Inport block that corresponds to the signal that causes the execution. |
| Entity advancement | No | |
| Entity destruction | No | |
| Entity generation | Yes | |
| Entity request | Yes | |
| Function call | Maybe | Select Resolve simultaneous signal updates according to event priority, if present, in the dialog box of the block that generates the function call. If the dialog box has no such option, the function call is not on the event calendar. |
| Gate (opening or closing) | Yes | |
| Memory read | Maybe | Select Resolve simultaneous signal updates according to event priority on the Read tab of the Signal Latch block's dialog box. |
| Memory write | Maybe | Select Resolve simultaneous signal updates according to event priority on the Write tab of the Signal Latch block's dialog box. |
| Port selection | Yes | |
| Preemption | No | |
| Release | Yes | |
| Sample time hit | No | |
| Service completion | Yes | |
| Storage completion | Yes | |
| Timeout | Yes | |
| Trigger | No | |
| Value change | No |
When you use blocks that offer a Resolve simultaneous signal updates according to event priority option, your choice determines whether, or with what priority, particular events appear on the event calendar. For information about this option, see Resolution Sequence for Input Signals and Choosing How to Resolve Simultaneous Signal Updates.
See these sections for additional information about event sequencing:
Managing Simultaneous Events — Resolving race conditions in discrete-event simulations
Viewing the Event Calendar — Displaying event information in the MATLAB® Command Window during simulation
Resolution Sequence for Input Signals — How the application resolves updates in input signals
![]() | Learning More About SimEvents® Software | Choosing How to Resolve Simultaneous Signal Updates | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |