VHDL Issue Number: 2030 Language_Version: VHDL-2002 Classification: Language Definition Problem Summary: What signature does a method have Relevant_LRM_Sections: 3.5.1 a method operates on the "implied" protected type object the method is called from. 2.3.2 the signature is formed from the parameters and return type of subprogram decls Related_Issues: Key_Words_and_Phrases: protected, signature, method, subprogram, procedure, function Authors_Name: Garland Bayley Authors_Phone_Number: 503 685 4784 Authors_Fax_Number: 503 685 0921 Authors_Email_Address: garlandb@model.com Authors_Affiliation: Model Technology Authors_Address1: 8005 SW Boeckman Road Authors_Address2: Authors_Address3: Wilsonville, OR 97070 Current Status: VASG-Approved Superseded By: ------------------------ Date Submitted: 23 October 103 Date Analyzed: 15 July 2004 Author of Analysis: Peter Ashenden Revision Number: 3 Date Last Revised: 09 May 2005 Description of Problem ---------------------- Since the method operates on the protected object, does that make it part of the signature? Is the signature of method p below p[] or p[pt]? Given attribute is_method:boolean; type pt is protected procedure p; end procedure p; procedure p(v : inout pt); attribute is_method of p[]:procedure is false; attribute is_method of p[pt]:procedure is true; Which procedures p are attributed with true and which with false? What about type pt is protected body procedure p is begin end; procedure p(v: inout pt) is begin end; attribute is_method of p[pt]:procedure is true; end; What procedures get this latest attribute specification? Proposed Resolution ------------------- I would suggest signatures be changed to signature::=[[[protected]type_mark{,type_mark}][return type_mark]] where methods get the reserved worked protected before the "implied" protected type object the method is called from. VASG-ISAC Analysis & Rationale ------------------------------ A method of a protected type is a subprogram declared within the declarative region defined by the protected type declaration together with with corresponding protected type body. The signature of such a method is defined by clause 2.3.2, and includes just the type marks corresponding to each explicit parameter of the method (if any) and the return type (if the method is a function). While implementations may provide a method with access to the state of the protected object via an implicit parameter, the LRM defines such access in terms of scope and visibility rules. A method of a specific instance of a protected type is identified using an expanded name with the instance name as a prefix and the method name as the suffix. By virtue of being elaborated as part of the protected type instance, the method has visibility of the corresponding instance of the declared items within the protected type instance. The rules governing decoration of a method with an attribute are described in clause 5.1. Only a method declaration, not a method body, can be decorated. The attribute specification must occurr immediately within the same declarative part as the method declaration, that is, immediately within the protected type declaration. In the case of the reporter's examples (revised for correct syntax): attribute is_method: boolean; type pt is protected procedure p; -- 1 end protected; procedure p; -- 2 procedure p(v: inout pt); -- 3 attribute is_method of p[]:procedure is false; attribute is_method of p[pt]:procedure is true; Here, the first attribute specification decorates procedure 2, and the second attribute specification decorates procedure 3. type pt is protected body procedure p is begin end; -- 4 procedure p(v: inout pt) is begin end; -- 5 attribute is_method of p[pt]:procedure is true; end protected body; Here, the attribute specification within the protected type body decorates procedure 5. VASG-ISAC Recommendation for IEEE Std 1076-2002 ----------------------------------------------- No change to the LRM VASG-ISAC Recommendation for Future Revisions --------------------------------------------- No change to the LRM -------------END OF IR----------------