Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

signed/unsigned mixed calculation with WIDTH warning off #511

Closed
veripoolbot opened this issue May 9, 2012 · 3 comments
Closed

signed/unsigned mixed calculation with WIDTH warning off #511

veripoolbot opened this issue May 9, 2012 · 3 comments
Assignees
Labels
area: wrong runtime result Issue involves an incorrect runtine result from Verilated model resolution: fixed Closed; fixed

Comments

@veripoolbot
Copy link
Contributor


Author Name: junji hashimoto
Original Redmine Issue: 511 from https://www.veripool.org
Original Date: 2012-05-09
Original Assignee: Wilson Snyder (@wsnyder)


I think signed/unsigned mixed calculation is wrong.

Sample code is below.

module mod(A);
output [7:0] A;
wire [7:0] B;
wire signed [3:0] C;
assign C=-1;
assign B=3;
assign A=B+C;
endmodule

Verilator outputs A=-2(Wrong)
But
NC-Verilog outputs A=18(Correct)

In this case,
all number have to use unsigned.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-05-09T02:48:51Z


You'll note Verilator gave a WIDTH warning about this; you must have turned that warning off. When it has to width extend a signed number it lost the expansion was being done in an unsigned context. Need a big edit to fix this, so patch in a day or so.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-05-17T02:19:13Z


Fixed in git towards 3.840++.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-07-31T22:55:06Z


In 3.840.

@veripoolbot veripoolbot added area: wrong runtime result Issue involves an incorrect runtine result from Verilated model resolution: fixed Closed; fixed labels Dec 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: wrong runtime result Issue involves an incorrect runtine result from Verilated model resolution: fixed Closed; fixed
Projects
None yet
Development

No branches or pull requests

2 participants