Assert Statement
ASSERT statements are used to print messages at the simulation console when specified runtime conditions are met
ASSERT statements defined one of four severity levels :
- Note -- relays information about conditions to the user
- Warning -- alerts the user to conditions that are not expected, but not fatal
- Error -- relays conditions that will cause the model to work incorrectly
- Failure -- alerts the user to conditions that are catastrophic
Notes:
The ASSERT statement is used to alert the user of some condition inside the model. When the expression in the ASSERT statement evaluates to FALSE, the associated text message is displayed on the simulator console. Additionally, an evaluation of FALSE may be used to halt the simulation, depending on the severity level of the associated ASSERT statement.
The four severity levels, in increasing severity, are listed in this slide. However, the simulator actions associated with each severity level are simulator dependent. For example, a simulator implementation be use the Failure condition to halt a simulation but continue a simulation under the other assertion conditions.