TWiki
>
P1076 Web
>
Vhdl2019CollectedRequirements
>
DeferredSharedVariables
>
TopLCS2016_080a
(revision 31) (raw view)
Edit
Attach
---+!! Language Change Specification for Deferred Shared Variables Proposal ---++!! Primary LCS: This is the main LCS describing the changes to support extended *deferred* object classes within a *package* declaration. %TOC% | <sticky><b>LCS Number:</b></sticky> | LCS-2016-080a | | <sticky><b>Version:</b></sticky> | 2 | | <sticky><b>Date:</b></sticky> | 18-Dec-16 | | <sticky><b>Status:</b></sticky> | Ballot | | <sticky><b>Author:</b></sticky> | [[Main.BrentHahoe][Brent Hayhoe]] | | <sticky><b>Email:</b></sticky> | %USERINFO{"BrentHahoe" format="$emails"}% | | <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 | | <sticky><b>Related LCS:</b></sticky> | [[TopLCS2016_080b][LCS-2016-080b]] | ---++ Voting Results: Cast your votes here * Yes: 1 %USERSIG{BrentHahoe - 2016-12-18}% - Version 2 1 %USERSIG{PatrickLehmann - 2016-12-31}% - Version 2 1 %USERSIG{ThomasPreusser - 2017-01-17}% - Version 2 * No: 1 %USERSIG{ErnstChristen - 2016-12-11}% - Version 2 %BR% [[#ErnstChristen20161211][Please see this comment below.]] [[#ErnstChristen20170123][and this one]] 1 %USERSIG{LievenLemiengre - 2017-01-27}% - ver 2: I agree with Ernst * Abstain: 1 %USERSIG{MartinThompson - 2017-02-17}% - Version 2 1 %USERSIG{KevinJennings - 2016-12-20}% - Version 2 ---++ Details of Language Change: Key: * LRM text is shown between single quotes <sticky>%BLACK%'... P1076 LRM quoted text ...'%ENDCOLOR%</sticky> * Existing LRM text is shown in <sticky>%BLACK%<b>BLACK</b> coloured font%ENDCOLOR%</sticky> * Additional LRM text is shown in <sticky>%RED%<b>RED</b> coloured font%ENDCOLOR%</sticky> * Deleted LRM text is shown in <sticky>%RED%<strike><b>RED</b> with strike-through</strike>%ENDCOLOR%</sticky> * In order to try and emphasize text in italic font: * Italic font in existing LRM text is shown in <sticky>%GRAY%<i><b>GRAY</b> italic font</i>%BLACK%</sticky> * Italic font in new LRM text is shown in <sticky>%ORANGE%<i><b>ORANGE</b> italic font</i>%ENDCOLOR%</sticky> * Italic font in deleted LRM text is shown in <sticky>%ORANGE%<strike><i><b>ORANGE</b> with strike-through</i></strike>%ENDCOLOR%</sticky> * Editing instructions are shown in <sticky>%GREEN%<b>GREEN</b> coloured font%ENDCOLOR%</sticky> ---+++ LRM 4.7 Package declarations ---++++!! page 30 middle %GREEN%Replace the BNF productions with:%BLACK% <sticky><pre>%BLACK% package_declaration ::= <b>package</b> identifier <b>is</b> package_header package_declarative_part <b>end</b> [ <b>package</b> ] [ %GRAY%<i>package_</i>%BLACK%simple_name ] ; package_header ::= [ generic_clause [ generic_map_aspect ; ] ] package_declarative_part ::= { %RED%general_%BLACK%package_declarative_%RED%<strike>item</strike>part%BLACK% }%RED% | { concurrent_package_declarative_part } | { sequential_package_declarative_part }%RED% general_package_declarative_part ::= general_package_declarative_item concurrent_package_declarative_part ::= general_package_declarative_item | concurrent_package_declarative_item sequential_package_declarative_part ::= general_package_declarative_item | sequential_package_declarative_item general_%BLACK%package_declarative_item ::= subprogram_declaration | subprogram_instantiation_declaration | package_declaration | package_instantiation_declaration | %RED%<i>nonprotected_</i>%BLACK%type_declaration | subtype_declaration%RED% | protected_type_declaration%BLACK% | %RED%normal_%BLACK%constant_declaration%RED% | deferred_constant_declaration<strike> | signal_declaration | variable_declaration</strike>%BLACK% | file_declaration | alias_declaration | component_declaration | attribute_declaration | attribute_specification%RED%<strike> | disconnection_specification</strike>%BLACK% | use_clause | group_template_declaration | group_declaration%RED%<strike> | %ORANGE%<i>PSL_</i>%RED%Property_Declaration | %ORANGE%<i>PSL_</i>%RED%Sequence_Declaration</strike> concurrent_package_declarative_item ::= normal_signal_declaration | deferred_signal_declaration | normal_shared_variable_declaration | deferred_shared_variable_declaration | disconnection_specification | %ORANGE%<i>PSL_</i>%RED%Property_Declaration | %ORANGE%<i>PSL_</i>%RED%Sequence_Declaration sequential_package_declarative_item ::= normal_variable_declaration | deferred_variable_declaration </pre></sticky> ---++++!! page 31 top %GREEN%After the paragraph beginning:%BLACK% 'Items declared immediately within ...' %GREEN%insert the following paragraph:%BLACK% '%RED%For a package declaration, or package body, that appears as a library design unit, in an entity statement, in an architecture statement, or in a block statement, it is an error if a variable declaration in the declarative part of the package declaration, or package body, does not declare a shared variable.' ----- %GREEN%Replace the 4th paragraph beginning:%BLACK% 'For a package declaration that appears in a subprogram ...' %GREEN%with the following paragraph:%BLACK% 'For a package declaration%RED%, or package body,%BLACK% that appears in a subprogram body, a process statement, or a protected type body, it is an error if a variable declaration in the package declarative part of the package declaration%RED%, or package body,%BLACK% declares a shared variable. Moreover, it is an error if a signal declaration, a disconnection specification, or a PSL declaration appears as a package declarative item of such a package declaration.' ----- %GREEN%Replace the 5th paragraph beginning:%BLACK% 'NOTE--Not all packages ...' %GREEN%with the following paragraph:%BLACK% 'NOTE--Not all packages will have a package body. In particular, a package body is unnecessary if no subprograms, deferred constants, %RED%deferred shared variables, deferred signals, deferred variables, %BLACK%or protected type definitions are declared in the package declaration.' ---++++!! page 31 middle %GREEN%Replace the second *package* declaration code with:%BLACK% <sticky><pre>%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 <> of</b> Tri; <b>function</b> Resolve (Sources: TriVector) <b>return</b> Tri;%RED% <b>constant</b> TriA_c : Tri; <b>deferred constant</b> TriB_c : Tri; <b>type</b> Tri_pt <b>is</b> <b>protected</b> <b>impure function</b> Get <b>return</b> Tri; <b>procedure</b> Put (Value : Tri); <b>end protected</b> Tri_pt; <b>deferred shared variable</b> Tri_sv : Tri_pt; <b>deferred signal</b> Tri_s : Tri;%BLACK% <b>end package</b> TriState;%RED% -- or: <b>package</b> TriState2 <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 <> of</b> Tri; <b>function</b> Resolve (Sources: TriVector) <b>return</b> Tri; <b>constant</b> TriA_c : Tri; <b>deferred constant</b> TriB_c : Tri; <b>type</b> Tri_pt <b>is</b> <b>protected</b> <b>impure function</b> Get <b>return</b> Tri; <b>procedure</b> Put (Value : Tri); <b>end protected</b> Tri_pt; <b>deferred variable</b> Tri1_v : Tri; <b>deferred variable</b> Tri2_v : Tri_pt; <b>end package</b> TriState2; </pre></sticky> ---+++ LRM 4.8 Package bodies ---++++!! page 31 bottom %GREEN%Replace the 1st paragraph beginning:%BLACK% 'A package body defines ...' %GREEN%with the following paragraph:%BLACK% 'A package body defines the bodies of subprograms%RED%<strike> and</strike>%RED%, the values of deferred constants, the declaration of deferred shared variables (or normal variables of a protected type), the initial values of deferred signals and the initial values of deferred variables (except those of a protected type) that have been%BLACK% declared in the interface to the package.' ---++++!! page 31 bottom & 32 top %GREEN%Replace the BNF productions with:%BLACK% <sticky><pre>%BLACK% package_body ::= <b>package body</b> %GRAY%<i>package_</i>%BLACK%simple_name <b>is</b> package_body_declarative_part <b>end</b> [ <b>package body</b> ] [ %GRAY%<i>package_</i>%BLACK%simple_name ] ; package_body_declarative_part ::= { %RED%general_%BLACK%package_body_declarative_%RED%<strike>item</strike>part%BLACK% }%RED% | { concurrent_package_body_declarative_part } | { sequential_package_body_declarative_part } general_package_body_declarative_part ::= general_package_body_declarative_item concurrent_package_body_declarative_part ::= general_package_body_declarative_item | concurrent_package_body_declarative_item sequential_package_body_declarative_part ::= general_package_body_declarative_item | sequential_package_body_declarative_item general_%BLACK%package_body_declarative_item ::= subprogram_declaration | subprogram_body | subprogram_instantiation_declaration | package_declaration | package_body | package_instantiation_declaration | %RED%<i>nonprotected_</i>%BLACK%type_declaration | subtype_declaration%RED% | protected_type_declaration | protected_type_body%BLACK% | %RED%normal_%BLACK%constant_declaration%RED%<strike> | variable_declaration</strike>%BLACK% | file_declaration | alias_declaration | component_declaration | attribute_declaration | attribute_specification | use_clause | group_template_declaration | group_declaration%RED% concurrent_package_body_declarative_item ::= normal_signal_declaration | normal_shared_variable_declaration sequential_package_body_declarative_item ::= normal_variable_declaration </pre></sticky> ---++++!! page 32 middle %GREEN%Replace the 5th paragraph beginning:%BLACK% 'If a given package declaration ...' %GREEN%with the following paragraph:%BLACK% 'If a given package declaration contains a deferred constant declaration (see 6.4.2.2), %RED%a deferred shared variable declaration (see 6.4.2.4), a deferred signal declaration (see 6.4.2.3) or a deferred variable declaration (see 6.4.2.4), %BLACK% then a constant declaration%RED%, a shared variable declaration, a signal declaration or a variable declaration%BLACK% with the same %RED%respective %BLACK%identifier shall appear as a declarative item in the corresponding package body. This object declaration is called the _full_ declaration of the deferred constant%RED%, deferred shared variable, deferred signal or deferred variable%BLACK%. The subtype indication given in the full declaration shall lexically conform to that given in the deferred constant declaration%RED%, deferred shared variable declaration, deferred signal declaration or deferred variable declaration. If a signal declaration is present in a package body, then it is an error if the corresponding deferred signal declaration is not present in its package declaration%BLACK%.' ---++++!! page 32 bottom %GREEN%Replace the 6th paragraph beginning:%BLACK% 'Within a package declaration ...' %GREEN%with the following paragraph:%BLACK% 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%RED%, a deferred shared variable, a deferred signal or a deferred variable%BLACK% before the elaboration of %RED%<strike>the</strike>its%BLACK% corresponding full declaration is not defined by the language. ---+++ LRM 4.10 Conformance rules ---++++!! page 34 top %GREEN%Replace the 3rd paragraph beginning:%BLACK% 'Lexical conformance is likewise ...' %GREEN%with the following paragraph:%BLACK% 'Lexical conformance is likewise defined for subtype indications in deferred constant declarations%RED%, deferred shared variable declarations, deferred signal declarations, or deferred variable declarations%BLACK%.' ---+++ LRM 6.4.2.2 Constant declarations ---++++!! page 67 bottom %GREEN%Replace the BNF production with:%BLACK% <sticky><pre>%BLACK% constant_declaration ::=%RED% normal_constant_declaration | deferred_constant_declaration normal_constant_declaration ::=%BLACK% <b>constant</b> identifier_list : %ORANGE%<i>constant_</i>%BLACK%subtype_indication%RED%<strike> [</strike>%BLACK% := expression%RED%<strike> ]</strike>%BLACK% ;%RED% deferred_constant_declaration ::= [ <b>deferred</b> ] <b>constant</b> identifier_list : %ORANGE%<i>constant_</i>%RED%subtype_indication ; </pre></sticky> ---++++!! page 67 bottom %GREEN%Replace the paragraph beginning:%BLACK% 'If the assignment symbol ":=" followed by an expression is not present in a constant declaration, then ...' %GREEN%with the following paragraph:%BLACK% 'If the assignment symbol ":=" followed by an expression is not present in a constant declaration, %RED%or the reserved word *constant* is preceded by the reserved word *deferred*, %BLACK%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 %GREEN%Add to the end of the %BLACK%'Examples'%GREEN% list:%BLACK% <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.%RED% <b>deferred constant</b> Propagation_Delay: DELAY_LENGTH; -- A deferred constant. </pre></sticky> ---+++ LRM 6.4.2.3 Signal declarations ---++++!! page 68 top %GREEN%Replace the BNF productions with:%BLACK% <sticky><pre>%BLACK% signal_declaration ::=%RED% normal_signal_declaration | deferred_signal_declaration normal_signal_declaration ::=%BLACK% <b>signal</b> identifier_list : %ORANGE%<i>signal_</i>%BLACK%subtype_indication [ signal_kind ] [ := expression ] ;%RED% deferred_signal_declaration ::= <b>deferred signal</b> identifier_list : %ORANGE%<i>signal_</i>%RED%subtype_indication [ signal_kind ] ;%BLACK% signal_kind ::= <b>register</b> | <b>bus</b> </pre></sticky> ---++++!! page 68 bottom %GREEN%After the paragraph beginning:%BLACK% 'In the absence of an explicit default expression ...' %GREEN%insert the following paragraph:%BLACK% '%RED%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).%BLACK%' ---++++!! page 69 middle %GREEN%Add to the end of the %BLACK%'Examples'%GREEN% list:%BLACK% <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;%RED% <b>deferred signal</b> INPUT: BIT; -- A deferred signal. </pre></sticky> ---+++ LRM 6.4.2.4 Variable declarations ---++++!! page 70 top %GREEN%Replace the BNF production with:%BLACK% <sticky><pre>%BLACK% variable_declaration ::=%RED% local_variable_declaration | shared_variable_declaration local_variable_declaration ::= normal_variable_declaration | deferred_variable_declaration normal_variable_declaration ::= <strike>[ <b>shared</b> ] </strike>%BLACK%<b>variable</b> identifier_list : %ORANGE%<i>nonprotected_</i>%BLACK%subtype_indication [ := expression ] ;%RED% | <b>variable</b> identifier_list : %ORANGE%<i>protected_</i>%RED%subtype_indication ; deferred_variable_declaration ::= <b>deferred variable</b> identifier_list : subtype_indication shared_variable_declaration ::= normal_shared_variable_declaration | deferred_shared_variable_declaration normal_shared_variable_declaration ::= <b>shared variable</b> identifier_list : %ORANGE%<i>protected_</i>%RED%subtype_indication ; deferred_shared_variable_declaration ::= <b>deferred shared variable</b> identifier_list : %ORANGE%<i>protected_</i>%RED%subtype_indication ; </pre></sticky> ---++++!! page 70 middle %GREEN%After the paragraph beginning:%BLACK% 'If an initial value expression appears in the declaration of a variable, ...' %GREEN%insert the following two paragraphs:%BLACK% '%RED%If the assignment symbol ":=" followed by an expression is not present in a variable declaration and the reserved word *variable* is preceded by the reserved word *deferred*, then the declaration declares a deferred variable. It is an error if such a variable declaration appears anywhere other than in a package declaration. The corresponding full variable declaration, which defines the initial value of the variable, shall appear in the body of the package (see 4.8).%BLACK%' '%RED%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).%BLACK%' ---++++!! page 71 bottom %GREEN%Add to the end of the %BLACK%'Examples'%GREEN% list:%BLACK% <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;%RED% <b>type</b> SharedCount <b>is protected</b> <b>function</b> get <b>return</b> COUNT; <b>procedure</b> set(value : COUNT); <b>end protected</b> SharedCount; -- Protected type for deferred variable and deferred shared variable <b>deferred variable</b> COUNT: POSITIVE; -- A deferred variable. <b>deferred variable</b> COUNT2: SharedCount; -- A deferred variable. <b>deferred shared variable</b> COUNT3: SharedCount; -- A deferred shared variable. -- Methods and variable(s) defined in the package body </pre></sticky> ---+++ LRM 6.5.2 Interface object declarations ---++++!! page 73 bottom %GREEN%Replace the BNF productions with:%BLACK% <sticky><pre>%BLACK% interface_object_declaration ::= interface_constant_declaration | interface_signal_declaration | interface_variable_declaration | interface_file_declaration interface_constant_declaration ::= [ <b>constant</b> ] identifier_list : [ <b>in</b> ] %ORANGE%<i>constant_</i>%BLACK%subtype_indication [ := %GRAY%<i>static_</i>%BLACK%expression ] interface_signal_declaration ::= [ <b>signal</b> ] identifier_list : [ mode ] %ORANGE%<i>signal_</i>%BLACK%subtype_indication [ <b>bus</b> ] [ := %GRAY%<i>static_</i>%BLACK%expression ] interface_variable_declaration ::= [ <b>variable</b> ] identifier_list : [ mode ] %ORANGE%<i>nonprotected_</i>%BLACK%subtype_indication [ := %GRAY%<i>static_</i>%BLACK%expression ]%RED% | [ <b>variable</b> ] identifier_list : <b>inout</b> %ORANGE%<i>protected_</i>%RED%subtype_indication%BLACK% interface_file_declaration ::= <b>file</b> identifier_list : %RED%<i>file_</i>%BLACK%subtype_indication mode ::= <b>in</b> | <b>out</b> | <b>inout</b> | <b>buffer</b> | <b>linkage</b> </pre></sticky> ---+++ LRM 14.4.2.5 Object declarations ---++++!! page 208 bottom %GREEN%Replace the paragraph beginning:%BLACK% 'The elaboration of an object of a protected type consists ...' %GREEN%with the following paragraph:%BLACK% 'The elaboration of an object of a protected type consists of the elaboration of the subtype indication, followed by creation of the object. Creation of the object consists of elaborating, in the order given, each of the declarative items in the protected type body.%RED% The elaboration of a deferred object of a protected type within a package declaration, defers the creation of the object until the elaboration of its full declaration within the package body. It is an error if this full declaration precedes the associated protected type body declaration.' ---+++ LRM 15.10 Reserved words ---++++!! page 236 %GREEN%Insert the new reserved word %RED%<b>deferred</b>%GREEN% after the reserved word %BLACK%<b>default</b>%GREEN% in the list. ---+++ LRM Annex C Syntax summary ---++++!! page 483 %GREEN%Replace the %BLACK%'constant_declaration'%GREEN% BNF production with the following:%BLACK% <sticky><pre>%BLACK% constant_declaration ::= [§ 6.4.2.2]%RED%<strike> <b>constant</b> identifier_list : subtype_indication [ := expression ] ;</strike> normal_constant_declaration | deferred_constant_declaration </pre></sticky> ----- %GREEN%Insert before the %BLACK%'delay_mechanism'%GREEN% BNF production the following:%BLACK% <sticky><pre>%RED% deferred_constant_declaration ::= [§ 6.4.2.2] [ <b>deferred</b> ] <b>constant</b> identifier_list : %ORANGE%<i>constant_</i>%RED%subtype_indication ; deferred_shared_variable_declaration ::= [§ 6.4.2.4] <b>deferred shared variable</b> identifier_list : %ORANGE%<i>protected_</i>%RED%subtype_indication ; deferred_signal_declaration ::= [§ 6.4.2.3] <b>deferred signal</b> identifier_list : %ORANGE%<i>signal_</i>%RED%subtype_indication [ signal_kind ] ; deferred_variable_declaration ::= [§ 6.4.2.4] <b>deferred variable</b> identifier_list : subtype_indication ; </pre></sticky> ---++++!! page 489 %GREEN%Replace the %BLACK%'interface_constant_declaration'%GREEN% BNF production with the following:%BLACK% <sticky><pre>%BLACK% interface_constant_declaration ::= [§ 6.5.2] [ <b>constant</b> ] identifier_list : [ <b>in</b> ] %ORANGE%<i>constant_</i>%BLACK%subtype_indication [ := %GRAY%<i>static_</i>%BLACK%expression ] </pre></sticky> ----- %GREEN%Replace the %BLACK%'interface_signal_declaration'%GREEN% BNF production with the following:%BLACK% <sticky><pre>%BLACK% interface_signal_declaration ::= [§ 6.5.2] [ <b>signal</b> ] identifier_list : [ mode ] %ORANGE%<i>signal_</i>%BLACK%subtype_indication [ <b>bus</b> ] [ := %GRAY%<i>static_</i>%BLACK%expression ] </pre></sticky> ---++++!! page 490 %GREEN%Replace the %BLACK%'interface_variable_declaration'%GREEN% BNF production with the following:%BLACK% <sticky><pre>%BLACK% interface_variable_declaration ::= [§ 6.5.2] [ <b>variable</b> ] identifier_list : [ mode ] %ORANGE%<i>nonprotected_</i>%BLACK%subtype_indication [ := %GRAY%<i>static_</i>%BLACK%expression ]%RED% | [ <b>variable</b> ] identifier_list : <b>inout</b> %ORANGE%<i>protected_</i>%RED%subtype_indication%BLACK% </pre></sticky> ---++++!! page 490 %GREEN%Insert before the %BLACK%'logical_expression'%GREEN% BNF production the following:%BLACK% <sticky><pre>%RED% local_variable_declaration ::= [§ 6.4.2.4] normal_variable_declaration | deferred_variable_declaration </pre></sticky> ---++++!! page 491 %GREEN%Insert before the %BLACK%'null_statement'%GREEN% BNF production the following:%BLACK% <sticky><pre>%RED% normal_constant_declaration ::= [§ 6.4.2.2] <b>constant</b> identifier_list : %ORANGE%<i>constant_</i>%RED%subtype_indication := expression ; normal_shared_variable_declaration ::= [§ 6.4.2.4] <b>shared variable</b> identifier_list : %ORANGE%<i>protected_</i>%RED%subtype_indication ; normal_signal_declaration ::= [§ 6.4.2.3] <b>signal</b> identifier_list : %ORANGE%<i>signal_</i>%RED%subtype_indication [ signal_kind ] [ := expression ] ; normal_variable_declaration ::= [§ 6.4.2.4] <b>variable</b> identifier_list : %ORANGE%<i>nonprotected_</i>%RED%subtype_indication [ := expression ] ; | <b>variable</b> identifier_list : %ORANGE%<i>protected_</i>%RED%subtype_indication ; </pre></sticky> ---++++!! page 497 %GREEN%Insert before the %BLACK%'shift_expression'%GREEN% BNF production the following:%BLACK% <sticky><pre>%RED% shared_variable_declaration ::= [§ 6.4.2.4] normal_shared_variable_declaration | deferred_shared_variable_declaration </pre></sticky> ----- %GREEN%Replace the %BLACK%'signal_declaration'%GREEN% BNF production with the following:%BLACK% <sticky><pre>%BLACK% signal_declaration ::= [§ 6.4.2.3]%RED%<strike> <b>signal</b> identifier_list : subtype_indication [ signal_kind ] [ := expression ] ;</strike> normal_signal_declaration | deferred_signal_declaration </pre></sticky> ---++++!! page 500 %GREEN%Replace the %BLACK%'variable_declaration'%GREEN% BNF production with the following:%BLACK% <sticky><pre>%BLACK% variable_declaration ::= [§ 6.4.2.4]%RED%<strike> [ <b>shared</b> ] <b>variable</b> identifier_list : subtype_indication [ := expression ] ;</strike>%RED% local_variable_declaration | shared_variable_declaration </pre></sticky> ---+++ LRM Annex I Glossary ---++++!! page 563 %GREEN%Insert before the %BLACK%'<b>deferred constant</b>'%GREEN% item the following:%BLACK% '%RED%<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.' ----- %GREEN%Replace the %BLACK%'<b>deferred constant</b>'%GREEN% item with the following:%BLACK% '<b>deferred constant:</b> A constant that is declared without an assignment symbol (:=) and %RED%its corresponding expression, or with the reserved word *deferred* %BLACK% 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)' ----- %GREEN%Insert the three new %BLACK%'<b>deferred shared variable</b>', %BLACK%'<b>deferred signal</b>'%GREEN% and %BLACK%'<b>deferred variable</b>'%GREEN% items after the %BLACK%'<b>deferred constant</b>'%GREEN% item: '%RED%<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)' '%RED%<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)' '%RED%<b>deferred variable:</b> A local variable that is declared with the reserved word *deferred* in a package declaration. A corresponding full declaration of the local variable shall exist in the package body. (6.4.2.4)' ---++++!! page 567 %GREEN%Replace the %BLACK%'<b>full declaration</b>'%GREEN% item with the following:%BLACK% '<b>full declaration:</b> A constant declaration%RED%, shared variable declaration, signal declaration, or variable declaration %BLACK%occurring in a package body with the same identifier as that of a deferred constant declaration%RED%, deferred shared variable declaration, deferred signal declaration, or deferred variable declaration %BLACK%in the corresponding package declaration. A full type declaration is a type declaration corresponding to an incomplete type declaration. (4.8)' ---++++!! page 571 %GREEN%Replace the %BLACK%'<b>lexically conform</b>'%GREEN% item with the following:%BLACK% '<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%RED%, deferred shared variable declarations, deferred signal declarations and deferred variable declarations %BLACK%. (4.10)' ---++++!! page 578 %GREEN%Replace the %BLACK%'<b>shared variable</b>'%GREEN% item with the following:%BLACK% '<b>shared variable:</b> A variable accessible by more than one process. Such variables shall be of a protected type. %RED%Shared variables declared in packages can also be _deferred shared variables_. %BLACK%(6.4.2.4)' ---++++!! page 579 %GREEN%Replace the %BLACK%'<b>signal</b>'%GREEN% item with the following:%BLACK% '<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. %RED%Signals declared in packages can also be _deferred signals_. %BLACK%(6.4.2.3)' ---++++!! page 583 %GREEN%Replace the %BLACK%'<b>variable</b>'%GREEN% item with the following:%BLACK% '<b>variable:</b> An object with a single current value. %RED%Variables declared in packages can also be _deferred variables_. %BLACK%(6.4.2.4)' ---+ Comments%BLACK% The production alternatives with a normal and a deferred path do not resolve unambiguously. Take the proposed update for LRM 6.4.2.2 as an example: <sticky><pre> constant_declaration ::= normal_constant_declaration | deferred_constant_declaration normal_constant_declaration ::= constant identifier_list : constant_ subtype_indication [ := expression ] ; deferred_constant_declaration ::= [ deferred ] constant identifier_list : constant_subtype_indication ; </pre></sticky> A declaration without the keyword _deferred_ and without an initializing expression satisfies both productions. Making the expression within the normal path non-optional would fix this case easily and classify the declaration correctly. -- %BUBBLESIG{ThomasPreusser - 2016-11-21}% Thanks for the comment Thomas. You have identified an error in the 'constant declaration' BNF productions which has now been corrected. The square brackets around the initialization portion of the 'normal constant declaration' production (denoting it as optional) have now been removed. I believe that the respective productions for those of signal, variable and shared variable are correct. Do you concur? -- %BUBBLESIG{BrentHahoe - 2016-11-25}% Indeed, the rest appears good. -- %BUBBLESIG{ThomasPreusser - 2016-11-27}% Should the 'Draft' status on this LCS (as well as 80b) be removed? -- %BUBBLESIG{KevinJennings - 2016-12-02}% Yes, I was still working through some issues. I have now changed the status to 'Ballot'(?) as I thought leaving it blank wasn't sensible. (Applies to 80b as well). -- %BUBBLESIG{BrentHahoe - 2016-12-08}% #ErnstChristen20161211 This is a preliminary No because this proposal has several issues that should be addressed to make it consistent. There are at least the following issues, in no particular order: a. The BNF is in general extremely wordy, attempting to distinguish different cases by syntactic alternatives, frequently using an italicized part in the production to make the distinction. As a result, the productions may become ambiguous because the italicized part carries no syntactic meaning This is a departure from the current style of the LRM, where productions have been kept free of such ambiguities, and it reminiscent of the definitional style of !SystemVerilog. a. Breaking the production for constant declaration into separate productions for normal and deferred objects is not reflected in the semantic text, which (for constants) still uses the presence/absence of the ":=" and the initial value expression to distinguish a deferred constant declaration from a regular one. My proposal to address this would be to change the current production for constant declaration to<br />constant_declaration ::= [ *deferred* ] *constant* identifier_list : subtype indication [ := expression ] ;<br />and adding a semantic rule immediately preceding the paragraph starting with "Formal parameters …" stating "It is an error if the reserved word *deferred* is present in a constant declaration that does not declare a deferred constant." No other change in the LRM would then be required.<br />An alternative could be to semantically define a subclass of constants, e.g. "A constant is said to be a _deferred constant_ if its declaration does not include the assignment symbol ":=" and the initial value expression. It is an error if the reserved word *deferred* is present in a constant declaration that does not declare a deferred constant." immediately after the production. The two following paragraphs then can and should make use of this newly introduced subclass.<br />The same can be done with signals and likely with variables. a. In its current form, the semantic text for deferred signals requires both the absence of ":=" and the presence of *deferred*, but the syntax rules don't allow one without the other. This means the semantics are overspecified. My proposal would be to formulate this in a similar way as outlined for constant declarations, with the difference that *deferred* is now required for deferred signals. a. For variables, the two alternatives for deferred_variable_declaration are indistinguishable syntactically for a variable declaration without initial value expression. One way to avoid such issues is again to define a single production with a semantic disambiguation, e.g.<br />variable_declaration ::= [ *deferred* ] [ *shared* ] *variable* identifier_list : subtype_indication [ := expression ] ;<br />The following should then be added at the end of the paragraph defining the concept of shared variables. "A variable declared immediately within a package may optionally include the reserved word *deferred*; such a declaration declares a deferred variable or a deferred shared variable."<br />The following should be added at the end of the paragraph starting with "If the variable declaration …": "Similarly, a variable declaration in a package that declares a deferred variable shall not have an initial value expression." a. The proposed change in the productions in 6.5.2 is unnecessary, and it creates a syntactic ambiguity. Expressing that variables of a protected type must have mode *inout* is better expressed by a semantic rule stating that "It is an error if an interface variable declaration whose subtype indication denotes a protected type has a mode other than *inout*." at the end of the first paragraph following the productions. The restriction that in this case no initial value expression is allowed is already stated in the LRM. a. I believe something needs to be stated in 14.4.2.5 about the elaboration of deferred objects. While for deferred constants it's possible to create the object at step c) because all the information necessary to do this is available, this is not the case for deferred shared variables because the guts of the protected type are unknown until after the package body has been elaborated. It's possible and even likely that deferred variables and (non-shared) signals may not need special rules, but I did not analyze that. --> Ernst's comment -- %BUBBLESIG{ErnstChristen - 2016-12-11}% %RED%<u>Version 2</u>%BLACK% BNF productions of entity structures declarative items have been removed to [[LCS2016_080a][LCS-2016-080a]]. They are as follows: * entity_declarative_part * architecture_declarative_part * block_declarative_part * subprogram_declarative_part * protected_type_body_declarative_part * process_declarative_part * primary_unit * secondary_unit BNF productions of package structures declarative items have added to clarify their dependency on the package declarative region. They are as follows: * general_package_declarative_part * concurrent_package_declarative_part * sequential_package_declarative_part * general_package_body_declarative_part * concurrent_package_body_declarative_part * sequential_package_body_declarative_part Italic prefixes have been added to the BNF entity structures declarative items mentioned above to reflect this declarative region usage. Declarative items have been divided into a general group (declared in any package declaration), a concurrent group (declared in a package declared in a concurrent code region) and a sequential group (declared in a package declared in a sequential code region). <b><u>Answers to Ernst Christen's comments above:</u></b> There is an analysis section in the proposal [[DeferredSharedVariables#Analysis][Deferred Shared Variables]] which attempts to detail and justify these LCS modifications. a. i. Yes, the BNF descriptions have become long winded and this is an outcome of extensions to the original proposal/LCS. i. The syntactic alternatives have been created to more precisely define the BNF productions, specifically to avoid ambiguities. If there are any then please highlight them. i. You are correct in stating that the italicized parts have no syntactic meaning, however as per section 1.3.2 bullet g of the LRM, they are intended to impart semantic information. Here, they are mainly concerned with limitations on the BNF 'subtype indication' non-terminal and the (hopefully meaningful) italic prefixes indicate that the LRM text defines the exact details of these limitations in their various sections. i. This is not a departure from the current LRM style as these techniques are used extensively in the LRM. This LCS (pair to be precise) has been used to bring consistency by extending the use of italicized text where required. a. i. Your proposal for the BNF production of object class *constant* is ambiguous. It includes a conditional optional part. If you include the optional reserved word *deferred*, then the expression part must be omitted, i.e. it is no longer optional. Hence the expansion of the BNF productions to clarify this circumstance. i. The *deferred* reserved word is intended to be a modifier and not to define a sub-class. The deferred declaration does not declare a new class of object, it merely delays the elaboration of that object until the *package* *body* is elaborated. a. i. The BNF productions for a *deferred* *signal* require the presence of the *deferred* reserved word and the absence of the initialization expression. However, a normal *signal* declaration does not require an initialization expression, hence it is optional in the normal *signal* production. a. i. Your proposal for the BNF production of object class *variable* and object sub-class *shared* *variable* is also ambiguous. It includes a conditional optional part. If you include the optional reserved word *deferred*, then the expression part must be omitted, i.e. it is no longer optional. Hence the expansion of the BNF productions to clarify this circumstance. Similarly, if you include the optional reserved word *shared* (with or without *deferred*), then the expression part must be omitted, i.e. because an object with a 'protected subtype indication' cannot be initialized and it is no longer optional, hence the expansion of the BNF productions to clarify this circumstance. a. i. The italics added to the BNF productions in section 6.5.2 are to clarify the semantic use of the 'subtype indication' non-terminal. The requirements detailing this are already documented in the LRM text. i. The additional production detailing that object class *variable* may be associated with a 'protected subtype indication' and must be of mode *inout* adds clarity for a condition often overlooked, but already specified within the LRM text. i. I see no "syntactic ambiguity" in these BNF productions. a. i. I'm not sure what you mean by "(non-shared) signals". A *signal* 'declaration item' may appear in a *package* declaration. It then becomes a global object made visible by an appropriate use clause, rather than through interface associations. A *signal* 'declaration item' may not appear in the *package* *body* unless a *deferred* version is present in the *package* declaration. I have added some extra LRM text additions to clarify this error condition. -- %BUBBLESIG{BrentHahoe - 2016-12-17}% #ErnstChristen20170123 My original comment may not have been clear enough to describe my concerns. It is indeed true that the LRM uses italicized prefixes to the names of productions where it helps to clarify the intent, for example constrained_array_definition ::= *array* index_constraint *of* _element_ _subtype_indication My concern is not so much about that (although this and the related LCS2016_080b bring it to new levels), it is about creating additional syntactic rules to disambiguate cases when the style of the LRM since its beginning has been to provide concise syntax and define different cases by means of semantic rules. This LCS proposes a complete departure from the current LRM style, but only for additions. As a result, we'll get a document that is neither fish nor fowl. I have given an example of how the constant declaration could be modified to accommodate the proposed reserved word *deferred*, and I have outlined that for variable declarations and signal declarations a similar approach could be used. This approach is unambiguous if syntactic and semantic rules are both considered, as its done everywhere in the LRM, for example an alias declaration, where one production covers both object aliases and non-object aliases. -- %BUBBLESIG{ErnstChristen - 2017-01-24}% %COMMENT%
Edit
|
Attach
|
P
rint version
|
H
istory
:
r36
|
r33
<
r32
<
r31
<
r30
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r1 - 2017-02-17 - 11:33:59 -
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