VHDL: Programming By Example, Fourth Edition

This chapter discusses VHDL predefined attributes and the way that concise readable models can be written using attributes. Predefined attributes are data that can be obtained from blocks, signals, and types or subtypes. The data obtained falls into one of the following categories shown:
Value kind A simple value is returned.
Function kind A function call is performed to return a value.
Signal kind A new signal is created whose value is derived from another signal.
Type kind A type mark is returned.
Range kind A range value is returned.
Predefined attributes have a number of very important applications. Attributes can be used to detect clock edges, perform timing checks in concert with ASSERT statements, return range information about unconstrained 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 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 are used to return the bounds...