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 scheduled on the event calendar||Arbitrary.|
|2||Events with priority ||Same as the scheduling sequence (FIFO).|
|3||Events with priority ||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
the application to detect multiple signal updates before reacting
to any of them. The events with priority
entities to advance in response to state changes.
For suggestions on how to use the information in the table when creating models, see Choose 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 are scheduled or might be scheduled on the event calendar. In some cases, you have a choice.
|Event Name||Event Type in Debugger||Scheduled On Event Calendar||How to Schedule Event on Event Calendar|
|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 scheduled 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.|
|New head of queue||Yes|
|Sample time hit||No|
|Subsystem||Maybe||Select Resolve simultaneous signal updates according to event priority in the dialog box of the Event Filter block that receives the signal that causes the subsystem execution.|
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 are scheduled on the event calendar. For information about this option, see Resolution Sequence for Input Signals and Resolve Simultaneous Signal Updates.