VHDL Issue Number: Language_Version VHDL-2002 Classification Language Definition Problem Summary Can an attribute name that denotes a function be used where a name is required? Relevant_LRM_Sections 2.4, 4.2, 4.7, 5.1, 14.1 Related_Issues Key_Words_and_Phrases attribute name, function name, resolution function Authors_Name Peter Ashenden Authors_Phone_Number +61 (8) 8339 7532 Authors_Fax_Number +61 (8) 8339 2616 Authors_Email_Address peter@ashenden.com.au Authors_Affiliation Ashenden Designs Authors_Address1 PO Box 640 Authors_Address2 Stirling, SA 5152 Authors_Address3 Australia Current Status: VASG-Approved Superseded By: ------------------------ Date Submitted: 20 January 2005 Date Analyzed: 21 January 2005 Author of Analysis: Larry Soule Revision Number: 3 Date Last Revised: 09 May 2005 Description of Problem ---------------------- In a number of places a name that denotes a function is required, without the function being called. The issue is whether an attribute name that denotes a function can be used in those contexts. Specific cases are: - In an attribute specification where the entity class is function. Here, however, the name must be a simple name, so an attribute name is ruled out. - In a group declaration, where the corresponding element class in the group template declaration is function. Here, however, attribute names are explicitly prohibited. - In a subtype indication that includes a resolution function name. This is the interesting case. 2.4 requires a resolution function to be a pure function that has a single input parameter of class constant that is a one-dimensional, unconstrained array whose element type is that of the resolved signal. 4.2 requires that a function named in a subtype indication meet the requirements of 2.4 for resolution functions. 14.1 describes the attribute T'value as being a function with a single parameter of type string returning the base type of T. If we have a resolved signal of type character, it would appear that the attribute character'value could serve as the resolution function. The signal could be declared as signal s : character'value character; This is syntactically legal, since character'value is an attribute name, which is an alternative for name. So, for example, if three sources contribute the values ''', 'a' and ''' to the resolved signal, they might be assembled into the string "'a'", passed to character'value, which would return the character value 'a' as the resolved value for the signal. Proposed Resolution ------------------- I would suggest an explicit prohibition on use of an attribute name for a resolution function name. This would mirror the prohibition on use of an attribute name in a group declaration. VASG-ISAC Analysis & Rationale ------------------------------ The author's proposed resolution is accepted. VASG-ISAC Recommendation for IEEE Std 1076-2002 ----------------------------------------------- Interpret the LRM as if the recommendation for future resisions had been adopted. VASG-ISAC Recommendation for Future Revisions --------------------------------------------- Add a specific prohibition against resolution function names being attribute names. by changing the wording in section 2.4 from A resolution function must be a pure function (see 2.1); moreover, it must have a single input parameter of class constant that is a one-dimensional, unconstrained array whose element type is that of the resolved signal. The type of the return value... to A resolution function must be a pure function (see 2.1); moreover, it must have a single input parameter of class constant that is a one-dimensional, unconstrained array whose element type is that of the resolved signal. The resolution function name must not be an attribute name (see 6.6). The type of the return value... -------------END OF IR----------------