TWiki
>
P1076 Web
>
VHDL2017
>
LCS2016_082
(2017-04-02,
PatrickLehmann
)
(raw view)
E
dit
A
ttach
---+!! Language Change Specification for Empty records syntax regularization <br />%TOC% | <sticky><b>LCS Number:</b></sticky> | LCS-2016-082 | | <sticky><b>Version:</b></sticky> | 2 | | <sticky><b>Date:</b></sticky> | 22-Dec-2016 (ver.1), 10-Feb-2017 (ver.2) | | <sticky><b>Status:</b></sticky> | | | <sticky><b>Author:</b></sticky> | [[Main.RyanHinton][Ryan Hinton]] | | <sticky><b>Email:</b></sticky> | %USERINFO{"RyanHinton" format="$emails"}% | | <sticky><b>Source Doc:</b></sticky> | [[EmptyRecord][Syntax regularization: empty records]] | | <sticky><b>Summary:</b></sticky> | Allow record type definitions to have zero elements | ---++ Voting Results: Cast your votes here Yes: 1 %USERSIG{RyanHinton - 2016-12-22}% - Version 2 1 %USERSIG{ThomasPreusser - 2016-12-22}% - Version 2 1 %USERSIG{FarrellOstler - 2016-12-22}% - Version 1 1 %USERSIG{BrentHahoe - 2016-12-23}% - Version 1 1 %USERSIG{JakkoVerhallen - 2016-12-29}% - Version 1 1 %USERSIG{MartinZabel - 2017-02-17}% - Version 2 1 %USERSIG{RobGaddi - 2017-01-26}% - Version 1 1 %USERSIG{JimLewis- 2017-02-06}% - Version 1 1 %USERSIG{PatrickLehmann - 2017-02-16}% - Version 2 No: 1 Abstain: 1 %USERSIG{KevinJennings - 2016-12-23}% - Version 1...don't think I'll make use of this, but not really opposed if it helps someone else 1 %USERSIG{LievenLemiengre - 2017-01-27}% 1 %USERSIG{BrentHahoe - 2017-02-16}% Version 2 - Abstain due to lack of personal time for review. 1 %USERSIG{MartinThompson- 2017-02-17}% Version 2 - what KevinJ said ---++ Details of Language Change Changes are shown in %RED%red font%ENDCOLOR%. Deleted text is %RED%<del>crossed out</del>%ENDCOLOR%. Editing comments are in %GREEN%green%ENDCOLOR%. ---+++ LRM 5.3.3 Record types %GREEN%Modify BNF after first full paragraph, middle of page 51 (pdf 65).%ENDCOLOR% <sticky><pre>%BLACK% record_type_definition ::= <b>record</b> %RED%<del>element_declaration</del>%BLACK% { element_declaration } <b>end</b> <b>record</b> [ %GRAY%<i>record_type</i>%BLACK%_simple_name ] </pre></sticky> %GREEN%(The identical change should be made in the syntax summary in Annex C.)%ENDCOLOR% ---+++ LRM 9.3.5 Qualified expressions A qualified expression is a basic operation (see 5.1) that is used to explicitly state the type, and possibly the subtype, of an operand that is an expression or an aggregate. <pre>qualified_expression ::= type_mark ' ( expression ) | type_mark ' aggregate %RED%| type_mark ' ( )%ENDCOLOR% </pre> %RED%For qualified expressions with an operand, <del>T</del>%ENDCOLOR%the operand shall have the same type as the base type of the type mark. The value of %RED%such%ENDCOLOR% a qualified expression is the value of the operand. The evaluation of %RED%such%ENDCOLOR% a qualified expression evaluates the operand and converts it to the subtype denoted by the type mark. %RED%A qualified expression without an operand is used to express a literal for a composite type or subtype with no elements. The value of such a qualified expression is an empty value of the type or subtype denoted by the type mark.%ENDCOLOR% -- %USERSIG{RyanHinton - 2016-12-22}% ---+ Comments Suave uses "type foo is null record" to define empty records. How does a map to an empty record look like? Are empty record compatible? -- %BUBBLESIG{PatrickLehmann - 2016-12-31}% *PL:* Suave uses type foo is null record to define empty records. *MZ:* Requiring null record does not work well with conditional compilation. The record might get empty based on conditions. -- %BUBBLESIG{MartinZabel - 2017-01-09}% An alternative for null record is: <pre>type MyRecord is record null; end record;</pre> I changed my vote to NO, because I think an empty initialization should be addressed by this proposal too. <pre>type MyRecord is record `if DEBUG = "TRUE" then debug1 : std_logic; `end if end record; entity E1 is port (P : MyRecord); end entity; entity E2 is end entity; architecture A2 of E2 is begin inst : entity work.E1 port map (P => ( `if DEBUG = "TRUE" then debug1 => '1' `end if ) ); end architecture; </pre> If DEBUG is FALSE, then the port map collapses to port map (P !=> () ). Empty aggregation lists are not supported. -- %BUBBLESIG{PatrickLehmann - 2017-01-09}% Could we force a record aggregate that may be empty to use a qualified expression? In Patrick's example: <pre>architecture A2 of E2 is begin inst : entity work.E1 port map (P => MyRecord'( `if DEBUG = "TRUE" then debug1 => '1' `end if ) ); end architecture;</pre> -- %BUBBLESIG{RobGaddi - 2017-01-27}% Version 2 created to use Rob's great idea. -- %BUBBLESIG{RyanHinton - 2017-02-10}% What happens for string'('A') is then the ('A') understood as a element of an aggregate? string'() = "" I am not saying that there are any issues, but there may be some rough edges -- %BUBBLESIG{JimLewis - 2017-03-21}% %COMMENT%
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r22
<
r21
<
r20
<
r19
<
r18
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r22 - 2017-04-02 - 15:42:45 -
PatrickLehmann
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