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

Possible bug in port type carry-over logic #224

Closed
fabianschuiki opened this issue Mar 30, 2021 · 0 comments
Closed

Possible bug in port type carry-over logic #224

fabianschuiki opened this issue Mar 30, 2021 · 0 comments
Labels
A-typeck Area: Type checking, inference, and computation. C-bug Category: This is a bug. L-vlog Language: Verilog and SystemVerilog.

Comments

@fabianschuiki
Copy link
Owner

fabianschuiki commented Mar 30, 2021

This code:

module A;
  wire [31:0] x;
  wire y;
  B system_bus_xbar (.x(x), .y(y));
endmodule

module B (input [31:0] x, output y);
endmodule

Triggers this compiler bug with moore /tmp/small_case.sv -e A:

compiler bug: lvalue lowering of cast to `logic [31:0]` not yet supported: Range([31:0], false)
  --> /tmp/small_case.sv:4:32-33:
   |
   |   B system_bus_xbar (.x(x), .y(y));
   |                                ^
   = note: Encountered at src/svlog/mir/lower/lvalue.rs:310

Suspiciously, the logic [31:0] seems to get inherited from the port definition of x. Likely the carry logic for port evaluation accidentally carries the type of x over to y. This looks like it could be related to #223.

@fabianschuiki fabianschuiki added C-bug Category: This is a bug. L-vlog Language: Verilog and SystemVerilog. A-typeck Area: Type checking, inference, and computation. labels Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-typeck Area: Type checking, inference, and computation. C-bug Category: This is a bug. L-vlog Language: Verilog and SystemVerilog.
Projects
None yet
Development

No branches or pull requests

1 participant