[sv-bc] streaming operator and class static members

From: Daniel Mlynek <danielm@aldec.com.pl>
Date: Fri Feb 11 2011 - 01:07:51 PST

LRM do not say explicitly if static class members should be packed with
streaming operator.
IMO it should be said as this is not so obvious.
 From one perspective static member is a data member, from the other it
will not carry data specific to the handle....

Please take a look on example:

    class A;
    static int p1=1;
    int p2=2;
    static int p3=3;
    int p4=4;
    endclass
      module top;
    bit [127:0] v;
    A a = new;

    initial begin
       v = { >> {a} }; // tylko pola p2, p4? Wszystkie pola?
       $display("%h",{a.p1, a.p2, a.p3, a.p4});
       $display("%h", v);
    end

    endmodule

DANiel

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Fri Feb 11 01:05:14 2011

This archive was generated by hypermail 2.1.8 : Fri Feb 11 2011 - 01:05:31 PST