VHDL Issue Number: 0043 Classification: Language Definition Problem Language Version: VHDL-87 Summary: Index constraint not defined for certain aliases. Related Issues: None. Relevant LRM Sections: 4.3.4 Key Words and Phrases: Index constraint, Alias, Subtype indication. Current Status: ISAC-Approved 1076-1993 Disposition: Closed (All Issues Completely Addressed) Disposition Rationale: VHDL-93 LRM was updated. Superseded By: N/A ----------------------- Date Submitted: 1990/11/09 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: 1991/03/21 Author of Analysis: Paul Menchini (mench@clsi.com) Revision Number: $Revision: 1.9 $ Date Last Revised: $Date: 1995/08/03 00:20:55 $ Description of Problem ---------------------- Section 4.3.4 states in paragraph 3 (on page 4-13): When the object denoted by the name is referenced via the alias defined by the alias declaration, it is viewed as if it were of the subtype specified by the subtype indication. This statement allows the subtype indication of the alias to be used when "viewing" the aliased object with the alias. Now consider the following (apparently legal) VHDL in light of this statement: constant C: Bit_Vector := "1001"; alias A: Bit_Vector is C; It is clear from Section 3.2.1.1, paragraph 5, bullet 2 (on page 3-11) that the index constraint on C is 0 to 3. It also seems reasonable that the index constraint on A should also be 0 to 3; however, Section 4.3.4 provides no support for this interpretation. Proposed Resolution ------------------- In the case where the alias subtype indication does not imply an index constraint (only one-dimensional arrays need to be considered), derive the index constraint from the name. The following additions to paragraph 3 are suggested for implementing this change. The added text is shown in UPPERCASE. The name must be a static name (see Section 6.1) that denotes an object. The base type of the name specified in an alias declaration must be the same as the base type of the type mark in the subtype indication; this type must not be a multi-dimensional array type. When the object denoted by the name is referenced via the alias defined by the alias declaration AND THE SUBTYPE INDICATION DENOTES A SCALAR SUBTYPE OR A CONSTRAINED ARRAY SUBTYPE, it is viewed as if it were of the subtype specified by the subtype indication; IF THE SUBTYPE INDICATION DENOTES AN UNCONSTRAINED ARRAY TYPE, THEN THE SUBTYPE DENOTED BY THE ALIAS IS DEFINED BY THE OBJECT NAME. The same applies to attribute references where the prefix of the attribute denotes the alias. If this subtype is a one- dimensional array subtype, then the subtype must include a matching element (see Section 7.2.2) for each element of that object denoted by the name. VASG-ISAC Analysis & Rationale ------------------------------ The author's analysis is correct, and his proposed resolution is appropriate. VASG-ISAC Recommendation for IEEE Std 1076-1987 ----------------------------------------------- Interpret the LRM in light of the author's proposed resolution. VASG-ISAC Recommendation for Future Revisions --------------------------------------------- Adopt the author's proposed LRM language.