Array

LRM §3.2.1.

A data type which consists of a vector or a multi-dimensional set of values of the same base type.

Syntax:

type array_name is array ( range, ... ) of data_type            -- constrained
type array_name is array ( type range <>, ... ) of data_type    -- unconstrained

Description:

An array is a composite object, which elements are of the same subtype. Each element is uniquely distinguished by an index. The number of indices is the number of dimensions, i.e. one-dimensional array has one index, two-dimensional has two indices, etc.

An array may be either constrained or unconstrained. The array is constrained if the size of the array is constrained. The size of the array can be constrained using a discrete type mark or a range.

The array is said to be unconstrained if its size is unconstrained: the size of the unconstrained array is declared in the form of the name of the discrete type, which range is unconstrained. The number of elements of unconstrained array type is unknown.

The values within an array can be read or written using an indexed name or a slicename.

Example:

subtype Byte is std_logic_vector(7 downto 0); 
type Mem is array (0 to 63) of Byte; 
variable Memory : Mem; 
... 
if Read then 
  Data <= Memory(to_integer(Address)); 
elsif Write then 
  Memory(to_integer(Address) := Data; 
end if;

Notes:

See also:

Name, Range, String, Type