TWiki
>
P1076/Ballots Web
>
Vhdl2019CollectedRequirements
>
DeferredSharedVariables
>
TopLCS2016_080
(revision 2) (raw view)
Edit
Attach
---+!! Language Change Specification for Deferred Shared Variables Proposal %TOC% ---++ LCS | <sticky><b>LCS Number:</b></sticky> | LCS-2016-080 | | <sticky><b>Version:</b></sticky> | 1.0 | | <sticky><b>Date:</b></sticky> | 24-Jul-16 | | <sticky><b>Status:</b></sticky> | Draft | | <sticky><b>Author:</b></sticky> | [[Main.BrentHahoe][Brent Hayhoe]] | | <sticky><b>Email:</b></sticky> | <sticky><a href="mailto:Brent.Hayhoe@AftonroyNOSPAM.com">Brent.Hayhoe@AftonroyNOSPAM.com</a></sticky> | | <sticky><b>Source Doc:</b></sticky> | [[DeferredSharedVariables][Deferred Shared Variables]] | | <sticky><b>Summary:</b></sticky> | Enable a shared variable declaration within the same package as its associated protected type declaration | ---+++ Details of Language Change: ---++++ LRM 4.7 Package declarations ---+++++!! page 31 middle Replace the 5th paragraph beginning: 'NOTE--Not all packages ...' with the following paragraph: 'NOTE--Not all packages will have a package body. In particular, a package body is unnecessary if no subprograms, deferred constants, %BLUE%<u>deferred shared variables, deferred signals, </u>%ENDCOLOR%or protected type definitions are declared in the package declaration.' --- Replace the second *package body* code with: <sticky><pre><font color="black"> -- A package declaration that needs a package body: <b>package</b> TriState <b>is</b> <b>type</b> Tri <b>is</b> ('0', '1', 'Z', 'E'); <b>function</b> BitVal (Value: Tri) <b>return</b> Bit; <b>function</b> TriVal (Value: Bit) <b>return</b> Tri; <b>type</b> TriVector <b>is array</b> (Natural <b>range <></b>) <b>of</b> Tri; <b>function</b> Resolve (Sources: TriVector) <b>return</b> Tri;</font><font color="blue"><u> <b>constant</b> TriA_c : Tri; <b>deferred constant</b> TriB_c : Tri; <b>deferred shared variable</b> Tri_sv : Tri; <b>deferred signal</b> Tri_s : Tri;</u></font><font color="black"> <b>end package</b> TriState;</font> </pre></sticky> ---++++ LRM 4.8 Package bodies ---+++++!! page 31 middle Replace the 1st paragraph beginning: 'A package body defines ...' with the following paragraph: 'A package body defines the bodies of subprograms%RED%<strike> and</strike>%BLUE%<u>, the values of deferred constants, deferred shared variables and the initial values of deferred signals </u>%BLACK% declared in the interface to the package.' ---+++++!! page 32 middle Replace the 5th paragraph beginning: 'If a given package declaration ...' with the following paragraph: 'If a given package declaration contains a deferred constant declaration (see 6.4.2.2), %BLUE%<u>a deferred shared variable declaration (see 6.4.2.4) or a deferred signal declaration (see 6.4.2.3), </u>%ENDCOLOR% then a constant declaration%BLUE%<u>, a shared variable declaration or a signal declaration </u>%ENDCOLOR%with the same %BLUE%<u>respective </u>%ENDCOLOR%identifier shall appear as a declarative item in the corresponding package body. This object declaration is called the _full_ declaration of the deferred constant%BLUE%<u>, deferred shared variable or deferred signal</u>%ENDCOLOR%. The subtype indication given in the full declaration shall lexically conform to that given in the deferred constant declaration%BLUE%<u>, deferred shared variable declaration or deferred signal declaration</u>%ENDCOLOR%.' --- Replace the 6th paragraph beginning: 'Within a package declaration ...' with the following paragraph: Within a package declaration that contains the declaration of a deferred constant, and within the body of that package (before the end of the corresponding full declaration), the use of a name that denotes the deferred constant is only allowed in the default expression for a local generic, local port, or formal parameter. The result of evaluating an expression that references a deferred constant%BLUE%<u>, a deferred shared variable or a deferred signal</u>%BLACK% before the elaboration of %RED%<strike>the</strike>%BLUE%<u>its</u>%BLACK% corresponding full declaration is not defined by the language. ---++++ LRM 4.10 Conformance rules ---+++++!! page 34 top Replace the 3rd paragraph beginning: 'Lexical conformance is likewise ...' with the following paragraph: 'Lexical conformance is likewise defined for subtype indications in deferred constant declarations%BLUE%<u>, deferred shared variable declarations, or deferred signal declarations</u>%ENDCOLOR%.' ---++++ LRM 6.4.2.2 Constant declarations ---+++++!! page 67 middle Replace the BNF production with: <sticky><pre>%BLACK% constant_declaration ::= <b>constant</b> identifier_list : subtype_indication [ := expression ] ;%BLUE%<u> | <b>deferred constant</b> identifier_list : subtype_indication ;</u> </pre></sticky> --- Replace the paragraph beginning: 'If the assignment symbol ":=" followed by an expression is not present in a constant declaration, then ...' with the following paragraph: 'If the assignment symbol ":=" followed by an expression is not present in a constant declaration, %BLUE%<u>or the reserved word *constant* is preceded by the reserved word *deferred*, </u>%ENDCOLOR%then the declaration declares a deferred constant. It is an error if such a constant declaration appears anywhere other than in a package declaration. The corresponding full constant declaration, which defines the value of the constant, shall appear in the body of the package (see 4.8).' ---+++++!! page 68 top Add to the end of the 'Examples' list: <sticky><pre>%BLACK% <b>constant</b> TOLER: DISTANCE := 1.5 nm; <b>constant</b> PI: REAL := 3.141592; <b>constant</b> CYCLE_TIME: TIME := 100 ns; <b>constant</b> Propagation_Delay: DELAY_LENGTH; -- A deferred constant.%BLUE%<u> <b>deferred constant</b> Propagation_Delay: DELAY_LENGTH; -- A deferred constant.</u>%ENDCOLOR% </pre></sticky> ---++++ LRM 6.4.2.3 Signal declarations ---+++++!! page 68 top Replace the BNF productions with: <sticky><pre> %BLACK%signal_declaration ::= <b>signal</b> identifier_list : subtype_indication [ signal_kind ] [ := expression ] ;%BLUE%<u> | <b>deferred signal</b> identifier_list : subtype_indication [ signal_kind ] ;</u>%BLACK% signal_kind ::= <b>register</b> | <b>bus</b>%ENDCOLOR% </pre></sticky> --- After the paragraph beginning: 'In the absence of an explicit default expression ...' insert the following paragraph: '%BLUE%<u>If the assignment symbol ":=" followed by an expression is not present in a signal declaration and the reserved word *signal* is preceded by the reserved word *deferred*, then the declaration declares a deferred signal. It is an error if such a signal declaration appears anywhere other than in a package declaration. The corresponding full signal declaration, which defines the initial value of the signal, shall appear in the body of the package (see 4.8).</u>%ENDCOLOR%' ---+++++!! page 69 middle Add to the end of the 'Examples' list: <sticky><pre> %BLACK%<b>signal</b> S: STANDARD.BIT_VECTOR (1 to 10); <b>signal</b> CLK1, CLK2: TIME; <b>signal</b> OUTPUT: WIRED_OR MULTI_VALUED_LOGIC;%BLUE%<u> <b>deferred signal</b> INPUT: BIT; -- A deferred signal.</u>%ENDCOLOR% </pre></sticky> ---++++ LRM 6.4.2.4 Variable declarations ---+++++!! page 70 top Replace the BNF production with: <sticky><pre> %BLACK%variable_declaration ::= %RED%<strike>[ <b>shared</b> ] </strike>%BLACK%<b>variable</b> %identifier_list : subtype_indication [ := expression ] ;%BLUE%<u> | [ <b>deferred</b> ] <b>shared variable</b> identifier_list : <i>protected_</i>subtype_indication ;</u>%ENDCOLOR% </pre></sticky> --- After the paragraph beginning: 'If the variable declaration includes the assignment symbol followed by an expression ...' insert the following paragraph: '%BLUE%<u>If the reserved words *shared variable* are preceded by the reserved word *deferred* in a shared variable declaration, then the declaration declares a deferred shared variable. It is an error if such a shared variable declaration appears anywhere other than in a package declaration. The corresponding full shared variable declaration, which associates the method(s) and variable(s) of the corresponding protected type with the shared variable, shall appear in the body of the package (see 4.8).</u>%ENDCOLOR%' ---+++++!! page 71 bottom Add to the end of the 'Examples' list: <sticky><pre> %BLACK%<b>variable</b> INDEX: INTEGER <b>range</b> 0 <b>to</b> 99 := 0; -- Initial value is determined by the initial value expression <b>variable</b> COUNT: POSITIVE; -- Initial value is POSITIVE'LEFT; that is,1 <b>variable</b> MEMORY: BIT_MATRIX (0 <b>to</b> 7, 0 <b>to</b> 1023); -- Initial value is the aggregate of the initial values of each element <b>shared variable</b> Counter: SharedCounter; -- See 5.6.2 and 5.6.3 for the definitions of SharedCounter <b>shared variable</b> addend, augend, result: ComplexNumber; -- See 5.6.2 and 5.6.3 for the definition of ComplexNumber <b>variable</b> bit_stack: VariableSizeBitArray; -- See 5.6.2 and 5.6.3 for the definition of VariableSizeBitArray;%BLUE%<u> <b>deferred shared variable</b> COUNT: POSITIVE; -- A deferred shared variable. -- Methods and variable(s) defined in the package body</u>%ENDCOLOR% </pre></sticky> ---++++ LRM 15.10 Reserved words ---+++++!! page 236 Insert the new reserved word %BLUE%<u><b>deferred</b> </u>%ENDCOLOR%after the reserved word *default* in the list. ---++++ LRM Annex C Syntax summary ---+++++!! page 483 Replace the 'constant_declaration' BNF production with the following: <sticky><pre> %BLACK%constant_declaration ::= [§ 6.4.2.2] <b>constant</b> identifier_list : subtype_indication [ := expression ];%BLUE%<u> | <b>deferred constant</b> identifier_list : subtype_indication ;</u>%ENDCOLOR% </pre></sticky> ---+++++!! page 497 Replace the 'signal_declaration' BNF production with the following: <sticky><pre> %BLACK%signal_declaration ::= [§ 6.4.2.3] <b>signal</b> identifier_list : subtype_indication [ signal_kind ] [ := expression ] ;%BLUE%<u> | <b>deferred signal</b> identifier_list : subtype_indication [ signal_kind ] ;</u>%ENDCOLOR% </pre></sticky> ---+++++!! page 500 Replace the 'variable_declaration' BNF production with the following: <sticky><pre> %BLACK%variable_declaration ::= [§ 6.4.2.4] %RED%<strike>[ <b>shared</b> ] </strike>%BLACK%<b>variable</b> %identifier_list : subtype_indication [ := expression ] ;%BLUE%<u> | [ <b>deferred</b> ] <b>shared variable</b> identifier_list : <i>protected_</i>subtype_indication ;</u>%ENDCOLOR% </pre></sticky> ---++++ LRM Annex I Glossary ---+++++!! page 563 Insert before the *'deferred constant'* item the following: '%BLUE%<u><b>deferred:</b> The reserved word *deferred* inserted at the beginning of statement declaring an object declaration of class constant, signal or the subclass shared variable, within a package declaration, defines the object as _deferred_ and delays the analysis of the object until the associated package body is analysed.</u>%ENDCOLOR%' ---+++++!! page 563 Replace the *'deferred constant'* item with the following: '<b>deferred constant:</b> A constant that is declared without an assignment symbol (:=) and %BLUE%<u>its corresponding expression, or with the reserved word *deferred* </u>%ENDCOLOR% in a package declaration. A corresponding full declaration of the constant shall exist in the package body to define the value of the constant. (6.4.2.2)' --- Insert the two new *'deferred shared variable'* and *'deferred signal'* items after the *'deferred constant'* item: '%BLUE%<u><b>deferred shared variable:</b> A shared variable that is declared with the reserved word *deferred* in a package declaration. A corresponding full declaration of the shared variable shall exist in the package body. (6.4.2.4)</u>%ENDCOLOR%' '%BLUE%<u><b>deferred signal:</b> A signal that is declared with the reserved word *deferred* in a package declaration. A corresponding full declaration of the signal shall exist in the package body with an initial value of the signal. (6.4.2.3)</u>%ENDCOLOR%' ---+++++!! page 567 Replace the *'full declaration'* item with the following: '<b>full declaration:</b> A constant declaration%BLUE%<u>, shared variable declaration, or signal declaration </u>%ENDCOLOR%occurring in a package body with the same identifier as that of a deferred constant declaration%BLUE%<u>, deferred shared variable declaration, or deferred signal declaration </u>%ENDCOLOR%in the corresponding package declaration. A full type declaration is a type declaration corresponding to an incomplete type declaration. (4.8)' ---+++++!! page 571 Replace the *'lexically conform'* item with the following: '<b>lexically conform:</b> Two subprogram specifications are said to lexically conform if, apart from certain allowed minor variations, both specifications are formed by the same sequence of lexical elements, and corresponding lexical elements are given the same meaning by the visibility rules. Lexical conformance is defined similarly for deferred constant declarations%BLUE%<u>, deferred shared variable declarations and deferred signal declarations </u>%ENDCOLOR%. (4.10)' ---+++++!! page 578 Replace the *'shared variable'* item with the following: '<b>shared variable:</b> A variable accessible by more than one process. Such variables shall be of a protected type. %BLUE%<u>Shared variables declared in packages can also be _deferred shared variables_. </u>%ENDCOLOR%(6.4.2.4)' ---+++++!! page 579 Replace the *'signal'* item with the following: '<b>signal:</b> An object with a past history of values. A signal may have multiple drivers, each with a current value and projected future values. The term _signal_ refers to objects declared by signal declarations or port declarations. %BLUE%<u>Signals declared in packages can also be _deferred signals_. </u>%ENDCOLOR%(6.4.2.3)'
Edit
|
Attach
|
P
rint version
|
H
istory
:
r4
<
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r1 - 2016-11-28 - 11:25:48 -
TWikiGuest
P1076/Ballots
Log In
or
Register
P1076/Ballots 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