VHDL Issue Number: 0068 Classification: Language Definition Problem Language Version: VHDL-87 Summary: Bad definition for LeftOf and RightOf attributes at the end cases. Related Issues: Relevant LRM Sections: 14.1 Key Words and Phrases: LeftOf, RightOf Current Status: ISAC-Approved 1076-1993 Disposition: Closed (All Issues Completely Addressed) Disposition Rationale: LRM was updated. Superseded By: N/A ----------------------- Date Submitted: 1989/02/10 Author of Submission: Doug Dunlop Author's Affiliation: Intermetrics, Inc. Author's Post Address: 4733 Bethesda Ave #415 Bethesda, MD 20814 Author's Phone Number: (301) 657-3775 Author's Fax Number: Author's Net Address: dunlop@inmet.inmet.com ----------------------- Date Analyzed: 1990/09/27 Author of Analysis: Alex Zamfirescu Revision Number: $Revision: 1.9 $ Date Last Revised: $Date: 1995/08/03 16:27:52 $ Description of Problem ---------------------- For the subtype subtype T is Natural range 10 downto 1; It is not clear what is the value of T'LeftOf(10). The only possibility, 11, does not make sense in light of the fact that in NO subtype (Natural or T) is 11 to the left of 10. It is clear that the line that reads "an error occurs if X equals T'BASE'LEFT" should read "an error occurs if X equals T'LEFT". Proposed Resolution ------------------- Assume the above correction and the corresponding one for RightOf. VASG-ISAC Analysis & Rationale ------------------------------ Since the result value of T'LEFTOF(X) is by LRM Chapter 14 "the value which is to the left of the parameter in the range of T", the restriction "an error occurs if X equals T'BASE'LEFT" is too soft. The intent of the language designers was to restrict the return value of the function T'LEFTOF(X) from falling out of the range of T. Therefore the restriction for T'LEFTOF(X) should be; An error occurs if X equals T'LEFT, or if X is not in the range T'LOW to T'HIGH. The corresponding problem analysis applied to the attribute RIGHTOF leads to the similar restriction; An error occurs if X equals T'RIGHT, or if X is not in the range T'LOW to T'HIGH. VASG-ISAC Recommendation for IEEE Std 1076-1987 ----------------------------------------------- Change the Restrictions field for the predefined attributes T'LEFTOF(X) LRM chapter 14 from An error occurs if X equals T'BASE'LEFT. to An error occurs if X equals T'LEFT, or if X is not in the range T'LOW to T'HIGH. Change the Restrictions field for the predefined attributes T'RIGHTOF(X) LRM chapter 14 from An error occurs if X equals T'BASE'RIGHT. to An error occurs if X equals T'RIGHT, or if X is not in the range T'LOW to T'HIGH. VASG-ISAC Recommendation for Future Revisions --------------------------------------------- Another posibility would be to define these attributes so that T'LEFTOF(T'LEFT) = T'RIGHT and T'RIGHTOF(T'RIGHT) = T'LEFT and the error occuring only when X is not in the range T'LOW to T'HIGH.