4.3 Constant declarations

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

constant_declaration ::=

constant identifier_list :
        subtype_indication [ := expression ] ;


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

4.3.1 Further definitions

identifier_list ::= identifier {, identifier }

subtype_indication ::=
    [ resolution_function_ name ] type_mark [ constraint ]

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

4.3.2 Examples

CONSTANT cte : integer := 5 ;
CONSTANT Vdd, Vcc : bit := '1' ;
CONSTANT minimum_setup_time :
      time := 5 ns ;

The constant cte is of the type integer and has the
value 5. The constants Vdd and Vcc are of the type
bit and have the value '1'. The constant minimum_setup-
_time
is of the physical type time and has the value 5 ns.

CONSTANT name : string := "Dupond" ;

CONSTANT
address : bit_vector := "00110110" ;

CONSTANT
mask : bit_vector( 1 TO 3 ) := "0101" ;

CONSTANT
bittab : bit_vector( 1 TO 9 ) :=
      ( 1 TO 3 => '0', 7 | 9 => 'Z', OTHERS => '1' ) ;

CONSTANT
tab : table_type( 0 TO 4 ) :=
      ( 2, 3, 4, -2, 0 ) ;

The constant name contains the string " Dupond ".

The bit vector address has the constant value "00110110".
The constant mask is declared as a subtype of
bit_vector with the value "0101".
The constant bittab is declared as a subtype of
bit_vector with the value "000111Z1Z".

The constant tab is declared as a subtype of table_type
with the individual elements being assigned
the constant values 2, 3, 4, -2 and 0.

PACKAGE P IS
   CONSTANT deferred : integer ;
END P;

PACKAGE BODY
P IS
   CONSTANT deferred : integer := 200 ;
END P ;

An incomplete declaration of a constant, such as that
of deferred shown here, may only be contained in the
package declaration. The complete declaration of the
constant has to be contained in the package body.
If the constant`s value is changed only the
PACKAGE BODY has to be newly translated and
none of the design units which are constructed upon the
package are affected.