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

"output int" (signed) in SV is translated into "output" (unsigned) in V #2425

Open
YikeZhou opened this issue Apr 26, 2024 · 0 comments
Open

Comments

@YikeZhou
Copy link

Version

Latest release (2024-03-13-d844d8d)
with Yosys 0.36+58 (git sha1 ea7818d31, clang 14.0.6 -fPIC -Os)

Reproduction Steps

SystemVerilog code top.sv:

module top(output int o);
   typedef struct packed {
      logic [9:0] min_v;
   } filter_ctl_t;

   filter_ctl_t [1:0][2:0] a;
   assign a[0][0].min_v = '1;
   assign o = int'(a[0][0].min_v);
endmodule

Command:

yosys -p "plugin -i systemverilog; read_systemverilog top.sv; write_verilog -noattr"

Got the following Verilog:

/* Generated by Yosys 0.36+58 (git sha1 ea7818d31, clang 14.0.6 -fPIC -Os) */

module top(o);
  wire [59:0] a;
  output [31:0] o;
  wire [31:0] o;
  assign a[9:0] = 10'h3ff;
  assign o = { 22'h000000, a[9:0] };
endmodule

Expected Behavior

The output port o is declared as int in SystemVerilog. Therefore, I was expecting something like:

output signed [31:0] o;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant