RE: [sv-bc] Query about '1

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Tue Jul 08 2008 - 11:59:48 PDT
Parameter override is exactly the same as default value parameter
assignement.
 
Shalom


________________________________

	From: Daniel Mlynek [mailto:daniel.mlynek@aldec.com] 
	Sent: Tuesday, July 08, 2008 6:38 PM
	To: Bresticker, Shalom; 'Surya Pratik Saha'
	Cc: 'Banerjee, Ayan'; sv-bc@server.eda-stds.org
	Subject: RE: [sv-bc] Query about '1
	
	
	worse case with parameter is like below '1 used on parameter
assignment list - but it still should return all ones?
	module top;
	        sub #('1) uut();
	        initial uut.r1='1;
	endmodule
	 
	module sub;
	 
	parameter [63:0] p1 = 0;
	reg [63:0] r1 = 0;
	initial begin #0
	    $display( "%b",p1);
	        $display( "%b",r1);
	end
	 
	endmodule
	

________________________________

	From: owner-sv-bc@server.eda.org
[mailto:owner-sv-bc@server.eda.org] On Behalf Of Bresticker, Shalom
	Sent: 8 lipca 2008 16:13
	To: Surya Pratik Saha
	Cc: Banerjee, Ayan; sv-bc@server.eda-stds.org
	Subject: RE: [sv-bc] Query about '1
	
	
	Hi,
	 
	One can make a case for claiming that `1 should be evaluated as
self-determined as a port connection, but not using your argument.
	 
	It is true that simulators give port connection size mismatch
warnings. But the LRM does not require them to do so. The LRM does
explicitly say that port connections are modeled as continuous
assignments (unless port collapsing is performed). In contrast to
regular continuous assignments where size-mismatching is frequently
deliberately done, it is relatively rarely deliberately done on port
connections and thus more likely to be an error.
	 
	Regards,
	Shalom


________________________________

		From: Surya Pratik Saha
[mailto:spsaha@cal.interrasystems.com] 
		Sent: Tuesday, July 08, 2008 5:05 PM
		To: Bresticker, Shalom
		Cc: Banerjee, Ayan; sv-bc@eda-stds.org
		Subject: Re: [sv-bc] Query about '1
		
		
		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>
<mailto:shalom.bresticker@intel.com> 
		To: Banerjee, Ayan <ayan_banerjee@mentor.com>
<mailto: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
<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 <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 Tue Jul 8 12:02:36 2008

This archive was generated by hypermail 2.1.8 : Tue Jul 08 2008 - 12:03:11 PDT