TWiki
>
P1076 Web
>
Vhdl2019CollectedRequirements
>
EmptyRecord
(revision 2) (raw view)
Edit
Attach
---+ Syntax Regularlization: Empty Records %TOC% ---++ Proposal Information * Who Updates: Main.RyanHinton * Date Proposed: 2013-10-28 * Date Last Updated: 2013-10-28 * Priority: * Complexity: * Focus: General Language ---+++ Language Change Specification link [[LCS2016_082][LCS-2016-082]] ---++ Requirement Summary Allow record declarations to contain no elements. ---++ Rationale Record with debug ports. Record has elements when debugging block. Record empty in final design. The need is similar to that for null arrays. Often I want a port into a component, e.g. for status, and I don't know ahead of time what status I need to include. Assume I write my entity before my architecture and I want to wrap all the status signals in a single OUT-mode record port. Then I have several choices. * Be omniscient and know from the start exactly what I need on my interface. (This may work for you, but it doesn't for me.) * Don't define the record type or add the port until I have the first status item to report. This requires changing a the entity declaration, the package for the record type, any component declaraions, and any instantiations. And then later if all my status items go away for some reason, I have to remove the port and type in all of these contexts again. * Declare the type in the package and the port in the entity declaration. (Currently this can be done with a dummy element.) Then I can add and remove status items simply by adding them to the type declaration in the package, driving them in the architecture (which is where I usually discover what to drive in the first place), and then hook up a receiver somewhere if desired. Obviously the third option is ideal. ---++ Related Issues: None = General ---++ Competing Issues: None at this time ---++ Current Syntax: Currently, a "blank" record requires a dummy element or placeholder of some sort. <verbatim> type confusing_record is record dummy : boolean; -- dummy placeholder to avoid compile errors: confuses designers, muddies -- the interface, wastes processor cycles when ripped out by synthesis, -- wastes memory in simulation; otherwise it works fine end record;</verbatim> ---++ Proposed syntax change Allow records to have zero elements. <verbatim> type accurate_interface is record end record; -- not currently legal</verbatim> ---++ Possible Issues ---++ Arguments FOR * The LRM impact should be light. * No apparent syntax ambiguities or issues. * It shouldn't be difficult for tools to implement. * It's a nice productivity enhancement. ---++ Arguments AGAINST Even C doesn't allow empty struct declarations. The only reason one needs a record type is to access fields of the type. If there are no fields, there's no need for a record type. -- Main.ErnstChristen - 2015-01-21 Null ranges of vectors may occur in values, but objects declared with a null range are meaningless. IMO this proposal makes sense only if slices of records and corresponding concatenations are supported in the language. Many C compilers do tolerate empty structs though (e.g. gcc), and C++ explicitly allows them. Different languages have different needs and this reference does not provide a helpful insight. ---++ General Comments ---++ Supporters _Add your signature here to indicate support for this proposal._ -- Main.RyanHinton - 2013-10-29 -- [[Main.BrentHahoe][Brent Hayhoe]] - 2013-10-30 -- Main.LievenLemiengre - 2015-06-04 -- Main.ThomasPreusser - 2016-09-09 ---++ In opposition _Add your signature here to indicate opposition to this proposal._ --main.CliffordWalinsky - 2013-11-13 -- Main.ErnstChristen - 2015-01-21
Edit
|
Attach
|
P
rint version
|
H
istory
:
r10
|
r4
<
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r1 - 2020-02-17 - 15:34:29 -
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-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