VHDL Issue Number: 0251 Classification: Language Definition Problem Language Version: VHDL-87 Summary: Can expressions using type conversions be locally static? Related Issues: Relevant LRM Sections: 3.1.2, 7.2.5, 7.4 Key Words and Phrases: locally static, type conversion Current Status: Submitted 1076-1993 Disposition: Closed (All Issues Completely Addressed) Disposition Rationale: Section 7.4.1 bullet 9 addresses this IR. Superseded By: N/A ----------------------- Date Submitted: 1992/02/17 Author of Submission: Chuck Swart Author's Affiliation: Mentor Graphics Corporation Author's Post Address: 8005 S.W. Boeckman Road Wilsonville, OR 97070-7777 Author's Phone Number: (503) 685-7000 Author's Fax Number: Author's Net Address: chuck_swart@mentorg.com ----------------------- Date Analyzed: TBD Author of Analysis: TBD Revision Number: $Revision: 1.7 $ Date Last Revised: $Date: 1995/05/13 19:34:42 $ Description of Problem ---------------------- Can an expression which uses a type conversion be locally static? For example consider the following code fragment (which has been extracted and simplified from a real model): ENTITY e IS TYPE number_of_bits_in_word_range IS RANGE 8 TO 32; CONSTANT number_of_bits_in_word : number_of_bits_in_word_range := 16; TYPE word IS RANGE 0 TO 2**integer(number_of_bits_in_word) - 1; END e; Is this legal VHDL? The type conversion is necessary since the right argument to the exponentiation operator is required to be of type INTEGER. However, each range bound in an integer type declaration is required to be locally static, so if type conversions can not be locally static then this is illegal VHDL code. Type conversions (for locally static scalars) are perfectly reasonable analysis activities, similar in spirit to qualified expressions (although type conversions between real and integer values also involve changes in representation.) Disallowing type conversions in locally static expressions places an unnecessary burden on the user. The only work around in the example would be for the user to declare an appropriate constant of type INTEGER instead of using his own integer type. This restriction violates the intent of providing user defined integer types. At least two vendors currently allow the above example. At least two vendors currently disallow the same example. Section 7.4 of the LRM deals with locally static expressions. Type conversions are not given in the list of locally static primaries. The question this IR raises is whether or not this omission was deliberate or accidental. Proposed Resolution ------------------- Add a sentence to the list of locally static primaries in section 7.4, similar to the existing one for qualified expressions, something like: "9. a type conversion whose type mark denotes a locally static subtype and whose operand is a locally static expression;" VASG-ISAC Analysis & Rationale ------------------------------ TBD VASG-ISAC Recommendation for IEEE Std 1076-1987 ----------------------------------------------- TBD VASG-ISAC Recommendation for Future Revisions --------------------------------------------- TBD