Contents
Up
Previous
Next
Attributes
Attributes represent attributes of objects. The syntax for using an attribute
is
attribute-name : prefix "'" simple-name ["(" expression ")"]
The following is a description of the predefined attributes:
- base
- The base attribute designates the base type of its prefix. The
prefix must be a type or subtype name. This attribute is only allowed as
the prefix of another attribute. For example, natural'base'low.
- left
- The left attribute designates the left-most bound of its
prefix. The prefix may be any scalar type or subtype.
- right
- The right attribute designates the right-most bound of its
prefix. The prefix may be any scalar type or subtype.
- low
- The low attribute designates the lower bound of its
prefix. The prefix may be any scalar type or subtype.
- high
- The high attribute designates the upper bound of its
prefix. The prefix may be any scalar type or subtype.
- pos(X)
- This attribute returns the position number of its parameter
X. Its prefix must be a discrete or physical type or subtype.
- val(X)
- This attribute returns the value at the position, in the type,
given by its parameter X. Its prefix must be a discrete or physical type or
subtype.
- succ(X)
- This returns the value whose position number is one more than
its parameter X. Its prefix must be a discrete or physical type or subtype.
- pred(X)
- This returns the value whose position number is one less than
its parameter X. Its prefix must be a discrete or physical type or subtype.
- leftof(X)
- This returns the value that is left of its parameter X in the
type given by the prefix. Its prefix must be a discrete or physical type or
subtype.
- rightof(X)
- This returns the value that is right of its parameter X in the
type given by the prefix. Its prefix must be a discrete or physical type or
subtype.
- left [(X)]
- The left attribute returns the left bound of
the Nth dimension of its prefix. If the option argument is given, then N is
X; otherwise, N is 1. The prefix must be an array object or constrained array
type.
- right [(X)]
- The right attribute returns the right bound of
the Nth dimension of its prefix. If the option argument is given, then N is
X; otherwise, N is 1. The prefix must be an array object or constrained array
type.
- low [(X)]
- The low attribute returns the lower bound of
the Nth dimension of its prefix. If the option argument is given, then N is
X; otherwise, N is 1. The prefix must be an array object or constrained array
type.
- high [(X)]
- The high attribute returns the upper bound of
the Nth dimension of its prefix. If the option argument is given, then N is
X; otherwise, N is 1. The prefix must be an array object or constrained array
type.
- range [(X)]
- This attribute designates the range of
the Nth dimension of its prefix. If the option argument is given, then N is
X; otherwise, N is 1. The prefix must be an array object or constrained array
type.
- reverse_range [(X)]
- This attribute designates the reverse of the
range of
the Nth dimension of its prefix. If the option argument is given, then N is
X; otherwise, N is 1. The prefix must be an array object or constrained array
type.
- length [(X)]
- This attribute returns the length of
the Nth dimension of its prefix. If the option argument is given, then N is
X; otherwise, N is 1. The prefix must be an array object or constrained array
type.
- delayed [(T)]
- The delayed attribute creates a signal whose value
is the value of its prefix delayed by T time units. The prefix must be
a signal. If the optional value for T does not appear, then T is
0 fs.
- stable [(T)]
- The stable attribute creates a signal whose value is
true when an event has not occurred on the prefix signal in T units of time.
The prefix must be a signal. If the optional value for T does not appear,
then T is 0 fs.
- quiet [(T)]
- The quiet attribute creates a signal whose value is
true when the signal prefix has been quiet for T units of time.
The prefix must be a signal. If the optional value for T does not appear, then
T is 0 fs.
- transaction
- This attribute creates a boolean signal whose value
toggles every time there is a transaction on its signal prefix.
The prefix must be a signal.
- event
- The event attribute returns true if an event has occurred on
its signal prefix during the current simulation cycle. The prefix must
denote a signal.
- active
- The event attribute returns true if a transaction has occurred on
its signal prefix during the current simulation cycle. The prefix must
denote a signal.
- last_event
- This attribute returns the time that has elapsed since the
last event occurred on its signal prefix. The prefix must denote a signal.
- last_active
- This attribute returns the time that has elapsed since the
last transaction occured on its signal prefix. The prefix must denote a
signal.
- last_value
- This attribute returns the value its signal prefix had
prior to the last event. The prefix must denote a signal.
- behavior
- Designates true if the prefix does not contain a component
instantiation statement. The prefix must be an architecture or block name.
- structure
- Designates true if the prefix contains only component
instantiation statements. The prefix must be an architecture or block name.
The users may also declare attributes with the attribute declaration
and specification. They follow the rules:
attribute-declaration : ATTRIBUTE simple-name ":" type ";"
entity-class : ENTITY | ARCHITECTURE | PROCEDURE | FUNCTION |
PACKAGE | TYPE | SUBTYPE | CONSTANT | SIGNAL | VARIABLE |
COMPONENT | LABEL
entity-list : name-list | OTHERS | ALL
entity-specification : entity-list ":" entity-class
attribute-specification :
ATTRIBUTE simple-name OF entity-specification IS expression ";"
The attribute declaration creates the attribute with the specified name.
Attribute specifications indicate the values that the attribute has
for various prefixes. Each specification indicates the value of
that attribute for the prefixes listed in the entity specification.
The value is given by the expression part. If the entity specification
contains a name list, then the named entities will have the
specified attribute with the specified value. The list of names must denote
objects of the entity class specified.
If the entity specification
contains the reserved word OTHERS, then all the entities of the specified
class that do not appear in another attribute specification will have
the specified attribute with the specified value. If the entity specification
contains the reserved word ALL, then all the entities of the specified
class will have the specified attribute with the specified value.