RE: [sv-ec] Re: Arguments to "randomize" method calls

From: Arturo Salz <Arturo.Salz_at_.....>
Date: Tue Mar 07 2006 - 09:16:51 PST
Gord,

My expectation as to the legality of your example is the same as yours:
It should be illegal. And, b.randomize(c) is legal. Hence, the name
binding is static and not at run-time.

By "nasty" I assume you mean problems related to a separately compiled
unit that does not include the full class declaration. But, I assume the
same problems exist with the rand_mode and constraint_mode methods,
right?

	Arturo

-----Original Message-----
From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of
Gordon Vreugdenhil
Sent: Tuesday, March 07, 2006 7:49 AM
To: Gordon Vreugdenhil
Cc: SV_EC List
Subject: [sv-ec] Re: Arguments to "randomize" method calls



Gordon Vreugdenhil wrote:

> In 1800-2005, 13.10 we have:
>    The scope of the arguments to the randomize method is the object
>    class. Arguments are limited to the names of properties of the
>    calling object; expressions are not allowed.
> 
> I just want to clarify whether the name binding is static based on
> the type of the reference or dynamic based on the actual object.
> Specifically, is the following legal:
> 
>    class A;
>    endclass
>    class B extends A;
>      rand int c;
>    endclass
>    A a;
>    B b;
>    initial begin
>       b = new;
>       a = b;
>       a.randomize(c);   // randomize member "c" - legal?
>    end
> 
> For a normal reference "a.c" is illegal but the text in 13.10
> talks about both the "object class" and the "calling object".
> At this point, I'm assuming that this example should be illegal.
> 
> BTW, there are some very nasty separate compilation issues
> involving randomize since the formals of the class method
                                 ^^^^^^^
Should be "actuals" of course.

Gord

> randomize are member names while in a hierarchical call
> to a task randomize they would be normal actuals.
> 
> Gord.

-- 
--------------------------------------------------------------------
Gordon Vreugdenhil                                503-685-0808
Model Technology (Mentor Graphics)                gordonv@model.com
Received on Tue Mar 7 09:17:05 2006

This archive was generated by hypermail 2.1.8 : Tue Mar 07 2006 - 09:17:38 PST