"output int" (signed) in SV is translated into "output" (unsigned) in V
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Domain
- compilers
Research direction
Start with the top.sv reproduction and run the provided yosys command using the SystemVerilog plugin. Inspect how the output port declaration and signed cast are represented in the generated Verilog. Done means the generated declaration preserves the signed 32-bit output expected for output int o.
Written by the indexing model from the issue text.
Description
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;
- Dominant language
- Verilog
- Stars
- 237
- Forks
- 30
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from chipsalliance/synlig
-
Ipath with deferOpen
Difficulty 4/5 3-5 days Newbie friendliness 35/100
chipsalliance/synlig#2776 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
chipsalliance/synlig#2775 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
chipsalliance/synlig#2774 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
chipsalliance/synlig#2772 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
chipsalliance/synlig#2771 · 1 comment ·
All issues in chipsalliance/synlig
Similar issues
-
chat compiler P1
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
HerringtonDarkholme/hd-lang#2793 ·
Maintainers usually reply within 1 day
-
help wanted question
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
area-dart-model gardening
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
Maintainers usually reply within 1 day
-
better error message low priority parser
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day