Professional Documents
Culture Documents
Attributes VHDL 160423064823
Attributes VHDL 160423064823
on
ATTRIBUTES
Presented by:
Saurav Agrawal
M-Tech(2nd Sem)
T'LEFT: returns the left bound, that is, the leftmost value,
of T.
T'HIGH: returns the upper bound, that is, the value at the
highest position number, of T.
T'LOW: returns the lower bound, that is, the value at the
lowest position number, of T.
For example, if
ALLOWED_VALUE'LEFT = 31
ALLOWED_VALUE'HIGH = 31
ALLOWED_VALUE'RIGHT = 0
ALLOWED_VALUE'LOW = ALLOWED_VALUE'RIGHT
Function Attributes
These attributes represent functions that are called to obtain
a value.
T'POS(V): returns the position number of the value V in
the ordered list of values of T.
T'VAL(P): returns the value of the type that corresponds
to position P.
T'SUCC(V): returns the value of the parameter whose
position is one larger than the position of value V in T.
T'PRED(V): returns the value of the parameter whose
position is one less than the position of value V in type T.
T'LEFTOF(V): returns the value of the parameter that is
to the left of value V in type T.
T'RIGHTOF(V): returns the value of the parameter that is
to the right of value V in type T.
For example, if
Then
STATUS'POS(SEND) = 1
DELAY_TIME'SUCC(21 ns) = 22 ns
DELAY_TIME'PRED(10 ns) is an error
If A is a constrained array object, then
A'LEFT(N): returns the left bound of the Nth dimension
of the array.
A'R.IGHT(N): returns the right bound of the Nth
dimension.
A'LOW(N): returns the lower bound of the Nth
dimension.
A'HIGH(N): returns the upper bound of the Nth
dimension.
If
type COST_TYPE is array (7 downto 0,0 to 3) of
INTEGER;
variable COST_MATRIX: COST_TYPE;
ARITH_OPS'BASE is ALU_OPS
which is the base type, and it can be used in an expression
such as
ARITH_OPS'BASE'LEFT which has the value ADDOP.
Range Attributes
If A is a constrained array object, then
A'RANGE (N): returns the Nth index range of A (N=l, if
not specified).
A'REVERSE.RANGE(N): returns the Nth index range
reversed.
For example, if
then
WBUS'RANGE returns the range 7 downto 0
while
User-Defined Attributes
User-defined attributes are constants of any type. They
are declared using attribute declarations.
For example,
type INCHES is range 0 to 1000
units micron;
end units;
http://www.csee.umbc.edu/portal/help/VHDL/attribute.
html
http://web.engr.oregonstate.edu/~sllu/vhdl/lec5.html