Daniel, You should end up with 2 statics. The types of "o" and "o1" are both parameterized by an integer with value 1, so they should use the same specialization. The type of o2 is based on 1'b1 which is 4-state, 1 bit unsigned. Since that is a different type than integer, it yields a different specialization. The output should be 1 1 0 2 2 0 2 2 1 Is in top you had: parameter int some_stuff = 1; you would end up with 3 statics since int and integer don't match. Your understanding of the matching seems to be correct -- your observation in (A) is correct. The LRM explicitly states that predefined types like "int" match their structural description. Gord Daniel Mlynek wrote: > LRM: >> "A specialization is the combination of a specific generic class with a > unique set of parameters. Two sets of parameters shall be unique unless all > parameters are the same as defined by the following >rules: >> a) A parameter is a type parameter and the two types are matching types. >> b) A parameter is a value parameter and both their type and their value are > the same." > > I've doubts about above : > A) so for matching types like int and bit signed [31:0] I should have the > same static variables? > B) > - the only way when type may be taken into account is case when in parameter > declaration type is not explicitly defined? So in case below o and o1 should > have the static variable and o2 should have differen one > > > class A#( p = 0) ; > static int my_static_member; > endclass > > module top; > parameter some_stuff = 1; > A #(1) o; > A #(some_stuff) o1; > A #(1'b1) o2; > > initial begin > o.my_static_member++; > $display(o.my_static_member); > $display(o1.my_static_member); > $display(o2.my_static_member); > o1.my_static_member++; > $display(o.my_static_member); > $display(o1.my_static_member); > $display(o2.my_static_member); > o2.my_static_member++; > $display(o.my_static_member); > $display(o1.my_static_member); > $display(o2.my_static_member); > end > > Endmodule > > Prpoer result????? > KERNEL: 1 > KERNEL: 1 > KERNEL: 1 > KERNEL: 2 > KERNEL: 2 > KERNEL: 0 > KERNEL: 2 > KERNEL: 2 > KERNEL: 1 > > -- -------------------------------------------------------------------- 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 Wed Jul 9 07:16:03 2008
This archive was generated by hypermail 2.1.8 : Wed Jul 09 2008 - 07:16:31 PDT