Re: [sv-ec] Multiple Inheritance Proposal

From: Gordon Vreugdenhil <gordonv@Model.com>
Date: Mon Aug 16 2010 - 17:12:03 PDT

See [GORD:] comments below.

Alsop, Thomas R wrote:
> Comments below. -Tom
>
> -----Original Message-----
> From: Gordon Vreugdenhil [mailto:gordonv@model.com]
> Sent: Monday, August 16, 2010 2:40 PM
> To: Alsop, Thomas R
> Cc: sv-ec@eda.org; Tipp, Brandon P
> Subject: Re: [sv-ec] Multiple Inheritance Proposal
[...]

>
> 1)
> class myA implements A#(7);
> function int f(); return 1; endfunction
> endclass
> *[Alsop, Thomas R] **This would be fine.** Parameter value is 7. *

[GORD:] ? I'm confused by this response. "implements" doesn't
pull anything *into* the definition of myA does it? It only
constrains what myA must define. So "implements A#(7)" shouldn't
cause "p" to be pulled into myA, it should only place a constraint
on the class that it must provide a "compatible enough" p.

If "implements A#(7)" is intended to automatically pull "p" in
from A#(7) then I need to question how you are differentiating
inheritance from implements.

I would have expected myA to be illegal here as it does not
"implement" a definition of "p" as required by A#(7).

>
> 2)
> class myA implements A#(7);
> localparam p = 5;
> function int f(); return 1; endfunction
> endclass
> *[Alsop, Thomas R] **This **feels like **a collision of parameters and
> **should be** an error**. *

See my response to (1).

I think we should get agreement on (1) and (2) before bothering to go
further.

I suspect (but am not sure) that you are viewing types, parameters,
etc. as being different than methods -- that they are essentially
inherited from the class being "implemented" while methods follow
what I consider to be "constraints" on the final type -- something
that is required to be provided by the implementing class type.

Another (more operational) way of expressing this is that you are in
fact doing inheritance -- you inherit all types, parameters and *method
pointers* via an "implements" and the only thing that a class can do
is "fill in" the method pointers. Is that in fact the model that you
have in mind?

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 17:12:23 2010

This archive was generated by hypermail 2.1.8 : Mon Aug 16 2010 - 17:12:27 PDT