VHDL Programming

(C. Jardin) #1

144 Chapter Six


Predefined attributes have a number of very important applications.
Attributes can be used to detect clock edges, perform timing checks in
concert with ASSERTstatements, return range information about uncon-
strained types, and much more. All of these applications are examined in
this chapter. First, we discuss each of the predefined attribute kinds and
the ways that these attributes can be applied to modeling.

Value Kind Attributes


Value attributes are used to return a particular value about an array of a
type, a block, or a type in general. Value attributes can be used to return
the length of an array or the lowest bound of a type. Value attributes can
be further broken down into three subclasses:

Value type attributes, which return the bounds of a type

Value array attributes, which return the length of an array

Value block attributes, which return block information

Value Type Attributes


Value type attributes are used to return the bounds of a type. For instance,
a type defined as shown in the following would have a low bound of 0 and
a high bound of 7:

TYPE state IS (0 TO 7);

There are four predefined attributes in the value type attribute category:

T’LEFT, which returns the left bound of a type or subtype

T’RIGHT, which returns the right bound of a type or subtype

T’HIGH, which returns the upper bound of a type or subtype

T’LOW, which returns the lower bound of a type or subtype

Attributes are specified by the character ’and then the attribute name.
The object preceding the ’is the object that the attribute is attached to.
The capital Tin the preceding descriptions means that the object that the
attribute is attached to is a type. The ’character is pronounced “tick”
among VHDL hackers. Therefore, the first attribute in the preceding list
is specified “T tick left.”
Free download pdf