4.4 Signal 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 ;

signal_declaration ::=

signal
identifier_list : subtype_indication
        [ signal_kind ] [ := 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.4.1 Further definitions

identifier_list ::= identifier { , identifier }

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

signal_kind ::=
    register | bus

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

The signals declared with REGISTER or BUS are 'guarded signals'.

'Guarded signals' have to be 'resolved signals'.

Guarded signal assignments have the following meaning for 'guarded signals':

IF guard_expression THEN
    
sig_name <= sig_waveform ;
ELSE
    
sig_name <= NULL ;
END IF ;

The assignment of NULL to the signal sig_name means that the driver of this signal assignment

is switched off.

This has the following consequences for the 'resolved signal':

If not all drivers were switched off the resulting signal is only determined by the drivers which were not switched off.

If all drivers were switched off the last available signal value is kept in case of the signal declaration REGISTER .

If all drivers were switched off the default value stated in the `resolution function` is used in case of the signal declaration BUS .

The signal driver is switched off immediately, i.e. without delay, after the g uard_expression has taken on the value false except if an explicit delay time was planned to be given to the signal by the disconnection-statement after it was declared a controlled signal. An extensive example on this can be found in the chapter Disconnection specification.

4.4.2 Examples

SIGNAL clk_1, clk_2 : time ;

The signals clk_1 and clk_2 of the
physical type time are declared.

SIGNAL address : bit8 := "00110110" ;

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

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

The signal address of the type bit8 is declared
and initialized with the value "00110110".
The signal bittab is declared by the type bit_vector
and initialized with the value "000111Z1Z".


The signal tab is declared by the type table_type
and initialized with the values 2, 3, 4, -2 and 0.


SIGNAL
address_bus : res_bit_vector
      BUS := "10011001";

The signal address_bus is declared as a guarded
signal (BUS) of the type res_bit_vector and initialized
with the value "10011001".


SIGNAL
resolved_s : res_function
      zbit REGISTER ;

The signal resolved_s is declared as a guarded
signal (REGISTER) of the type zbit . In addition to
that the signal is also assigned a resolution function
res_function .