VHDL Issue Number: 0198 Classification: Language Definition Problem Language Version: VHDL-87 Summary: VPI Issue 22 -- Mutliple USEs on same declaration Related Issues: TBD Relevant LRM Sections: 10.3, 10.4 Key Words and Phrases: TBD Current Status: Closed (Andy Tsay) 1076-1993 Disposition: Closed (All Issues Completely Addressed) Disposition Rationale: LRM was misinterpreted Superseded By: N/A ----------------------- Date Submitted: 1991/03/15 Author of Submission: J. R. Armstrong Author's Affiliation: Virginia Polytechnic Institute and State University Author's Post Address: Bradley Department of Electrical Engineering Virginia Polytechnic Institute and State University Blacksburg, VA 24061 Author's Phone Number: (703) 231-4723 Author's Fax Number: Author's Net Address: JRA@VTVM1.CC.VT.EDU ----------------------- Date Analyzed: TBD Author of Analysis: TBD Revision Number: $Revision: 1.10 $ Date Last Revised: $Date: 1995/08/04 01:45:13 $ Description of Problem ---------------------- When two different packages declare the same identifier and two use clauses referring to the packages are simultaneously used for an entity declaration or an ar- chitecture body, is the identifier directly visible in the design unit or not? Test File: ch07/s03/s2/s2/03090101.vhd In the test, two packages P and P2 have three identical type declarations A_CON, B_CON, and C_CON. Since two use clauses "use work.P.all;" and "use work.P2.all;" are simultaneously used by the architecture BB, it is questionable whether the three types are visible in the architecture body. This is- sue should be clarified by the VASG committee. --##73223911445FF********************************************* -- --+ File: [SUITE.CH07.S03.S2.S2]03090101.VHD -- --+ Copyright: (c) 1986 by Intermetrics Inc. All rights reserved -- --+ LRM_Version: IEEE Std. 1076-1987 -- --+ Subsets: None -- --+ Description: -- --+ Test_point - (070322_030901) "An array aggregate with an others -- choice may appear as the operand of a qualified expression -- whose type mark denotes a constrained array subtype." -- --+ Test_objective (1) - Test that an "others" choice is not allowed -- in an aggregate that is the operand of a qualified expression -- whose type mark denotes an unconstrained array type. -- cases: -- 1) one-dimensional array with index type integer; -- 2) one-dimensional array with index type boolean; -- 3) multi-dimensional array with enumeration index type which has -- only one possible value. -- contexts: -- 1) variable assignment statement; -- 2) return statement in function. -- --+ References: None -- --+ Instructions: None -- --+ Keywords: Array aggregates, Qualified expression, Constrained array subtyp -- --+ Test_Results: Expect_Failure. Output_Checked. Approximate -- Error Message: "Others cannot be used with an unconstrained array type." -- --+ Test_Type: Locally Static Semantic -- --+ History: Created MM/MCC 7-13-89 -- Modified CHC/VT 8-29-89 -- Corrected CHC/VT 5-4-90 -- Corrected BS/VTech 11-30-90 -- --+ Comments: Original file name: E-07-2-2-2210A.VHD -- Updated to 1076-1987 VHDL, checked w/Recognizer. (Steve)Grout@m -- .com 20jun88 --*********************************************************** -- Begin test: >>> package P is type ENUM is ( ONE ); type A_ARRAY is array ( integer range <> ) of integer; type B_ARRAY is array ( boolean range <> ) of real; type C_ARRAY is array ( ENUM range <>, ENUM range <> ) of bit; SUBTYPE A_CON IS A_ARRAY ( 1 to 4 ); subtype B_CON is B_ARRAY ( FALSE to TRUE ); subtype C_CON is C_ARRAY ( ONE to ONE, ONE to ONE ); function F_A ( PAR : A_CON ) return A_CON; function F_B ( PAR : B_CON ) return B_CON; function F_C ( PAR : C_CON ) return C_CON; end P; package body P is function F_A ( PAR : A_CON ) return A_CON is begin return A_ARRAY'(1,2,3,others=>4); -- Failure_here -- SEMANTIC ERROR: "others" used in aggregate in qualified expression -- whose type mark denotes an unconstrained array type. end F_A; function F_B ( PAR : B_CON ) return B_CON is begin return B_ARRAY'(1.0,others=>2.0); -- Failure_here -- SEMANTIC ERROR: "others" used in aggregate in qualified expression -- whose type mark denotes an unconstrained array type. end F_B; function F_C ( PAR : C_CON ) return C_CON is begin return C_ARRAY'(others=>(ONE=>'0')); -- Failure_here -- SEMANTIC ERROR: "others" used in aggregate in qualified expression -- whose type mark denotes an unconstrained array type. end F_C; end P; package P2 is type ENUM is ( ONE ); type A_ARRAY is array ( integer range <> ) of integer; type B_ARRAY is array ( boolean range <> ) of real; type C_ARRAY is array ( ENUM range <>, ENUM range <> ) of bit; subtype A_CON is A_ARRAY ( 1 to 4 ); subtype B_CON is B_ARRAY ( FALSE to TRUE ); subtype C_CON is C_ARRAY ( ONE to ONE, ONE to ONE ); function F_A ( PAR : A_CON ) return A_CON; function F_B ( PAR : B_CON ) return B_CON; function F_C ( PAR : C_CON ) return C_CON; end P2; package body P2 is function F_A ( PAR : A_CON ) return A_CON is begin return (1,2,3,4); end F_A; function F_B ( PAR : B_CON ) return B_CON is begin return (1.0,2.0); end F_B; function F_C ( PAR : C_CON ) return C_CON is begin return (ONE=>(ONE=>'0')); end F_C; end P2; use work.P.all, work.P2.all; entity E is port ( PT : boolean ) ; end E; architecture BB of E is begin process variable V_A : A_CON ; variable V_B : B_CON ; variable V_C : C_CON ; begin V_A := F_A( A_ARRAY'(1,2,others=>3) ); -- Failure_here -- SEMANTIC ERROR: "others" used in aggregate in qualified expression -- whose type mark denotes an unconstrained array type. V_B := F_B( B_ARRAY'(1.0,others=>2.0) ); -- Failure_here -- SEMANTIC ERROR: "others" used in aggregate in qualified expression -- whose type mark denotes an unconstrained array type. V_C := F_C( C_ARRAY'(ONE=>('1',others=>'0')) ); -- Failure_here -- SEMANTIC ERROR: "others" used in aggregate in qualified expression -- whose type mark denotes an unconstrained array type. end process; end BB; Proposed Resolution ------------------- TBD VASG-ISAC Analysis & Rationale ------------------------------ The LRM was misinterpreted. In LRM 10.4 the rules are clearly specified: "A potentially visible declaration is actually made directly visible except in the following two cases: a) A potentially visible declaration is not made directly visible if the place considered is within the immediate scope of a homograph of the declaration. b) Potentially visible declarations that have the same designator are not made directly visible unless each of them is either an enumeration literal specification or the declaration of a subprogram (either by a subprogram declaration or by an implicit declaration)." According to b), the A_CON, B_CON, and C_CON are not made directly visible. Issue cloded. VASG-ISAC Recommendation for IEEE Std 1076-1987 --------------------------------------------- TBD VASG-ISAC Recommendation for Future Revisions --------------------------------------------- TBD