Re: [sv-bc] Query about '1

From: Surya Pratik Saha <spsaha_at_.....>
Date: Tue Jul 08 2008 - 07:05:24 PDT
Hi Shalom,
I have some comment on e.g. <1> answer. Conceptually your answer is correct. But the answer should be <c>. Because at the time of port connection, the actual expression should be evaluated in context insensitive manner. Consider the following e.g:
module top;
    wire [2:0] x;
    test t(x);
endmodule
module test(i);
    input [3:0] i;
endmodule

All standard simulators gives port connection size mismatch warning as per LRM. If the port connection is simple continuous assignment then there is no need to give that warning. Considering that, if '1 is evaluated in context insensitive manner, then as per SV LRM, the value will simple one bit 1. Hence the answer should be <c>.
Regards
Surya


-------- Original Message  --------
Subject: Re:[sv-bc] Query about '1
From: Bresticker, Shalom <shalom.bresticker@intel.com>
To: Banerjee, Ayan <ayan_banerjee@mentor.com>, sv-bc@eda-stds.org
Date: Tuesday, July 08, 2008 7:09:33 PM
I think the answers should be:


From: owner-sv-bc@server.eda.org [mailto:owner-sv-bc@server.eda.org] On Behalf Of Banerjee, Ayan
Sent: Tuesday, July 08, 2008 3:57 PM
To: sv-bc@server.eda-stds.org
Subject: [sv-bc] Query about '1

Hi,

 

I have 3 queries about what should be the correct behavior for the following 3 cases.

 

1)

What should be behavior if ‘1 is passed to a port as is done in the following testcase?

 

module top;

bottom inst('1);

endmodule

 

module bottom(a);

input [63:0] a;

 

initial

    $display("%b", a);

endmodule

 

 Should it be a) 1111111111111111111111111111111111111111111111111111111111111111 or

                    b) zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz1 or

                    c) 0000000000000000000000000000000000000000000000000000000000000001

 

[SB] a. This should be treated as the continuous assignment "bottom.a = '1" 

 

 

2) What should be the behavior if ‘1 is used as parameter value

module top;

parameter [63:0] p1 = '1;

initial

    $display("%b",p1);

endmodule

 

Should it be a) 1111111111111111111111111111111111111111111111111111111111111111 or

                  b) 0000000000000000000000000000000000000000000000000000000000000001

 

[SB] a. Treated as assignment "p1[63:0] = '1". 

 

3) Similar to 2 but in a more general case what should be the value of parameter if range is specified which is more than 32 but the expression assigned is of 32 bit. Should the expression be evaluated in 32 bit or with the size of parameter?

 

module top;

parameter [63:0] p1 = 1'b1 << 63;

initial

    $display("%b",p1);

endmodule

 

Should it be a) 0000000000000000000000000000000000000000000000000000000000000000  or

                  b) 1000000000000000000000000000000000000000000000000000000000000000

 

The behavior of simulators are different in the above cases. Thanks in advance for your help.

 [SB] With the size of the parameter. The answer should be b. We discussed this in the past.

 

Shalom

 

 

 

 

-Regards,

Ayan

---------------------------------------------------------------------
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.


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean. Received on Tue Jul 8 07:08:30 2008

This archive was generated by hypermail 2.1.8 : Tue Jul 08 2008 - 07:08:59 PDT