VHDL Issue Number: 1043 Classification: Language Definition Problem Language Version: VHDL-93 Summary: User defined attribute on function name Related Issues: Supersedes 0222 Relevant LRM Sections: Key Words and Phrases: Current Status: Analyzed 1076-1993 Disposition: N/A Disposition Rationale: N/A Superseded By: N/A ----------------------- Date Submitted: 1991/03/04 Author of Submission: Laurence Groves Author's Affiliation: Synopsys Inc. Author's Post Address: 1098 Alta Ave. Mountain View, CA 94043 Author's Phone Number: (415) 962-5426 Author's Fax Number: Author's Net Address: larry@Synopsys.COM ----------------------- Date Analyzed: 1994/07/25 Author of Analysis: John Willis Revision Number: $Revision: 1.2 $ Date Last Revised: $Date: 1995/05/15 19:09:55 $ Description of Problem ---------------------- Consider the following: package P is function f return BIT_VECTOR; attribute length : integer; attribute length of f : function is 5; -- is this allowed? end P; When f'length is later used in a signal or variable assignment statement, or anywhere else f'length is used, should f be interpreted as a function call, in which case it is "appropriate for an array object" and thus the 'length is the predefined attribute. Or should it be interpreted as the name of a function entity, in which case the 'length is the user defined attribute. Proposed Resolution ------------------- Interpret f as a function call and therefore f'length is the length of the bit_vector returned by f. Additionally, it is illegal for the user to attribute an object with an attribute whose name conflicts with a predefined attribute of that object. VASG-ISAC Analysis & Rationale ------------------------------ In this example, there are two valid interpretations of f'length, and thus the expression is ambiguous. Unless one (or more) of the interpretations can be eliminated by the context in which the expression appears, the analyzer must report an ambiguous construct, which is an error. VASG-ISAC Recommendation for IEEE Std 1076-1993 ----------------------------------------------- No change recommended. VASG-ISAC Recommendation for Future Revisions --------------------------------------------- No change recommended.