VHDL Issue Number: 0192 Classification: Language Definition Problem Language Version: VHDL-87 Summary: VPI Issue 16 -- Redefining predefined attributes Related Issues: TBD Relevant LRM Sections: TBD Key Words and Phrases: TBD Current Status: ISAC-Approved 1076-1993 Disposition: Closed (All Issues Completely Addressed) Disposition Rationale: Section 5.1 has been updated as suggested. 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: 1991/12/04 Author of Analysis: Clive Charlwood Revision Number: $Revision: 1.9 $ Date Last Revised: $Date: 1995/05/13 21:53:48 $ Description of Problem ---------------------- Can a predefined attribute be redefined? Test File: ch05/02010102.vhd The predefined attribute left is redefined in the test. The LRM doesn't describe whether a predefined attribute can be redefined or not. -- ##50002112248FF5100111************************************************ -- --+ File: [SUITE.CH05]02010102.vhd -- --+ Copyright: (c) 1989 by Virginia Tech. All rights reserved. -- --+ LRM_Version: IEEE Std. 1076-1987 -- --+ Subsets: All -- --+ Description: -- --+ Test_point - (050000_020101) "A specification always relates to entities -- that already exist." -- --+ Test_objective (2) - Test that no error is reported when specifications -- relate to entities that already exist. -- --+ References: Secondary LRM Coverage: 050100_010101 -- --+ Instructions: None -- --+ Keywords: specification, entities -- --+ Test_Results: Expect_Success. Output_Checked. -- --+ Test_Type: Locally Static Semantic -- --+ History: Created KSC/VTech 4-16-90 -- --+ Comments: None -- --**************************************************************************** package P1 is type a is range 1 to 10; attribute left: integer; attribute left of a : type is 5; --- No_failure_here end P1; Proposed Resolution ------------------- TBD VASG-ISAC Analysis & Rationale ------------------------------ There are two questions that need to be answered. 1) Is it legal to attribute an entity if a predefined attribute of the same name is already defined for it? E.G. Can you specify a user defined attribute LEFT for a type? 2) Is it legal to attribute an entity with a user defined attribute with the same (simple) name as a predefined attribute even though the predefined attribute is not defined for said entity? E.G. Can you specify a user defined attribute LEFT for a constant? The LRM is clear on the first points. Section 5.1 (just above the example) states that: It is an error if a given attribute is associated more than once with a given entity. Similarly IT IS AN ERROR IF TWO DIFFERENT ATTRIBUTES WITH THE SAME SIMPLE NAME ARE BOTH ASSOCIATED WITH A GIVEN ENTITY. Since the predefined attributes are implicitly declared when the entity is declared. It is an error to attribute the entity a second time. The second point is not explicitly covered by the LRM. We can see no reason why it should not be legal. In conclusion: ... type a is range 1 to 10; constant c: integer := 0; attribute left: integer; attribute left of a : subtype is 5; -- Error attribute left of c : constant is 5; -- No Error ... VASG-ISAC Recommendation for IEEE Std 1076-1987 ----------------------------------------------- No changes are needed. VASG-ISAC Recommendation for Future Revisions --------------------------------------------- For clarity, the above paragraph should be amended to explicitly include predefined attributes.