[sv-ec] Visibility of all declarations in base class from derived class

From: Francoise Martinolle <fm_at_.....>
Date: Thu Sep 06 2007 - 09:28:46 PDT
The LRM does not say explicitly that declarations such as constraints,
covergroups
of a base class are visible in the derived class. A class property is
(in the syntax)
a data_declaration. So all data declarations including type declarations
are inherited but what
about other declarations? 


   class Packet;
      typedef int t1;
      localparam p1;
      covergroup cg1;
      endcovergroup
      constraint ct1...;
      class innerclassPacket;
      endclass
   endclass

   class LinkedPacket extends Packet;
      t1 x;  // ok
      localparam p2 = p1; // can you refer to p1?
      // can you refer to cg1, ct1 and innerclassPacket here?
      
   endclass

The LRM section 8.12 says:

"Now, all of the methods and class properties of Packet are part of
LinkedPacket (as if they were defined
in LinkedPacket), and LinkedPacket has additional class properties and
methods."

By the way data_declaration allows for package imports and I thought we
disallowed package imports
inside class declarations. So there should be a note specifying this or
we need to change
the production of class_property to list all of data declarations items
except the package import.

class_property ::=
{ property_qualifier } data_declaration
| const { class_item_qualifier } data_type const_identifier [ =
constant_expression ] ;


data_declaration14 ::=
[ const ] [ var ] [ lifetime ] data_type_or_implicit
list_of_variable_decl_assignments ;
| type_declaration
| package_import_declaration
| virtual_interface_declaration

Francoise
    '

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Fri Sep 7 18:52:16 2007

This archive was generated by hypermail 2.1.8 : Fri Sep 07 2007 - 18:52:58 PDT