Re: FW: [sv-bc] parameterized structures

From: Gordon Vreugdenhil <gordonv_at_.....>
Date: Mon Jun 19 2006 - 10:41:16 PDT
Greg,

I think that you are assuming something stronger than what the
LRM requires.  Class specialization requires *constant* values;
as a result, the *type* universe is computable at elaboration
time and doesn't grow during simulation.  "static" is useful
since a type doesn't really come and go -- the local visibility
does but not the type itself.

Example:

   module top;
     class C #(int p = 1);
        static int x;
     endclass

     function void foo;
        C #(2) local_obj;
     endfunction

     C #(2) c_obj;
   endmodule

The type of "local_obj" in foo is *the same type* as the type
for c_obj.  Any reference to "x" via either local_obj or
c_obj always refers to the same "x" that is tied to the specialization
of the type within the universe of class C.

This means that any recursive call could still only create
an elaboration time determinable universe of types.  It is an
implementation issue about when the specializations actually
occur but the static members never "go away".  The lifetime
of a static class member conceptually extends from the first
time the type is specialized until the end of simulation;
any future specialization has the same static member.

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

This archive was generated by hypermail 2.1.8 : Mon Jun 19 2006 - 10:41:31 PDT