8.2 Assertion

...
ENTITY e IS
    ...
BEGIN
    ...
END e ;

...
ARCHITECTURE a OF e IS
    ...
BEGIN
    ...
END a ;

...
CONFIGURATION c
        OF e IS
    ...
    ...
    ...
END

...
PACKAGE pkg IS
    ...
    ...
    ...
END pkg ;


assertion_statement ::=

    [ label : ] assertion ;

..
PACKAGE BODY pck
        IS
    ...
    ...
    ...
END pck ;

...
b: BLOCK IS
    ...
BEGIN
    ...
END BLOCK b ;

FUNCTION f (...)
    RETURN r IS
    ...
BEGIN
    ...
END f ;

PROCEDURE p (...) IS
    ...
BEGIN
    ...
END p ;

p : PROCESS
    ...
BEGIN
    ...
END PROCESS p ;

8.2.1 Further definitions

assertion ::=
    assert condition
    [ report expression ]
    [ severity expression ]

condition ::= boolean _expression

expression ::=
    relation { and relation }
    | relation { or relation }
    | relation { xor relation }
    | relation [ nand relation ]
    | relation [ nor relation ]

8.2.2 Comments

The REPORT expression have to be of type string.

In absence of the REPORT clause the default string "Assertion Violation." will be used.

The SEVERITY expression have be of type severity_level. Possible values are:
note, warning, error, failure.

In absence of the SEVERITY clause the default error will be used.

8.2.3 Examples

ASSERT signal_reset = '1' ;

It is checked whether signal_reset is not equal to 1 .

ASSERT variable_reset = '1'
REPORT "Reset is active !" ;

If variable_reset is not equal to 1 the report
``Reset is active`` is given.

ASSERT reset = '1' OR set = '1'
  REPORT "Reset and Set" &
         "simultaneously active !"
  SEVERITY failure ;

If the condition which is to be verified is not
fulfilled an error is reported and measures in
accordance with the severity level are taken.

ASSERT data = 0
REPORT "Datum ist gleich " &
      integer_to_string( data ) & " !"
SEVERITY note ;

If data is not equal to 0 a severity note containing
the current value of data is given.

ASSERT false
REPORT "End of simulation!"
SEVERITY failure ;

This assertion automatically (false) stops
(severity_level = failure) the simulation at the time
evaluated