Thx for the responce.
In complex cases where the class is inherited from the base technology
class *VM the only way to pack and unpack is design a method which will
perform packing/unpacking in customized way.
Streaming operator a you said cannot be used in such places because it
cannot be customized enough.
So final conclusion is that streaming operator usage is limited to
simple class cases.
DANiel
On 3/2/2011 5:27 PM, Rich, Dave wrote:
>
> Daniel,
>
> There is a similar restriction when a field is local or protected.
>
> Although it seems like a nice idea, in practice, the ability to stream
> a class as a whole never works out. None of the *VM methodologies will
> allow this not only because of those restrictions, but because there
> are fields in the base class that the user would never be part of the
> stream.
>
> Dave Rich
> Verification Technologist
> Mentor Graphics Corporation
> *New Office Number: 510-354-7439*
>
> *Twitter-32* <http://www.twitter.com/dave_59>***Technorati-32*
> <http://go.mentor.com/drich>
>
> *From:*owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] *On Behalf Of
> *Daniel Mlynek
> *Sent:* Tuesday, March 01, 2011 11:10 PM
> *To:* Steven Sharp
> *Cc:* sv-ec@eda.org
> *Subject:* Re: [sv-ec] streaming operator and const members of class
>
> On the other hand user want just to put stream into class as single
> atomic operation. He may do not care about const at this time
> If it will be block then he will have no possibility of using
> streaming with classes which has const.
> That is imho too restrictive.
>
> DANiel
>
> On 3/1/2011 7:41 PM, Steven Sharp wrote:
>
> 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>
> [mailto:owner-sv-ec@eda.org] *On Behalf Of *Daniel Mlynek
> *Sent:* Tuesday, March 01, 2011 9:50 AM
> *To:* sv-ec@eda.org <mailto: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* <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 Wed Mar 2 22:28:34 2011
This archive was generated by hypermail 2.1.8 : Wed Mar 02 2011 - 22:28:45 PST