Contents Up << >>

Assertion and report statements

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: 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: 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.

The report statement produces the same kind of report, but does not have a condition expression, it is always reported. The syntax of the report statement is: