Keyword: ASSERT
The assert keyword indicates the beginning of an assert statement. An assert statement checks to see if a given condition is true and, if the statement is not true, performs some action.
An assert statement includes two options, either or both of which may be used:
(1) report—which displays a user-defined message if the given condition is false, and
(2) severity—which allows the user to choose a severity level if the given condition is false.
The four possible severity levels are: Note, Warning, Error, and Failure. The value of severity is typically used to control the actions of a simulation in the event the given condition is false. For example, a severity level of Failure may be used to stop the simulation.
Example
assert (S = S_expected)
report "S does not match the expected value!"
severity Error;
LRM
8.2, 8.3
See also