Re: FW: [sv-bc] parameterized structures

From: Gordon Vreugdenhil <gordonv_at_.....>
Date: Mon Jun 19 2006 - 16:52:18 PDT
Greg Jaxon wrote:

> Gordon Vreugdenhil wrote:
> 
>> Greg,
>>
>> I'm not sure I understand the issue here.
>>
>> Let's stick with the process/scope case for a moment.
>>
>>   module top;
>>     class C #(int p = 1);
>>        static int x;
>>     endclass
>>
>>     always @(clk) begin
>>         C#(2) c_obj = new;
>>         c_obj.x++;
>>     end
>>
>>     always @(clk) begin
>>         C#(2) c_obj = new;
>>         c_obj.x++;
>>     end
>>   endmodule
>>
>>
>> Are we in agreement that there is only one "x" here and that
>> it is the one that is the member of the specialized type C#(2)?
> 
> 
> That is also what I'd like to see the LRM specify.  However, I will
> note that the generic class has been declared in two different scopes,
> neither of which is in a package context, so according the quote (see 
> below)
> I might expect them to be different types.


I don't see this at all.  It is clear that each C#(2) is
a *specialization*.  There is only one declaration of the
parameterized class C -- the one in top.  C#(2) isn't
a *declaration* of a class type at all; it is a specialization.

Gord.
-- 
--------------------------------------------------------------------
Gordon Vreugdenhil                                503-685-0808
Model Technology (Mentor Graphics)                gordonv@model.com
Received on Mon Jun 19 16:52:20 2006

This archive was generated by hypermail 2.1.8 : Mon Jun 19 2006 - 16:52:35 PDT