Contents
Up
Previous
Next
Record types
Record types, like array types, are composite types because they represent
a collection of values. In the case of a record type, the collection of
values is organized by name and can be of different types. Each value in the
collection has a name and is referenced by that name. A record type is
declared by listing the named values and their types. The grammar rule for the
record type definition is:
element-declaration : name-list ":" subtype ";"
record-type-definition :
RECORD element-declaration
{ element-declaration }
END RECORD
There are no predefined record types. The following is an example of
a record type that might be used to define a cache element
type cache_element is record
tag : integer range 0 to 256;
valid : boolean;
writeback : boolean;
data : bit_vector (15 downto 0);
end record;
If x was a data object of the cache_element type then the value
of the valid field of that data object is referenced by x.valid using the
dot notation.