UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor
Contributor
5,405 Views
Registered: ‎12-29-2013

XSim fails to recognize signed expression with shift in localparam

Jump to solution

The following module should return 4'b1110 but instead returns 4'b0110 with xsim 2013.4:

 

module issue_020(y);
  output [3:0] y;
  localparam [3:0] p = 3'sb100 >>> 2'b01;
  assign y = p;
  initial #10 $display("%b", y);
endmodule

XSim 2013.4 seems to think that the expression for p is unsigned because the 2nd operand to the shift operator is unsigned. But sec. 5.1.12 of IEEE Std 1364-2005 states that the right hand side of the right operand of a shift operation has no effect on the signedness of the result.

 

In my tests I have run this module with:

 

xvlog issue_020.v
xelab -R work.issue_020

Crosscheck: Vivado 2013.4, XST 14.7, Quartus 13.1 and Modelsim 10.1d implement this correctly.

 

Isim 14.7 incorrectly returns 4'b0010 for the same test case.

1 Solution

Accepted Solutions
Contributor
Contributor
8,584 Views
Registered: ‎12-29-2013

Re: XSim fails to recognize signed expression with shift in localparam

Jump to solution

Note: This issue has been fixed in Xsim 2014.1.

0 Kudos
2 Replies
Contributor
Contributor
8,585 Views
Registered: ‎12-29-2013

Re: XSim fails to recognize signed expression with shift in localparam

Jump to solution

Note: This issue has been fixed in Xsim 2014.1.

0 Kudos
Xilinx Employee
Xilinx Employee
5,254 Views
Registered: ‎07-16-2008

Re: XSim fails to recognize signed expression with shift in localparam

Jump to solution

Thanks for sharing the updated information.

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos