VHDL Issue Number: 0200 Classification: Language Deficiencies and Modeling Problems Language Version: VHDL-87 Summary: 'SUCC, 'PRED, 'LEFTOF, and 'RIGHTOF are not defined on objects. Related Issues: None. Relevant LRM Sections: 14.1 Key Words and Phrases: 'SUCC, 'PRED, 'LEFTOF, 'RIGHTOF, predefined attributes Current Status: Submitted 1076-1993 Disposition: Bugs Fixed, Enhancements Outstanding (No ISAC Issues) Disposition Rationale: Non-ISAC issues outstanding. Superseded By: N/A ----------------------- Date Submitted: 1991/03/16 Author of Submission: Paul Menchini Author's Affiliation: CAD Language Systems, Inc. Author's Post Address: P.O. Box 13036 Research Triangle Park, NC 27709-3036 Author's Phone Number: (919) 361-1913 Author's Fax Number: Author's Net Address: mench@clsi.com ----------------------- Date Analyzed: TBD Author of Analysis: TBD Revision Number: $Revision: 1.9 $ Date Last Revised: $Date: 1995/08/04 01:45:13 $ Description of Problem ---------------------- The predefined attributes 'SUCC, 'PRED, 'LEFTOF, and 'RIGHTOF are not applicable to objects, only to types. This restriction prevents their use to iterate on the elements of unconstrained interface objects. Such restrictions make the following procedure illegal: procedure WhyNot( variable outbuf : out string; in1 : in string; in2 : in string ) is variable ox : INTEGER; begin ox := outbuf'LEFT; for i in in1'RANGE loop outbuf(ox) := in1(i); ox := outbuf'RIGHTOF(ox); -- illegal end loop; for i in in2'RANGE loop outbuf(ox) := in2(i); ox := outbuf'RIGHTOF(ox); -- illegal end loop; loop ox := outbuf'RIGHTOF(ox); -- illegal outbuf(ox) := "_"; exit when ox = outbuf'RIGHT; end loop; end WhyNot; Note that this example could be done by using aliases for the parameters. Note further that 'LEFT, 'RIGHT, 'HIGH, 'LOW, 'RANGE, and 'REVERSE_RANGE are defined both on types and on objects. Proposed Resolution ------------------- Allow 'SUCC, 'PRED, 'LEFTOF, 'RIGHTOF to apply to array types and objects, analogously to 'LEFT, 'RIGHT, 'HIGH, 'LOW, 'RANGE, and 'REVERSE_RANGE. The suggested entries for Section 14.1 are as follows. Thise should immediately follow A'LOW [(N)]. A'SUCC (X[,N]) Kind: Function Prefix: Any prefix A that is appropriate for an array object, or an alias thereof, that denotes a constrained array subtype. Parameter: A locally static expression of type *universal_ integer*, the value of which must be positive and must not exceed the dimensionality of A. If omitted, it defaults to 1. Result Type: Type of the Nth index range of A. Result: T'SUCC(X), where T is the type of the Nth index range of A. Restriction: An error occurs if X equals T'BASE'HIGH. A'PRED (X[,N]) Kind: Function Prefix: Any prefix A that is appropriate for an array object, or an alias thereof, that denotes a constrained array subtype. Parameter: A locally static expression of type *universal_ integer*, the value of which must be positive and must not exceed the dimensionality of A. If omitted, it defaults to 1. Result Type: Type of the Nth index range of A. Result: T'PRED(X), where T is the type of the Nth index range of A. Restriction: An error occurs if X equals T'BASE'LOW. A'LEFTOF (X[,N]) Kind: Function Prefix: Any prefix A that is appropriate for an array object, or an alias thereof, that denotes a constrained array subtype. Parameter: A locally static expression of type *universal_ integer*, the value of which must be positive and must not exceed the dimensionality of A. If omitted, it defaults to 1. Result Type: Type of the Nth index range of A. Result: T'LEFTOF(X), where T is the type of the Nth index range of A. Restriction: An error occurs if X equals T'BASE'LEFT. A'RIGHTOF (X[,N]) Kind: Function Prefix: Any prefix A that is appropriate for an array object, or an alias thereof, that denotes a constrained array subtype. Parameter: A locally static expression of type *universal_ integer*, the value of which must be positive and must not exceed the dimensionality of A. If omitted, it defaults to 1. Result Type: Type of the Nth index range of A. Result: T'RIGHTOF(X), where T is the type of the Nth index range of A. Restriction: An error occurs if X equals T'BASE'RIGHT. VASG-ISAC Analysis & Rationale ------------------------------ TBD VASG-ISAC Recommendation for IEEE Std 1076-1987 ----------------------------------------------- TBD VASG-ISAC Recommendation for Future Revisions --------------------------------------------- TBD