[sv-ec] streaming operator and const members of class

From: Daniel Mlynek <danielm@aldec.com.pl>
Date: Tue Mar 01 2011 - 06:50:10 PST

LRM does not say explicitly how should tool behave if there is a
streaming operator used to unpack stream into a class which has const
fields.
Const field cannot be changed - so in such situation tool should trigger
an error?
On the other hand this kind of operation is not typical assignment to
const which is not allowed.

Any opinions - how should below code behave

CODE:

    class A;
         const byte a=1;
         const byte b;
         byte c;
         function new;
             b=2;
         endfunction
    endclass

    module top;
    A a=new;
    initial begin
         {>>{a}} = 24'h020304;
    end
    endmodule

DANiel

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Mar 1 06:50:02 2011

This archive was generated by hypermail 2.1.8 : Tue Mar 01 2011 - 06:50:35 PST