Contents
Up
Previous
Next
Assertion statement
The assertion statement is used to assert that a certain condition should
be true at the time of its execution. It is a convenient way of detecting
and reporting errors during execution. Its syntax is:
assertion-statement :
assert condition
[REPORT expression]
[SEVERITY expression] ";"
The condition is a boolean expression that should be true. If the condition
evaluates to false, then an error message is displayed with an indication
of its severity. If the severity clause appears, then the expression should
be of the predefined severity_level type and indicates the severity of
the invalid condition. The severity_level type is defined by:
type SEVERITY_LEVEL is (NOTE,WARNING,ERROR,FAILURE);
If the severity clause does not appear, then the default severity is ERROR.
If the severity level is FAILURE, then the simulator will stop execution.
The report clause specifies a string expression that should be displayed
when the assertion fails. If it does not appear, then the default message
"Assertion violation" is displayed.