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

From: Brad Pierce <Brad.Pierce_at_.....>
Date: Sat Sep 08 2007 - 10:33:58 PDT
>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. 

I agree that there ought to be a note.  See --

   http://www.eda-stds.org/sv/sv-champions/hm/0227.html

-- Brad

-----Original Message-----
From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of
Francoise Martinolle
Sent: Thursday, September 06, 2007 9:29 AM
To: sv-ec@eda.org
Subject: [sv-ec] Visibility of all declarations in base class from
derived class

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.



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Sat Sep 8 10:34:26 2007

This archive was generated by hypermail 2.1.8 : Sat Sep 08 2007 - 10:34:46 PDT