Extend attributes to be used with expressions
Is your capability/feature request related to a problem? Please describe.
In 2019 we gained the ability to use initializations to size objects. However in part 2 of the proposal (unimplemented), there was a suggestion to allow attributes to be used with expressions.
In addition in 2019, port lists became ordered.
Currently attributes such as 'subtype and 'range require, "Any prefix O that is appropriate for an object, or an alias thereof."
Describe the solution you'd like.
Hence, we would benefit from:
entity E is
port(
A : unsigned ;
B : unsigned ;
Y1 : (A+B)'subtype ;
Y2 : unsigned((A+B)'range) ;
) ;
end entity E ;
And also:
signal res : (A + B)'subtype ;
Describe alternatives you've considered.
None.
Additional context
See: http://www.eda-twiki.org/cgi-bin/view.cgi/P1076/InitObjectSizing
and: #188
LRM Edits
In 16.2.3, for all array prefix, change as shown below. See 8.1 or text below for the LRM definition of appropriate for an array type
.
Prefix: Any prefix A that is appropriate for an array type object, or an alias thereof, or that denotes an array subtype whose index ranges are defined by a constraint.