VHDL Issue Number: 2128 Language_Version VHDL-2002 Classification Language Modeling Enhancement or Deficiency Summary Shared Variable declarations in generate? Relevant_LRM_Sections 4.3.1.3 Related_Issues Key_Words_and_Phrases Authors_Name Jim Lewis Authors_Phone_Number 503-590--4787 Authors_Fax_Number Authors_Email_Address jim@synthworks.com Authors_Affiliation Authors_Address1 Authors_Address2 Authors_Address3 Current Status: VASG-Approved Superseded By: ------------------------ Date Submitted: 13 January 2008 Date Analyzed: 15 January 2008 Author of Analysis: Peter Ashenden Revision Number: 3 Date Last Revised: 23 May 2008 Description of Problem ---------------------- Paragraph 2 of 4.3.1.3 contains the following: "Variables declared immediately within entity declarations, architecture bodies, packages, package bodies, and blocks must be shared variables." Proposed Resolution ------------------- Can shared variables be declared in a generate block declarative region? It would seem yes as it is a block declarative region which is also shared by a block statement, however, then the referenced sentence of 4.3.1.3 should also list generate statements. Going further why don't we have a term for declarative regions of constructs that contain concurrent statements (as this would seem to be a term that could be referenced numerous times). And a separate term for declarative regions of constructs that contain sequential statements (processes, subprograms, and protected types). VASG-ISAC Analysis & Rationale ------------------------------ The intention is that a variable declared immediately within a generate statement must be a shared variable. This assertion is supported by the following arguments. First, the syntax for a generate statement in 9.7 includes the nonterminal block_declarative_item for a declaration within a generate statement. The syntax for a block declarative item in 1.2.1 includes the nonterminal variable_declaration with the italicized prefix "shared". 0.2.1 g) specifies that the prefix conveys semantic information. Thus, the rule in 1.2.1 indicates that a variable declaration occurring as a block declarative item be a shared variable declaration. Second, 12.4.2 specifies that: Elaboration of a generate statement consists of the replacement of the generate statement with zero or more copies of a block statement whose declarative part consists of the declarative items contained within the generate statement and whose statement part consists of the concurrent statements contained within the generate statement. Thus, semantically, a generate statement is equivalent some number of occurrences of a block statement. Since, according to 4.3.1.3, a variable declared in a block statement must be a shared variable, a variable declared in a generate statement must also be a shared variable. The submitter's suggestion that 4.3.1.3 include generate statements in the list of places where a variable declaration must be a shared variable declaration is valid. The ISAC is not aware of any reason for the omission. The submitter suggests that terms be defined for declarative regions that contain only concurrent statements and sequential statements, respectively. The ISAC notes that the draft revision of the LRM, 1076-2007/D4.0, defines the term "concurrent region" in 6.7, External names: ... a concurrent region is defined recursively to be -- a block declarative region (including an external block and any block equivalent to a generate statement), or -- a package declarative region (including a generic-mapped package equivalent to a package instantiation) declared immediately within a concurrent region. This definition is used only within 6.7. The only additional places where it could be used are -- 4.3.1.3, as identified by the submitter -- Clause 9, last paragraph before 9.1 (although reference to package declarative regions would be superfluous in that case) A similar term, "sequential region," could be defined to refer to process and subprogram declarative regions. Places where this term could be used are -- 4.3.1.3 -- 6.7, Note 2 Given the small number of places that would benefit from use of such terminology and the increased cross-linkage that would result, pervasive use of the terms would appear unwarranted. VASG-ISAC Recommendation for IEEE Std 1076-2002 ----------------------------------------------- Interpret the list of places in 4.3.1.3 where a variable declaration must be a shared variable declaration as including generate statements. VASG-ISAC Recommendation for Future Revisions --------------------------------------------- Add generate statements to the list of places in 4.3.1.3 where a variable declaration must be a shared variable declaration.