This section describes the predefined attributes of VHDL and the packages that all VHDL implementations must provide.
Predefined attributes denote values, functions, types, and ranges associated with various kinds of named entities. These attributes are described below. For each attribute, the following information is provided:
-- The kind of attribute: value, type, range, function, or signal.
-- The prefixes for which the attribute is defined.
-- A description of the parameter or argument, if one exists.
-- The result of evaluating the attribute, and the result type (if applicable).
-- Any further restrictions or comments that apply.
T'BASE | ||
Kind: | Type. | |
Prefix: | Any type or subtype T. | |
Result: | The base type of T. | |
Restrictions: | This attribute is allowed only as the prefix of the name of another attribute; for example, T'BASE'LEFT. | |
T'LEFT | ||
Kind: | Value. | |
Prefix: | Any scalar type or subtype T. | |
Result Type: | Same type as T. | |
Result: | The left bound of T. | |
T'RIGHT | ||
Kind: | Value. | |
Prefix: | Any scalar type or subtype T. | |
Result Type: | Same type as T. | |
Result: | The right bound of T. | |
T'HIGH | ||
Kind: | Value. | |
Prefix: | Any scalar type or subtype T. | |
Result Type: | Same type as T. | |
Result: | The upper bound of T. | |
T'LOW | ||
Kind: | Value. | |
Prefix: | Any scalar type or subtype T. | |
Result Type: | Same type as T. | |
Result: | The lower bound of T. | |
T'ASCENDING | ||
Kind: | Value. | |
Prefix: | Any scalar type or subtype T. | |
Result Type: | Type Boolean | |
Result: | TRUE if T is defined with an ascending range; FALSE otherwise. | |
T'IMAGE(X) | ||
Kind: | Function. | |
Prefix: | Any scalar type or subtype T. | |
Parameter: | An expression whose type is the base type of T. | |
Result Type: | Type String. | |
Result: | The string representation of the parameter value, without leading or trailing whitespace. If T is an enumeration type or subtype and the parameter value is either an extended identifier or a character literal, the result is expressed with both a leading and trailing reverse solidus (backslash) (in the case of an extended identifier) or apostrophe (in the case of a character literal); in the case of an extended identifier that has a backslash, the backslash is doubled in the string representation. If T is an enumeration type or subtype and the parameter value is a basic identifier, then the result is expressed in lowercase characters. If T is a numeric type or subtype, the result is expressed as the decimal representation of the parameter value without underlines or leading or trailing zeros (except as necessary to form the image of a legal literal with the proper value); moreover, an exponent may (but is not required to) be present and the language does not define under what conditions it is or is not present. If the exponent is present, the "e" is expressed as a lowercase character. If T is a physical type or subtype, the result is expressed in terms of the primary unit of T unless the base type of T is TIME, in which case the result is expressed in terms of the resolution limit(see 3.1.3.1 ); in either case, if the unit is a basic identifier, the image of the unit is expressed in lowercase characters. If T is a floating point type or type, the number of digits to the right of the decimal point corresponds to the standard form generated when the DIGITS parameter to TextIO. Write for type REAL is set to 0 (see 14.3 ). The result never contains the replacement characters described in 13.10 . | |
Restrictions: | It is an error if the parameter value does not belong to the subtype implied by the prefix. | |
T'VALUE(X) | ||
Kind: | Function. | |
Prefix: | Any scalar type or subtype T. | |
Parameter: | An expression of type String. | |
Result Type: | The base type of T. | |
Result: | The value of T whose string representation (as defined in Section 13) is given by the parameter. Leading and trailing whitespace is allowed and ignored. If T is a numeric type or subtype, the parameter may be expressed either as a decimal literal or as a based literal. If T is a physical type or subtype, the parameter may be expressed using a string representation of any of the unit names of T, with or without a leading abstract literal. The parameter must have whitespace between any abstract literal and the unit name. The replacement characters of 13.10 are allowed in the parameter. | |
Restrictions: | It is an error if the parameter is not a valid string representation of a literal of type T or if the result does not belong to the subtype implied by T. | |
T'POS(X) | ||
Kind: | Function. | |
Prefix: | Any discrete or physical type or subtype T. | |
Parameter: | An expression whose type is the base type of T. | |
Result Type: | universal_integer. | |
Result: | The position number of the value of the parameter. | |
T'VAL(X) | ||
Kind: | Function. | |
Prefix: | Any discrete or physical type or subtype T. | |
Parameter: | An expression of any integer type. | |
Result Type: | The base type of T. | |
Result: | The value whose position number is the universal_integer value corresponding to X. | |
Restrictions: | It is an error if the result does not belong to the range T'LOW to T'HIGH. | |
T'SUCC(X) | ||
Kind: | Function. | |
Prefix: | Any discrete or physical type or subtype T. | |
Parameter: | An expression whose type is the base type of T. | |
Result Type: | The base type of T. | |
Result: | The value whose position number is one greater than that of the parameter. | |
Restrictions: | An error occurs if X equals T'HIGH or if X does not belong to the range T'LOW to T'HIGH. | |
T'PRED(X) | ||
Kind: | Function. | |
Prefix: | Any discrete or physical type or subtype T. | |
Parameter: | An expression whose type is the base type of T. | |
Result Type: | The base type of T. | |
Result: | The value whose position number is one less than that of the parameter. | |
Restrictions: | An error occurs if X equals T'LOW or if X does not belong to the range T'LOW to T'HIGH. | |
T'LEFTOF(X) | ||
Kind: | Function. | |
Prefix: | Any discrete or physical type or subtype T. | |
Parameter: | An expression whose type is the base type of T. | |
Result Type: | The base type of T. | |
Result: | The value that is to the left of the parameter in the range of T. | |
Restrictions: | An error occurs if X equals T'LEFT or if X does not belong to the range T'LOW to T'HIGH. | |
T'RIGHTOF(X) | ||
Kind: | Function. | |
Prefix: | Any discrete or physical type or subtype T. | |
Parameter: | An expression whose type is the base type of T. | |
Result Type: | The base type of T. | |
Result: | The value that is to the right of the parameter in the range of T. | |
Restrictions: | An error occurs if X equals T'RIGHT or if X does not belong to the range T'LOW to T'HIGH. | |
A'LEFT [(N)] | ||
Kind: | Function. | |
Prefix: | Any prefix A that is appropriate for an array object, or an alias thereof, or that denotes a constrained array subtype. | |
Parameter: | A locally static expression of type universal_integer, the value of which must not exceed the dimensionality of A. If omitted, it defaults to 1. | |
Result Type: | Type of the left bound of the Nth index range of A. | |
Result: | Left bound of the Nth index range of A. (If A is an alias for an array object, then the result is the left bound of the Nth index range from the declaration of A, not that of the object.) | |
A'RIGHT [(N)] | ||
Kind: | Function. | |
Prefix: | Any prefix A that is appropriate for an array object, or an alias thereof, or that denotes a constrained array subtype. | |
Parameter: | A locally static expression of type universal_integer, the value of which must not exceed the dimensionality of A. If omitted, it defaults to 1. | |
Result Type: | Type of the Nth index range of A. | |
Result: | Right bound of the Nth index range of A. (If A is an alias for an array object, then the result is the right bound of the Nth index range from the declaration of A, not that of the object.) | |
A'HIGH [(N)] | ||
Kind: | Function. | |
Prefix: | Any prefix A that is appropriate for an array object, or an alias thereof, or that denotes a constrained array subtype. | |
Parameter: | A locally static expression of type universal_integer, the value of which must not exceed the dimensionality of A. If omitted, it defaults to 1. | |
Result Type: | Type of the Nth index range of A. | |
Result: | Upper bound of the Nth index range of A. (If A is an alias for an array object, then the result is the upper bound of the Nth index range from the declaration of A, not that of the object.) | |
A'LOW [(N)] | ||
Kind: | Function. | |
Prefix: | Any prefix A that is appropriate for an array object, or an alias thereof, or that denotes a constrained array subtype. | |
Parameter: | A locally static expression of type universal_integer, the value of which must not exceed the dimensionality of A. If omitted, it defaults to 1. | |
Result Type: | Type of the Nth index range of A. | |
Result: | Lower bound of the Nth index range of A. (If A is an alias for an array object, then the result is the lower bound of the Nth index range from the declaration of A, not that of the object.) | |
A'RANGE [(N)] | ||
Kind: | Range. | |
Prefix: | Any prefix A that is appropriate for an array object, or an alias thereof, or that denotes a constrained array subtype. | |
Parameter: | A locally static expression of type universal_integer, the value of which must not exceed the dimensionality of A. If omitted, it defaults to 1. | |
Result Type: | The type of the Nth index range of A. | |
Result: | The range A'LEFT(N) to A'RIGHT(N) if the Nth index range of A is ascending, or the range A'LEFT(N) downto A'RIGHT(N) if the Nth index range of A is descending. (If A is an alias for an array object, then the result is determined by the Nth index range from the declaration of A, not that of the object.) | |
A'REVERSE_RANGE [(N)] | ||
Kind: | Range. | |
Prefix: | Any prefix A that is appropriate for an array object, or an alias thereof, or that denotes a constrained array subtype. | |
Parameter: | A locally static expression of type universal_integer, the value of which must not exceed the dimensionality of A. If omitted, it defaults to 1. | |
Result Type: | The type of the Nth index range of A. | |
Result: | The range A'RIGHT(N) downto A'LEFT(N) if the Nth index range of A is ascending, or the range A'RIGHT(N) to A'LEFT(N) if the Nth index range of A is descending. (If A is an alias for an array object, then the result is determined by the Nth index range from the declaration of A, not that of the object.) | |
A'LENGTH [(N)] | ||
Kind: | Value. | |
Prefix: | Any prefix A that is appropriate for an array object, or an alias thereof, or that denotes a constrained array subtype | |
Parameter: | A locally static expression of type universal_integer, the value of which must not exceed the dimensionality of A. If omitted, it defaults to 1. | |
Result Type: | universal_integer. | |
Result: | Number of values in the Nth index range; i.e., if the Nth index range of A is a null range, then the result is 0. Otherwise, the result is the value of T'POS(A'HIGH(N)) - T'POS(A'LOW(N)) + 1, where T is the subtype of the Nth index of A. | |
A'ASCENDING [(N)] | ||
Kind: | Value. | |
Prefix: | Any prefix A that is appropriate for an array object, or an alias thereof, or that denotes a constrained array subtype. | |
Parameter: | A locally static expression of type universal integer, the value of which must be greater than zero and must not exceed the dimensionality of A. If omitted, it defaults to 1. | |
Result Type: | Type Boolean. | |
Result: | TRUE if the Nth index range of A is defined with an ascending range; FALSE otherwise. | |
S'DELAYED [(T)] | ||
Kind: | Signal. | |
Prefix: | Any signal denoted by the static signal name S. | |
Parameter: | A static expression of type TIME that evaluates to a nonnegative value. If omitted, it defaults to 0 ns. | |
Result Type: | The base type of S. | |
Result: | A signal equivalent to signal S delayed T units of time. The value of S'DELAYED(t) at time Tn is always equal to the value of S at time Tn-t. Specifically: | |
Let R be of the same subtype as S, let T >= 0 ns, and let P be a process statement of the formP: process (S) begin R <= transport S after T; end process ; Assuming that the initial value of R is the same as the initial value of S, then the attribute 'DELAYED is defined such that S'DELAYED(T) = R for any T. | ||
S'STABLE [(T)] | ||
Kind: | Signal. | |
Prefix: | Any signal denoted by the static signal name S. | |
Parameter: | A static expression of type TIME that evaluates to a nonnegative value. If omitted, it defaults to 0 ns. | |
Result Type: | Type Boolean. | |
Result: | A signal that has the value TRUE when an event has not occurred on signal S for T units of time, and the value FALSE otherwise. (See 12.6.2 .) | |
S'QUIET [(T)] | ||
Kind: | Signal. | |
Prefix: | Any signal denoted by the static signal name S | |
Parameter: | A static expression of type TIME that evaluates to a nonnegative value. If omitted, it defaults to 0 ns. | |
Result Type: | Type Boolean. | |
Result: | A signal that has the value TRUE when the signal has been quiet for T units of time, and the value FALSE otherwise. (See 12.6.2 .) | |
S'TRANSACTION | ||
Kind: | Signal. | |
Prefix: | Any signal denoted by the static signal name S. | |
Result Type: | Type Bit. | |
Result: | A signal whose value toggles to the inverse of its previous value in each simulation cycle in which signal S becomes active. | |
Restriction: | A description is erroneous if it depends on the initial value of S'Transaction. | |
S'EVENT | ||
Kind: | Function. | |
Prefix: | Any signal denoted by the static signal name S. | |
Result Type: | Type Boolean. | |
Result: | A value that indicates whether an event has just occurred on signal S. Specifically: | |
For a scalar signal S, S'EVENT returns the value TRUE if an event has occurred on S during the current simulation cycle; otherwise, it returns the value FALSE. | ||
For a composite signal S, S'EVENT returns TRUE if an event has occurred on any scalar subelement of S during the current simulation cycle; otherwise, it returns FALSE. | ||
S'ACTIVE | ||
Kind: | Function. | |
Prefix: | Any signal denoted by the static signal name S. | |
Result Type: | Type Boolean. | |
Result: | A value that indicates whether signal S is active. Specifically: | |
For a scalar signal S, S'ACTIVE returns the value TRUE if signal S is active during the current simulation cycle; otherwise, it returns the value FALSE. | ||
For a composite signal S, S'ACTIVE returns TRUE if any scalar subelement of S is active during the current simulation cycle; otherwise, it returns FALSE. | ||
S'LAST_EVENT | ||
Kind: | Function. | |
Prefix: | Any signal denoted by the static signal name S. | |
Result Type: | Type Time. | |
Result: | The amount of time that has elapsed since the last event occurred on signal S. Specifically: | |
For a signal S, S'LAST_EVENT returns the smallest value T of type TIME such that S'EVENT = True during any simulation cycle at time NOW - T, if such value exists; otherwise, it returns TIME'HIGH. | ||
S'LAST_ACTIVE | ||
Kind: | Function. | |
Prefix: | Any signal denoted by the static signal name S. | |
Result Type: | Type Time. | |
Result: | The amount of time that has elapsed since the last time at which signal S was active. Specifically: | |
For a signal S, S'LAST_ACTIVE returns the smallest value T of type TIME such that S'ACTIVE = True during any simulation cycle at time NOW - T, if such value exists; otherwise, it returns TIME'HIGH. | ||
S'LAST_VALUE | ||
Kind: | Function. | |
Prefix: | Any signal denoted by the static signal name S. | |
Result Type: | The base type of S. | |
Result: | The previous value of S, immediately before the last change of S. | |
S'DRIVING | ||
Kind: | Function. | |
Prefix: | Any signal denoted by the static signal name S. | |
Result Type: | Type Boolean. | |
Result: | If the prefix denotes a scalar signal, the result is False if the current value of the driver for S in the current process is determined by the null transaction; True otherwise. If the prefix denotes a composite signal,the result is True if and only if R'DRIVING is True for every scalar subelement R of S; False otherwise. If the prefix denotes a null slice of a signal, the result is True. | |
Restrictions: | This attribute is available only from within a process, a concurrent statement with an equivalent process, or a subprogram. If the prefix denotes a port, it is an error if the port does not have a mode of inout, out, or buffer. It is also an error if the attribute name appears in a subprogram body that is not a declarative item contained within a process statement and the prefix is not a formal parameter of the given subprogram or of a parent of that subprogram. Finally, it is an error if the prefix denotes a subprogram formal parameter whose mode is not inout or out. | |
S'DRIVING_VALUE | ||
Kind: | Function. | |
Prefix: | Any signal denoted by the static signal name S. | |
Result Type: | The base type of S. | |
Result: | If S is a scalar signal S, the result is the current value of the driver for S in the current process. If S is a composite signal, the result is the aggregate of the values of R'DRIVING_VALUE for each element R of S. If Sis a null slice, the result is a null slice. | |
Restrictions: | This attribute is available only from within a process, a concurrent statement with an equivalent process, or a subprogram. If the prefix denotes a port, it is an error if the port does not have a mode of inout, out, or buffer. It is also an error if the attribute appears in a subprogram body that is not a declarative item contained within a process statement and the prefix is not a formal parameter of the given subprogram or of a parent of that subprogram. Finally, it is an error if the prefix denotes a subprogram formal parameter whose mode is not inout or out, or if S'DRIVING is False at the time of the evaluation of S'DRIVING_VALUE. | |
E'SIMPLE_NAME | ||
Kind: | Value. | |
Prefix: | Any named entity as defined in 5.1 . | |
Result Type: | Type String. | |
Result: | The simple name, character literal, or operator symbol of the named entity, without leading or trailing whitespace or quotation marks but with apostrophes (in the case of a character literal) and both a leading and trailing reverse solidus (backslash) (in the case of an extended identifier).In the case of a simple name or operator symbol, the characters are converted to their lowercase equivalents. In the case of an extended identifier, the case of the identifier preserved, and any reverse solidus characters appearing as part of the identifier are represented with two consecutive reverse solidus characters. | |
E'INSTANCE_NAME | ||
Kind: | Value. | |
Prefix: | Any named entity other than the local ports and generics of a component declaration. | |
Result Type: | Type String. | |
The result string has the following syntax: | ||
instance_name ::= package_based_path | full_instance_based_path package_based_path ::= leader library_logical_name leader package_simple_name leader [ local_item_name ] full_instance_based_path ::= leader full_path_to_instance [ local_item_name ] full_path_to_instance ::= { full_path_instance_element leader } local_item_name ::= simple_name character_literal operator_symbol full_path_instance_element ::= [ component_instantiation_label @ ] entity_simple_name ( architecture_simple_name ) | block_label | generate_label | process_label | loop_label | subprogram_simple_name generate_label ::= generate_label [ ( literal ) ] process_label ::= [ process_label ] leader ::= : |
Package-based paths identify items declared within packages. Full-instance-based paths identify items within an elaborated design hierarchy.
A library logical name denotes a library; see 11.2 . Since multiple logical names may denote the same library, the library logical name may not be unique.
There is one full path instance element for each component instantiation, block statement, generate statement, process statement, or subprogram body in the design hierarchy between the root design entity and the named entity denoted by the prefix.
In a full path instance element, the architecture simple name must denote an architecture associated with the entity interface designated by the entity simple name; furthermore, the component instantiation label (and the commercial at following it) are required unless the entity simple name and the architecture simple name together denote the root design entity.
The literal in a generate label is required if the label denotes a generate statement with a for generation scheme; the literal must denote one of the values of the generate parameter.
A process statement with no label is denoted by an empty process label.
All characters in basic identifiers appearing in the result are converted to their lowercase equivalents. Both a leading and trailing reverse solidus surround an extended identifier appearing in the result; any reverse solidus characters appearing as part of the identifier are represented with two consecutive reverse solidus characters.
E'PATH_NAME | ||
Kind: | Value. | |
Prefix: | Any named entity other than the local ports and generics of a component declaration. | |
Result Type: | Type String. | |
Result: | A string describing the hierarchical path starting at the root of the design hierarchy and descending to the named entity, excluding the name of instantiated design entities. Specifically: | |
The result string has the following syntax: | ||
path_name ::= package_based_path | instance_based_path instance_based_path ::= leader path_to_instance [ local_item_name ] path_to_instance ::= { path_instance_element leader } path_instance_element ::= component_instantiation_label | entity_simple_name | block_label | generate_label | process_label | subprogram_simple_name |
Package-based paths identify items declared within packages. Full- instance - based paths identify items within an elaborated design hierarchy.
There is one path instance element for each component instantiation, block statement, generate statement, process statement, or subprogram body in the design hierarchy between the top design entity and the named entity denoted by the prefix.
Examples: