VHDL Issue Number: 1018 Classification: Language Definition Problem Summary: What does "reference" mean? Related Issues: 0097 Relevant LRM Sections: 4, 10.4, 11.4 Key Words and Phrases: Order of analysis, use clause, reference Current Status: Submitted 1076-1993 Disposition: N/A Disposition Rationale: N/A Superseded By: N/A ----------------------- Date Submitted: 1991/01/29 Author of Submission: Paul Menchini Author's Affiliation: CAD Language Systems, Inc. Author's Post Address: P.O. Box 13036 Research Triangle Park, NC 27709-3036 Author's Phone Number: (919) 361-1913 Author's Fax Number: Author's Net Address: mench@clsi.com ----------------------- Date Analyzed: TBD Author of Analysis: TBD Revision Number: $Revision: 1.6 $ Date Last Revised: $Date: 1995/05/15 21:26:37 $ Description of Problem ---------------------- Consider the following VHDL (extracted from test [CH11.S04]04030102.VHD in the VA Tech test suite). package p is end p; use work.p.all; package pp is end pp; use work.pp.all; package ppp is end ppp; package p is end p; use work.pp.all; -- Failure_here package ppp is end ppp; The assumption is that the reanalysis of package P (by the second to last design unit in this example) invalidates the package PP (which has the use clause "use work.p.all;" in its context clause). Therefore the use clause "use work.pp.all;" in the context clause of the final design unit is illegal. This test is intended to check the last sentence from paragraph 4 of Section 11.4 (page 11-4): If a library unit is changed (e.g., by reanalysis of the corresponding design unit), then all library units that are potentially affected by such a change become obsolete and must be reanalyzed before they can be used again. An additional, relevant statement from the LRM is item 1 of paragraph 1 of Section 11.4 (page 11-3): 1. A primary unit whose name is referenced within a given design unit must be analyzed prior to the analysis of the given design unit. Central to this issue is whether use clauses reference library units. The assumption embodied in the example VHDL is that use clauses reference the packages named in the selected names of the use clauses. However, this assumption is not clearly supported by the LRM. The term "reference" is not defined by the LRM; the closest attempt comes in paragraph 2 of the introduction to Chapter 4 (page 4-1): For each form of declaration the language rules define a certain region of text called the *scope* of the declaration. Each form of declaration associates an identifier with a declared entity. Only within its scope, there are places where it is possible to use the identifier to refer to the associated declared entity; these places are defined by the visibility rules. At such places the identifier is said to be a *name* of the entity; the name is said to *denote* the associated entity. [Emphasis from the LRM.] Moreover, the LRM appears to deliberately avoid the term "reference" in Section 10.4. For example, paragraph 2 of this section states: Each selected name in a use clause *identifies* one or more declarations that will potentially become directly visible. If the suffix of the selected name is a simple name or operator symbol, then the selected name *identifies* only the declaration(s) of that simple name or operator symbol contained within the package or library denoted by the prefix of the selected name. If the suffix is the reserved word all, then the selected name *identifies* all declarations that are contained within the package or library denoted by the prefix of the selected name. [Emphasis mine.] Since a use clause (from paragraph 1 of Section 10.4) "achives direct visibility of declarations that are visible by selection", it is my assumption that use clauses by themselves reference neither library units nor declarations within packages. Proposed Resolution ------------------- Modify the LRM to explicitly state that use clauses, in and of themselves, reference neither the library units nor the declarations named by the selected names in the use clauses. Additionally, define the term "reference" to include names appearing in expressions, targets, subtype indications, type marks, resolution function names, the entity name in an architecture declaration or configuration declaration, the package simple name in a package body, etc.; i.e., everywhere *except* from within a use clause. Perhaps the simplest way would be to use a new syntactic construct in the definition of use clauses instead of the current "selected name" constuct. One of the complications is to create a class of "implicit" references. For example, references to "Integer" implicitly reference the library unit "Standard" in library "Std" in the absence of any use clauses or declarations hiding Std.Standard.Integer. VASG-ISAC Analysis & Rationale ------------------------------ TBD VASG-ISAC Recommendation for IEEE Std 1076-1987 ----------------------------------------------- TBD VASG-ISAC Recommendation for Future Revisions --------------------------------------------- TBD