TWiki
>
P1076 Web
>
Vhdl2019CollectedRequirements
>
TopLCS2016_018b
(2020-02-17,
JimLewis
)
(raw view)
E
dit
A
ttach
---+ Language Change Specification for Attribute Shorthands ---++ | <sticky><b>LCS Number:</b></sticky> | LCS-2016-018b | | <sticky><b>Version:</b> </sticky> | 1 {04-Jan-2017} | | <sticky><b>Date:</b> </sticky> | 04-Jan-2017 | | <sticky><b>Status:</b> </sticky> | Voting | | <sticky><b>Author:</b> </sticky> | Patrick Lehmann | | <sticky><b>Email:</b> </sticky> | [[Main.PatrickLehmann]] | | <sticky><b>Source Doc:</b></sticky> | [[EnumAttributes][Attributes for Enumerated Types]] | | <sticky><b>Summary:</b> </sticky> | Attribute shorthands. | ---+++ Voting Results: Cast your votes here Yes: 1 %USERSIG{PatrickLehmann - 2017-01-04}% - ver 1 No: 1 Abstain: 1 ---++ Style Notes <noautolink> <sticky> Changes are shown in %RED%red font%ENDCOLOR%.%BR% Deletions are %RED%<del>crossed out</del>%ENDCOLOR%.%BR% Editing or reviewing notes in %GREEN%green font%ENDCOLOR%. ---++ Reviewing Notes Many attributes are only defined for types. This requires either a type prefix or the use of ='BASETYPE= to apply an %BR% attribute to an object. This LCS add attributes for objects, inherited from correnponding types. ---++ Details of Language Change ---+++ 16.2.3 Predefined attributes of objects %GREEN%[inserted by LCS-2016-018]%ENDCOLOR% %GREEN%[Editor note: Insert this paragraph after the table for O'SUBTYPE.]%ENDCOLOR% %BR% %RED%If a type T defines an attribute ATTR without any parameter, then an object O of type T shall define an attribute %BR% with same name, kind, result type, result and restrictions. (ATTR is an arbitrary attribute name predefined for T.) %BR% The expression =O'ATTR= shall be equivalent to =O'SUBTYPE'ATTR=. As an exception, the attribute ='BASE= is not defined %BR% for objects.%ENDCOLOR% %RED%If a type T defines an attribute ATTR with one parameter X, which is expected to be of type T, then an object O %BR% of type T shall define an attribute with same name, kind, result type, result and restrictions, but without any parameter. %BR% (ATTR is an arbitrary attribute name predefined for T.) The expression =O'ATTR= shall be equivalent to =O'SUBTYPE'ATTR(O)=. %BR% As an exception, the attributes ='VALUE= and ='VAL= are not defined for objects.%ENDCOLOR% %RED%<b>Example:</b> <pre> process type T is (A, B, C, D); variable V1 : T; variable V2 : integer := 5; begin -- The following 3 statments are equivalent and report "D". report T'image(T'right); report T'image(V1'subtype'right); report T'image(V1'right); -- The following 3 statments are equivalent and report "5". report integer'image(V2); report V2'subtype'image(V2); report V2'image; end process; </pre>%ENDCOLOR% %BR% %BR% ---++ Comments As I read it, this LCS is only trying to provide a shorthand way to retrieve attributes and no new feature. However, this LCS would conflict with LCS-2016-72a which I wrote which uses the same shorthand to deliver a new feature. Specifically, the difference is when one refers to a parameter to a subprogram. In that situation, I would like to have V2'left (as an example) return something different than V2'subtype'left (while leaving the current functionality of V2'subtype'left). I believe that LCS-2016-72a would accomplish the same goal that you have here with this LCS (at least for objects that are scalars), but rather than only providing two methods to accomplish the same goal LCS-2016-072a would provide new functionality. Please review that LCS. At a minimum, the differences between the two should get resolved so that they are not in conflict. -- %BUBBLESIG{KevinJennings - 2017-01-04}% %COMMENT% </sticky> </noautolink>
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r8
<
r7
<
r6
<
r5
<
r4
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r8 - 2020-02-17 - 15:34:40 -
JimLewis
P1076
Log In
or
Register
P1076 Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
Webs
Main
P1076
Ballots
LCS2016_080
P10761
P1647
P16661
P1685
P1734
P1735
P1778
P1800
P1801
Sandbox
TWiki
VIP
VerilogAMS
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback