-------------BEGINNING OF IR---------------- VHDL Issue Number: 2054 Language_Version VHDL-2002 Classification Language Definition Problem Summary Individ. assoc. rules for array formal are not valid Relevant_LRM_Sections 3.2.1.1 Index constraints and discrete ranges Related_Issues Key_Words_and_Phrases individual association, unconstrained array formal Authors_Name James Unterburger Authors_Phone_Number 503.685.0860 Authors_Fax_Number 503.685.0921 Authors_Email_Address jamesu@model.com Authors_Affiliation Model Technology Authors_Address1 8005 SW Boeckman Road Authors_Address2 Wilsonville, OR 97070 Authors_Address3 Current Status: Superseded Superseded By: LCS-2006-113 ------------------------ Date Submitted: 6 January 2005 Date Analyzed: 03 March 2005 Author of Analysis: Larry Soule Revision Number: 5 Date Last Revised: 10 January 2006 Description of Problem ---------------------- The rules for determining the index ranges of an interface object (or member of an interface object) of an unconstrained array type and whose subelements are associated individually are given in 3.2.1.1: The directions of the index ranges of the formal [interface object] are those of the base type of the formal; the high and low bounds of the index ranges are respectively determined from the maximum and minimum values of the indices given in the association elements corresponding to the formal. It is then further ("followup") stated that: If the index ranges for an interface object or member of an interface object are obtained from the corresponding association element (when associating in whole) or elements (when associating individually), then they are determined either by the actual part(s) or by the formal part(s) of the association element(s), depending upon the mode of the interface object, as follows: [For a formal of mode IN, INOUT, or LINKAGE, if the actual part includes no conversion function or type conversion; likewise for a formal of mode OUT, BUFFER, INOUT, or LINKAGE, if the formal part includes no conversion function or type conversion, then] the index ranges are obtained from the object {or value} denoted by the actual designator(s). This "followup" does not make sense for individual associations because the actual designators do not have a corresponding index range, they are instead elements of the formal's array type; the index range(s) are already known as coming "from the maximum and minimum values of the indices given in the association elements corresponding to the formal". Also, the requirement that the result type of a conversion function or type mark of a type conversion (if present on the formal and/or actual parts) be a constrained array subtype is not applicable for individual association elements because they represent elements of the formal's array type, which is not necessarily of an array type itself. Proposed Resolution ------------------- 1) Clarify that the direction of the base type of an array type is in fact the direction of the index subtype of the array type at a given index position. 2) Remove the references to individual associations in the "followup" rules. 3) Clarify what the requirements are for individual associations that have formal and/or actual parts that include conversion functions and/or type conversions. VASG-ISAC Analysis & Rationale ------------------------------ The directions of the index ranges of the formal generic or formal port are that of the type of the formal; the high and low bounds of the index ranges are respectively determined from the maximum and minimum values of the indices given in the association elements corresponding to the formal. 1) The LRM says "The directions of the index ranges of the formal generic or formal port are that of the type of the formal". However, the direction of the base type of an unconstrained array is undefined (from 3.2.1). To define this, the sentence above should be removed and the sentence following it changed to: The direction of each of the index ranges of the formal generic or formal port is that of the corresponding index subtype of the base type of the formal. The high bound and low bound of the index ranges at each index position are respectively determined from the maximum value and minimum value of the indices given in the association elements corresponding to the formal. 2) As the submitter says, in the case of individual associations, "the actual designators do not have a corresponding index range, they are instead elements of the formal's array type". Thus, the references to individual associations in the "followup" rules should be removed. The new language should be: If the index ranges for an interface object are obtained from the corresponding association element (when associating in whole), then they are determined either by the actual part or by the formal part of the association element, depending upon the mode of the interface object, as follows: 3) The rewording of #2 above will also remove the restriction that the result type of a conversion function or type mark of a type conversion be a constrained array subtype when associating individually since the new paragraph only applies when associating in whole. With this, the rules for obtaining the index ranges when associating individually should be clear (obtained from the maximum and minimum values of the indices given in the association elements corresponding to the formal). VASG-ISAC Recommendation for IEEE Std 1076-2002 ----------------------------------------------- No change. VASG-ISAC Recommendation for Future Revisions --------------------------------------------- Revise section 3.2.1.1 as described in the analysis -------------END OF IR----------------