Re: [sv-ec] Multiple Inheritance Proposal

From: Gordon Vreugdenhil <gordonv@Model.com>
Date: Mon Aug 16 2010 - 14:40:07 PDT

Tom and Brandon,

Thanks for the initial directions.

Just to check my understanding of what you posted, given:

   pure virtual
   class A#(p = 1);
      pure virtual function int f();
   endclass

   pure virtual
   class B#(p = 1);
      pure virtual function int g();
   endclass

It would be impossible for any class to implement
both a specialization of A and a specialization of
B since both classes have a symbol (the parameter)
named "p".

Is that a correct implication of the intent?

Essentially it becomes the user's responsibility to make
sure that all names are distinct between any set of
classes which participate in an "implements" clauses.

As a second question, if a class "implements" A#(5),
what is the compatibility rule for symbols? For
methods, I assume that the rules are essentially
the "overriding" rules, but what about other symbols?

For example, given my defn of "A" above, which of the
following would be legal (clearly some are not correct
in terms of intent, but what is legal and what is the
rule constraining legality):

1)
    class myA implements A#(7);
      function int f(); return 1; endfunction
    endclass

2)
    class myA implements A#(7);
      localparam p = 5;
      function int f(); return 1; endfunction
    endclass

3)
    class myA implements A#(7);
      static int p = 5;
      function int f(); return 1; endfunction
    endclass

4)
    class myA implements A#(7);
      typedef int p;
      function int f(); return 1; endfunction
    endclass

5)
    class myA extends B#(7) implements A#(5);
      function int f(); return 1; endfunction
      function int g(); return 1; endfunction
    endclass

6)
    class myA extends B#(7) implements A#(7);
      function int f(); return 1; endfunction
      function int f(); return 1; endfunction
    endclass

I have some additional intent and expectation questions
but would like to understand the visibility assumptions
and constraints that you expect first.

Gord

-- 
--------------------------------------------------------------------
Gordon Vreugdenhil                                503-685-0808
Model Technology (Mentor Graphics)                gordonv@model.com
-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Aug 16 14:40:26 2010

This archive was generated by hypermail 2.1.8 : Mon Aug 16 2010 - 14:40:31 PDT