Sorry, in the last email I neglected to attach IR2069. Its also available on the website. Chuck Swart -------------BEGINNING OF IR---------------- VHDL Issue Number: 2069 Language_Version VHDL-2002 Classification Language Definition Problem Summary Visibility of generics in block configurations Relevant_LRM_Sections Sec 1.3.1, 10.2, 10.3 Related_Issues Key_Words_and_Phrases Authors_Name Nitin Khurana Authors_Phone_Number +91-120-2562842 extn 4142 Authors_Fax_Number Authors_Email_Address nkhurana@cadence.com Authors_Affiliation Cadence Design Systems Authors_Address1 Authors_Address2 Authors_Address3 Current Status: Analyzed Superseded By: ------------------------ Date Submitted: 19 July 2005 Date Analyzed: 09 August 2005 Author of Analysis: Chuck Swart Revision Number: 2 Date Last Revised: 12 August 2005 Description of Problem ---------------------- Please see the following VHDL descriptions. entity bug3 is generic ( Dwidth3 : integer :: 0 ); end bug3; architecture rtl_bug3 of bug3 is begin end rtl_bug3; entity bug2 is end bug2; architecture rtl_bug2 of bug2 is component virtual_bug3 generic ( Dwidth3 : integer := 0 ); end component; begin U1 : virtual_bug3; end rtl_bug2; entity bug is generic ( Dwidth : integer ); end bug; architecture rtl_bug of bug is component virtual_bug2 end component; begin U1 : virtual_bug2; end rtl_bug; configuration bug_cfg of bug is for rtl_bug for U1 : virtual_bug2 use entity work.bug2(rtl_bug2); for rtl_bug2 for U1: virtual_bug3 use entity work.bug3(rtl_bug3) generic map( DWidth3 => DWidth -- Problem ); end for; end for; end for; end for; end bug_cfg; The line in the configuration with the comment "--problem" maps a generic of component bug3 to a generic of entity bug. This mapping skips the intermediate entity bug2. Is this legal VHDL? Different tools appear to interpret this differently. According to my interpretation of section 1.3.1 of the LRM, the generics of entity bug are not visible at this point, and hence it is illegal. However, others quote section 10.2 and 10.3 to claim that it is legal. Proposed Resolution ------------------- VASG-ISAC Analysis & Rationale ------------------------------ We are examining the visibility of DWidth, which is used in a component configuration which lies within the component configuration of U1. The component configuration which reads For U1: virtual_bug2 use entity work.bug2(rtl_bug2)); configures an external block. Therefore visibility affecting blocks configured within this block is determined by rules which apply to external blocks. The most applicable paragraph is in clause 1.3.1 Block Configuration: "If the scope of a declaration (see 10.2) includes the end of the declarative part of a block corresponding to a given block configuration,then the scope of that declaration extends to each configuration item contained in that block configuration,with the exception of block configurations that configure external blocks. Similarly, if a declaration is visible (either directly or by selection) at the end of the declarative part of a block corresponding to a given block configuration,then the declaration is visible in each configuration item contained in that block configuration,with the exception of block configurations that configure external blocks." This rule states that visibility of declarations does not extend into external blocks. In addition, we have the following LRM statements: Clause 10.2 Scope of declarations: "In addition to the above rules,the scope of any declaration that includes the end of the declarative part of a given block (whether it be an external block defined by a design entity or an internal block defined by a block statement)extends into a configuration declaration that configures the given block." This rule states that declarations that are visible within the design entity which configures the external block are visible to the configuration declaration. The configuration declaration consists of a configuration declarative part and a single block configuration. Scope and visibility do not automatically extend into the block configuration, but are governed by additional rules, stated above and below. "If a component configuration appears as a configuration item immediately within a block configuration that configures a given block,and if the scope of a given declaration includes the end of the declarative part of that block,then the scope of the given declaration extends from the beginning to the end of the declarative region associated with the given component configuration.A similar rule applies to a block configuration that appears as a configuration item immediately within another block configuration,provided that the contained block configuration configures an internal block. Furthermore,the scope of a use clause is similarly extended. Finally,the scope of a library unit contained within a design library is extended along with the scope of the logical library name corresponding to that design library." This rule extends scope of items declared in configurations into internal blocks, but does not extend this scope into external blocks. Clause 10.3 Visibility "In addition to the aforementioned rules,any declaration that is visible by selection at the end of the declarative part of a given (external or internal) block is visible by selection in a configuration declaration that configures the given block." This rule extends visibility by selection from design entities into the external block which they configure. "If a component configuration appears as a configuration item immediately within a block configuration that configures a given block,and if a given declaration is visible by selection at the end of the declarative part of that block,then the given declaration is visible by selection from the beginning to the end of the declarative region associated with the given component configuration.A similar rule applies to a block configuration that appears as a configuration item immediately within another block configuration,provided that the contained block configuration configures an internal block." This rule extends visibility by selection from configurations to internal blocks, but does not extend this visibility into external blocks. "If a component configuration appears as a configuration item immediately within a block configuration that configures a given block,and if a given declaration is directly visible at the end of the declarative part of that block,then the given declaration is visible by selection from the beginning to the end of the declarative region associated with the given component configuration.A similar rule applies to a block configuration that appears as a configuration item immediately within another block configuration,provided that the contained block configuration configures an internal block." This rule extends visibility of a item declared in a block into the immediate component configuration and to nested configurations associated with internal blocks. The LRM is consistent: The intent is to pass information into external blocks only through its ports and generics. The conclusion of the ISAC is that the provided example is illegal. VASG-ISAC Recommendation for IEEE Std 1076-2002 ----------------------------------------------- No change to the LRM. VASG-ISAC Recommendation for Future Revisions --------------------------------------------- Some restricted form of extended visibility in this area might become an appropriate enhancement request, if a suitable use case can be constructed. -------------END OF IR----------------Received on Fri Aug 12 15:19:37 2005
This archive was generated by hypermail 2.1.8 : Fri Aug 12 2005 - 15:19:37 PDT