RE: [sv-ec] How does static lifetime interact with virtual methods?

From: Francoise Martinolle <fm_at_.....>
Date: Thu Jun 14 2007 - 11:13:54 PDT
 

You are correct I do not think we discussed virtual
task having static lifetime, I did not pay attention where you had put
the static keyword in your 
previous example.

Francoise
    '

-----Original Message-----
From: Gordon Vreugdenhil [mailto:gordonv@model.com] 
Sent: Thursday, June 14, 2007 2:07 PM
To: Francoise Martinolle
Cc: SV_EC List
Subject: Re: [sv-ec] How does static lifetime interact with virtual
methods?

I think we discussed (and restricted) a class static virtual as being
contradictory.  But there is no language dealing with static lifetime
and virtual.

So:
      class C;
          virtual task t(int x); endtask
      endclass

      class D extends C;
          static task t(int x); endtask
      endclass

is illegal but my original example has not been addressed (unless I
missed that in passing).

Gord.


Francoise Martinolle wrote:
>  
> I thought we discussed this a while ago. In my opinion virtual methods

> should not be static.
> 
> Francoise
>     '
> -----Original Message-----
> From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of 
> Gordon Vreugdenhil
> Sent: Thursday, June 14, 2007 1:15 PM
> To: SV_EC List
> Subject: [sv-ec] How does static lifetime interact with virtual
methods?
> 
> 
> If one has:
>       class C;
>           virtual task static t(int x); endtask
>       endclass
> 
>       class D extends C;
>           task static t(int x); endtask
>       endclass
> 
> How should one think about "this" and "x" in terms of the two bodies 
> of "t"?  Is "this" implicitly automatic?  Is there one "x" or two?  
> Should simultaneous calls to "t" in C be able to interfere with the 
> value of "x" in the "t" in D?
> 
> More to the point -- is this even a sensible thing to permit in the
LRM?
> It seems to me that from first principles, the concept of "virtual" 
> and "static lifetime" are at least somewhat contradictory.  We could 
> clarify the rules, but is it really worthwhile?
> 
> I'd be happy to make it illegal to have static lifetime for a virtual 
> method.
> 
> It is also arguable (though less strange) that "static lifetime"
> should really only be permitted for class static routines.  You do run

> into some oddness with "this" if that isn't the case -- i.e. is "this"
> really a static lifetime implicit formal or is it automatic and the 
> rest static?
> 
> I'd be happy to restrict static lifetime to static methods as well.
> 
> I'll enter a mantis item on this and will add a proposal if people are

> in favor of one or both of the restrictions.
> 
> Gord.
> --
> --------------------------------------------------------------------
> Gordon Vreugdenhil                                503-685-0808
> Model Technology (Mentor Graphics)                gordonv@model.com
> 
> 

--
--------------------------------------------------------------------
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 Thu Jun 14 12:14:28 2007

This archive was generated by hypermail 2.1.8 : Thu Jun 14 2007 - 12:14:38 PDT