Table of Contents

Alias declarations

alias_declaration

alias alias_designator [ : subtype_indication ] is name [ signature ] ;

Parents

Further definitions

alias_designator

subtype_indication

[ resolution_function_ name ] type_mark [ constraint ]

name

signature

[ [ type_mark { , type_mark } ] [ return type_mark ] ]

Additional information

Alias can be used for all named entities except labels, loop parameters and generate parameters. An alias for an object (constant, variable, signal, file) is an object alias. All others are nonobject aliases.

The alias of an overloadable object is itself overloadable.

The following rules apply to object aliases:

The following rules apply to nonobject aliases:

Examples

Because of the alias declaration the constant tc can now also be addressed via the name delay .

CONSTANT tc : time := 2.5 ns ;
ALIAS delay : time IS tc ;

Through the alias the variable vector can now be addressed via the name reverse_vector with the indices ranging from 8 to 1.

VARIABLE vector : bit_vector(0 TO 7);
ALIAS reverse_vector : bit_vector
     ( vector'length DOWNTO 1 )
       IS vector ;

Here the variable real_number is aliased differently.

Via sign the MSB of real_number can be addressed.

With mantissa the elements 8 to 31 of real_number are addressed with the indices ranging from 0 to 23.

With exponent the elements 1 to 7 of real_number are addressed with the indices ranging from 1 to 7 as well.

VARIABLE real_number : bit_vector
      ( 0 TO 31 ) ;
ALIAS sign : bit IS real_number(0) ;
 
ALIAS mantissa : bit_vector( 0 TO 23 )
      IS real_number( 8 TO 31 ) ;
 
ALIAS exponent : bit_vector( 1 TO 7 )
      IS real_number( 1 TO 7 ) ;

The predefined type BIT of the automatically visible package STADARD of the library STD is aliased to std_bit .

With this further alias declarations for the values of the enumeration type and the predefined operators are implied.

ALIAS std_bit IS STD.STANDARD.BIT ;
 
-- ALIAS `0' IS STD.STANDARD .'0'
--        [ RETURN STD.STANDARD.BIT ] ;
-- ALIAS `1' IS STD.STANDARD .'1' ;
--        [ RETURN STD.STANDARD.BIT ] ;
 
-- ALIAS "and" IS STD.STANDARD ."and" ;
--[ STD.STANDARD.BIT , STD.STANDARD.BIT
--        RETURN STD.STANDARD.BIT ] ;
-- ALIAS "or" IS STD.STANDARD ."or" ;
--[ STD.STANDARD.BIT , STD.STANDARD.BIT
--        RETURN STD.STANDARD.BIT ] ;
-- ยทยทยท