RE: [sv-bc] Expression evaluation question

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Sat Aug 29 2009 - 11:01:53 PDT
Surya,

When I changed declaration of s to reg, then all 3 simulators that I ran gave me

s:xxxx
s:xxxx
Shalom

________________________________
From: owner-sv-bc@server.eda.org [mailto:owner-sv-bc@server.eda.org] On Behalf Of Surya Pratik Saha
Sent: Friday, August 28, 2009 8:39 PM
To: Jason Campbell
Cc: sv-bc@server.eda.org
Subject: Re: [sv-bc] Expression evaluation question

Hi Jason,
I am not sure about the evaluation logic, but for your case other standard simulators give 0000 output for both the calculation. But surprisingly, if we change the declaration of 's' to 4 state (reg), then all of the standard simulators give following output:
s:1249
s:xxxx

Is it not very confusing?

Regards
Surya



-------- Original Message  --------
Subject: [sv-bc] Expression evaluation question
From: Jason Campbell <jcampbell@winterlogic.com><mailto:jcampbell@winterlogic.com>
To: sv-bc@eda.org<mailto:sv-bc@eda.org>
Date: Friday, August 28, 2009 9:42:43 PM
Hi,
What should be the proper result for the example below?
module test;
  bit [15:0] s;
  reg [15:0] a, b;
  initial
    begin
      a = 16'hxx15;
      b = 16'h1234;
      s = a + b;
      $display("s:%h", s);
      s = 16'hxx15 + 16'h1234;
      $display("s:%h", s);
    end
endmodule
One commercial simulator is giving:
s:1249
s:0000
But shouldn't the value of both expressions be s:0000? Isn't the
LHS evaluated in 4-state then converted to 2-state?
Thanks,
Jason

--
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.
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Sat Aug 29 11:03:09 2009

This archive was generated by hypermail 2.1.8 : Sat Aug 29 2009 - 11:04:05 PDT