Access

LRM §3.3.

A type that allows dynamic memory allocation. An access value is returned by an allocator (equivalent to pointers in C or Pascal)

Syntax:

type type_name is access data_type;

type incomplete_type_name;

Description:

Access type allows to manipulate data, which are created dynamically during simulation and which exact size is not known in advance. Any reference to them is performed via allocators, which work in a similar way as pointers in programming languages.

The only objects allowed to be of the access type are variables.

The default value of an access type is null.

For each incomplete type declaration there must be a corresponding full type declaration with the same name. The complete declaration must appear in the same declarative part. A type declared as incomplete may not be used for any other purposes than to define an access type before the complete type definition is accomplished.

Example:

--declaration of record
type DataRecord is record
   Data: std_logic_vector(15 downto 0);
   NextData: Link;
end record;

-- declaration of the access type
type Link is access DataRecord; 
  
variable StartOfRecords, Ptr: Link;

See also:

Null, Record, Type