Closed tomverbeure closed 3 years ago
The port connection logic has an assertion which notices when a generated signal's signedness doesn't match the signedness of the AST node. In this case, a_ff[31:0]
was being treated as a_ff
, but this is incorrect. The latter is signed, while the former is not. The above PR adds a level of indirection to ensure that an expression like a_ff[31:0]
is appropriately treated as unsigned.
Amazing! The time between reporting this and the fix must be close to record.
After applying this patch to my local Yosys tree, I can successfully do SweRV -> sv2v
-> Yosys read_verilog; hierarchy -top swerv; proc
.
synth_ecp5
is now running. I expect it to take a while. :-)
Steps to reproduce the issue
Reduced example:
test.v
:Yosys:
Expected behavior
File gets read correctly.
verilator --lint-only
doesn't have an issue with it.Actual behavior
I don't think SystemVerilog requires equal signedness between argument and instance port, but even if it does, it should only check that during elaboration.
Isolation
Adding submodule definition -> also fail
The following case fails too, with the same error:
Remove
signed
qualifier -> passWhen I remove the
signed
qualifiers, Yosys processes both cases fine.Change argument from vector to 1-bit wire -> pass
Also, when I keep the argument signed, but change argument from vector to a one-bit wire, it passes too:
Change argument from multi-bit vector to 1-bit vector -> fail