-------------BEGINNING OF IR---------------- VHDL Issue Number: 2082 Language_Version VHDL-2002 Classification Language Definition Problem Summary Elaboration of unconstrained interface objects Relevant_LRM_Sections 4.3.2.2 Association lists 12.2 Elaboration of a block header 12.5 Dynamic elaboration Related_Issues Accellera VHDL-TC VTC-7, LCS-2006-118, IR 2085 Key_Words_and_Phrases elaboration, formal interface objects, association elements Authors_Name Peter Ashenden Authors_Phone_Number +61 414 709 106 Authors_Fax_Number Authors_Email_Address peter@ashenden.com.au Authors_Affiliation Ashenden Designs Authors_Address1 Authors_Address2 Authors_Address3 Current Status: VASG-Approved Superseded By: ------------------------ Date Submitted: 27 January 2006 Date Analyzed: 19 April 2006 Author of Analysis: Chuck Swart Revision Number: 2 Date Last Revised: 24 August 2006 Description of Problem ---------------------- The order of elaboration of interface objects and the corresponding associations is problematic when the type of an interface object is unconstrained. For such interface objects, the index ranges are taken from the association elements. 12.2 and 12.5 specify that elaboration proceeds by first elaborating the formal objects (generics, ports or parameters), followed by elaboration of the association lists. Elaborating the formal objects involves elaborating the subtype indications and creating the objects. However, for objects of unconstrained types, the objects cannot be created until the index ranges are known, and that isn't until the corresponding association elements are elaborated. Proposed Resolution ------------------- Elaboration needs to be defined in such a way that association elements are elaborated before formal objects are created. A possible sequence may be (1) elaborate the subtype indications of the formals (2) elaborate the association elements (including any implicit association elements) (3) determine index ranges for formals from association elements, if required (4) create formals VASG-ISAC Analysis & Rationale ------------------------------ The submitter is correct. There are defects in the elaboration rules for unconstrained interface objects. LCS-2006-118 deals with this issue for generics. The proposed Recommendation for Future Revisions contains wording to correct the problem for ports and for subprogram parameters. Some comments on the proposed changes: In the existing LRM it is not clear whether or not clause 12.3.1.4, Object declarations, applies to interface objects which are not generics or ports. We have clarified this by explicitly stating that they are not covered by this clause and by adding appropriate wording to clause 12.5. It is also unclear in the current LRM whether or not parameters of mode OUT are initialized. Clause 12.5 has been modified to specify this initialization. VASG-ISAC Recommendation for IEEE Std 1076-2002 ----------------------------------------------- Interpret the LRM as if the Recommendation for Future Revisions were in effect. VASG-ISAC Recommendation for Future Revisions --------------------------------------------- LCS-2006-118 changes clauses 12.2, 12.2.1, and 12.2.2 (among others). These changes correct the problem for generics. The following similar changes apply to ports and subprogram parameters: 12.2.3 Change: The elaboration of a port declaration consists of elaborating the subtype indication and then creating a port of that subtype. To: The elaboration of a port declaration establishes that the port can subsequently be referenced. Change: Elaboration of a port association list consists of the elaboration of each port association element in the association list whose actual is not the reserved word open.Elaboration of a port association element consists of the elaboration of the formal part; the port or subelement or slice thereof designated by the formal part is then associated with the signal or expression designated by the actual part. This association involves a check that the r4restrictions on port associations (see 1.1.1.2) are met. It is an error if this check fails. To: Elaboration of a port association list consists of the elaboration of the port association element or elements in the association list associated with each port declaration. Elaboration of the port association elements associated with a port declaration proceeds as follows: a) The subtype indication of the corresponding port declaration is elaborated. b) The formal part or parts of the port association elements corresponding to the port declaration are elaborated. c) If the type of the port is an array type or contains a subelement that is of an array type, the rules of 3.2.1.1 are applied to determine the index ranges. d) If the actual is not the reserved word open, the port (or each subelement or slice thereof) designated by the formal part or parts is then associated with the signals or expressions designated by the actual part. This association involves a check that the restriction on port associations (see 1.1.1.2) are met. It is an error if this check fails. 12.3.1.4 Object declarations Add as a first paragraph: The rules of this clause apply to explicitly declared object declarations. Generic declarations, port declarations and other interface declarations are elaborated as outlined in 12.2.1 through 12.2.4 and 12.5. Remove note 1 which starts "These rules apply to all object declarations other than ..." 12.5 Change: b) Execution of a subprogram call involves the elaboration of the parameter interface list of the corresponding subprogram declaration; this involves the elaboration of each interface declaration to create the corresponding formal parameters. Actual parameters are then associated with formal parameters... To: b) Execution of a subprogram call involves the elaboration of the parameter association list. This involves the elaboration of the parameter association element or elements in the association list associated with each interface declaration. Elaboration of the parameter association elements associated with an interface declaration proceeds as follows: i) The subtype indication of the corresponding interface declaration is elaborated. ii) The formal part or parts of the parameter association elements corresponding to the interface declaration are elaborated. iii) If the type of the interface object is an array type or contains a subelement that is of an array type, the rules of 3.2.1.1 are applied to determine the index ranges. iv) The interface object designated by the formal part or parts is then associated with the actual parts. v) If the interface object is a variable of mode OUT then the implicit initial value for the object is determined. -------------END OF IR----------------