TWiki
>
P1076 Web
>
VHDL2017
>
LCS2016_018a
(revision 13) (raw view)
Edit
Attach
---+ Language Change Specification for New Attributes ---++ | <sticky><b>LCS Number:</b></sticky> | LCS-2016-018a | | <sticky><b>Version:</b> </sticky> | 1 {03-Jan-2017} | | <sticky><b>Date:</b> </sticky> | 03-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> | Adds new attributes. | ---+++ Voting Results: Cast your votes here Yes: 1 %USERSIG{PatrickLehmann - 2017-01-03}% - ver 1 1 %USERSIG{RyanHinton - 2017-01-03}% - ver 1 1 %USERSIG{JimLewis - 2017-01-04}% - ver 1 1 %USERSIG{KevinJennings - 2017-01-05}% - ver 1 1 %USERSIG{MartinZabel - 2017-01-09}% - ver 1 1 %USERSIG{ThomasPreusser - 2017-01-13}% - ver 1 1 %USERSIG{RobGaddi - 2017-01-15}% - ver 1 1 %USERSIG{LievenLemiengre - 2017-01-27}% - ver 1 1 %USERSIG{HendrikEeckhaut - 2017-01-27}% ver 1 No: 1 Abstain: 1. %USERSIG{BrentHahoe - 2017-02-16}% Version 1 - Abstain due to lack of personal time for review. ---++ 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 While writing LCS-2016-59 (Improved Type Generics), I figured out that array objects define a ='ELEMENT= attribute to access the elements %BR% type, but it's not possible to access the indices type. This LCS adds a ='INDEX= attribute. This LCS is required by LCS-2016-059a, which was separated due to this missing attribute. ---++ Details of Language Change ---+++ 16.2.3 Predefined attributes of arrays %GREEN%[Editor note: This sub-section might be renamed by LCS-2016-018 to 16.2.4.]%ENDCOLOR% %BR% %GREEN%[Editor note: Insert the next table before table for A'ELEMENT.]%ENDCOLOR% %BR% | %RED%A'INDEX[(N)]%ENDCOLOR% \ | %RED%Kind:%ENDCOLOR% | %RED%Subtype%ENDCOLOR% | | | %RED%Prefix:%ENDCOLOR% | %RED%Any prefix A that is appropriate for an array object, or an alias %BR% \ thereof, or that denotes an array subtype.%ENDCOLOR% | | | %RED%Parameter:%ENDCOLOR% | %RED%A locally static expression of type _universal_integer_, the value %BR% \ of which shall not exceed the dimensionality of A. If omitted, it defaults to 1.%ENDCOLOR% | | | %RED%Result:%ENDCOLOR% | %RED%The subtype of the Nth index range of A. (If A is an alias for an array %BR% \ object, then the result is determined by the declaration of A, not that of the object.)%ENDCOLOR% | ---++ Comments Judging from the current text of the other array index-related constraints (='left=, ='high=, etc.), very simple language should suffice to describe the result. I have edited the proposal with the language I think is best. I also changed the name of the attribute to be similar to ='element= and ='base=. -- %BUBBLESIG{RyanHinton - 2017-Jan-03}% Isn't A'INDEX(N) equivalent to A(N)'SUBTYPE? If it is equivalent, then why is this LCS needed? If it is different, can you explain how it is different and I'll probably switch from 'No' to 'Yes' vote. -- %BUBBLESIG{KevinJennings - 2017-01-05}% In short NO :). %BR% =A(N)'SUBTYPE= returns the subtype of an element, not the subtype of an array index range. %BR% Example: =type arr is array(natural range 0 to 7, natural range 0 to 3) of bit;= %BR% * =arr'ELEMENT= returns the elements subtype -> =bit= * =arr(N)'SUBTYPE= returns the subtype of the Nth element (same as above) * =arr'RANGE= returns the range of =arr='s index, but not it's subtype, thus the range can not be used to get an index type alias or subtype The following code is not valid: =(sub)type idx is arr'RANGE;= %BR% And this code creates a different incompatible type: =type idx is range arr'LOW to arr'HIGH;= %BR% Both =idx= definitions (if working) cannot be used to index an element in an array of type =arr=. %BR% So in conclusion, a handle to an arrays index type is needed. -- %BUBBLESIG{PatrickLehmann - 2017-01-05}% %COMMENT%</sticky> </noautolink>
Edit
|
Attach
|
P
rint version
|
H
istory
:
r16
<
r15
<
r14
<
r13
<
r12
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r1 - 2017-04-02 - 15:37:46 -
TWikiGuest
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-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback