It is an assignment to a const, so I would expect an error.
________________________________
From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of Daniel Mlynek
Sent: Tuesday, March 01, 2011 9:50 AM
To: sv-ec@eda.org
Subject: [sv-ec] streaming operator and const members of class
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<http://www.mailscanner.info/>, and is believed to be clean. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Tue Mar 1 10:42:23 2011
This archive was generated by hypermail 2.1.8 : Tue Mar 01 2011 - 10:42:55 PST