RE: [sv-ec] Abstract classes and virtual methods

From: Rich, Dave <Dave_Rich_at_.....>
Date: Sun Feb 05 2006 - 23:00:08 PST
Neil, See comments below.

Dave


> -----Original Message-----
> From: Neil Korpusik [mailto:Neil.Korpusik@Sun.COM]
> Sent: Saturday, February 04, 2006 4:38 PM
> To: Rich, Dave
> Cc: sv-ec@eda.org
> Subject: Re: [sv-ec] Abstract classes and virtual methods
> 
> I had the following comments on Dave's latest proposal for Mantis
1308.
> 
> 1. Overriding a virtual method
> 
>    Page 1, 1st paragraph, 3rd sentence:
> 
>    From:
>       "A virtual method shall override a method in all of its base
> (parent)
>       classes, whereas a non-virtual method shall only override a
method
>       in that class and its descendants."
>    To:
>       "The implementation of a virtual method shall override that
method
> in all
>       of its base (parent) classes, whereas the implementation of a
non-
> virtual
>       method may only override that method in that class and not in
any of
> its
>       parent classes."
[DR>] The wording I used was taken from a description of virtual
functions in C++ or maybe Java. I think we need to agree on #4 below
before we can fix this.
> 
> 2. Typo
> 
>    Page 1, 2nd paragraph, next to last sentence:
> 
>    From:
>       "... but the presence of a default much match"
>    To:
>       "... but the presence of a default must match"
> 
[DR>] fixed
> 
> 3. Example on page 1
> 
>    From:
>       class My_Packet extends Packet;
>    To:
>       class My_Packet extends BasePacket;
> 
>    From:   (there are 4 cases of this same typo)
>       endfuncion
>    To:
>       endfunction
[DR>] fixed
> 
> 4. Optional 'virtual' keyword
> 
>    Page 2, first paragraph.
> 
>    "Once a method has been identified as virtual, it shall remain
virtual
> in
>    any subclass that overrides it. The virtual keyword may be used in
> later
>    declarations, but is not required."
> 
>    This appears to be an enhancement. Not only that, I don't believe
that
> we
>    want to add this capability. It should be up to the user to
determine
> if
>    a method should be virtual or not.
[DR>] The current LRM does not tell you what to do if you have a method
that is a mix of virtual and non-virtual. Does a non-virtual method
override the virtual-ness of a virtual method in its base class? Even if
that virtual method had no implementation?

In C++, the virtual property is inherited. I can't see why you would
ever want to override a virtual method with a non-virtual method.


> Neil
> 
> 
> 
> Rich, Dave wrote On 02/04/06 00:49,:
> > I have updated the proposal to incorporate the feedback from the
email
> > reflector. http://www.eda.org/svdb/bug_view_page.php?bug_id=0001308.
I
> > have attached a version with markups from 1800 to this for your
> > convenience.
> >
> > There seems to be two remaining issues that need consensus.
> >
> > 1. What level of matching defaults is needed for virtual methods?
The
> > current proposal only requires the presence of a default to match
for
> > each argument, not their expressions. I think a matching expression
is
> > unnecessary and not very useful.
> >
> > 2. The syntax for declaring a method without an implementation. The
> > current proposal reuses the syntax for out-of-class body, which is
what
> > Vera does. Some have suggested that this might be visually
ambiguous,
> > but I think since you have to mark the class as 'virtual', it is
> > unlikely that you will be providing out-of-class bodies at the same
> > time.
> >
> > I may not be able to make most of Monday's meeting, but I think #2
is
> > very critical because a lot of class libraries are being written as
this
> > very moment. Let's try to reach consensus on this issue via e-mail
ASAP.
> >
> > Thanks,
> >
> > Dave
> >
> > David Rich
> > Verification Technologist
> > Design Verification & Test Division
> > Mentor Graphics Corporation
> > dave_rich@mentor.com
> > Office:   408 487-7206
> > Cell:     510 589-2625
> >
> 
> --
> ---------------------------------------------------------------------
> Neil Korpusik                                     Tel: 408-720-4852
> Senior Staff Engineer                             Fax: 408-720-4850
> Frontend Technologies - ASICs & Processors (FTAP)
> Sun Microsystems
> email: neil.korpusik@sun.com
> ---------------------------------------------------------------------
> 
Received on Sun Feb 5 23:00:17 2006

This archive was generated by hypermail 2.1.8 : Sun Feb 05 2006 - 23:00:54 PST