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

Warnings and support of array concatenation #1627

Closed
veripoolbot opened this issue Dec 6, 2019 · 3 comments
Closed

Warnings and support of array concatenation #1627

veripoolbot opened this issue Dec 6, 2019 · 3 comments
Labels
area: data-types Issue involves data-types area: lint Issue involves SystemVerilog lint checking effort: days Expect this issue to require roughly days of invested effort to resolve resolution: fixed Closed; fixed

Comments

@veripoolbot
Copy link
Contributor


Author Name: Driss Hafdi
Original Redmine Issue: 1627 from https://www.veripool.org


Verilator provides a very misleading warning when using unsized numbers/parameters in a concatenation/replication. In this example (also found in this diff: drissos@27adb28), verilator generates this warning:

 %Warning-WIDTHCONCAT: t/t_typedef_logic_in_concat.v:12: Unsized numbers/parameters not allowed in replications.
                                                     : ... In instance t
 typedef logic [15:0] count_t;
         ^~~~~
                     ... Use "/* verilator lint_off WIDTHCONCAT */" and lint_on around source to disable this message.

It is true that $bits() returns an unsized number and the warning should rightfully point to it, as opposed to the declaration of the input to the $bits() call. The warning should look like this:

 %Warning-WIDTHCONCAT: t/t_typedef_logic_in_concat.v:15: Unsized numbers/parameters not allowed in replications.
                                                       : ... In instance t
   localparam bit_int_t [1:0] count_bits = {2{$bits(count_t)}};
                                               ^~~~~
                       ... Use "/* verilator lint_off WIDTHCONCAT */" and lint_on around source to disable this message.
 %Error: Exiting due to 1 warning(s)
@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2019-12-06T22:58:12Z


$bits is not unsized, the spec says it's 32 bits, and that's also the size of bit_int_t.

I think Verilator is confused because this is an unpacked array concatentation (IEEE 10.10.1), which are not supported. I believe the correct thing is either an unsupported message, or fix this to work correctly.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2019-12-07T20:53:41Z


  1. Pushed to fixed original warning to properly point to $bits.

  2. Pushed addition of unsupported warning on unpacked concatenations.

  3. This example really was a packed concat which should be warning free. At present there is no way to indicate a number is e.g. 4 to 32 bits but sized. Needs work.

@veripoolbot veripoolbot added area: data-types Issue involves data-types area: lint Issue involves SystemVerilog lint checking effort: days Expect this issue to require roughly days of invested effort to resolve labels Dec 22, 2019
@wsnyder wsnyder added the resolution: fixed Closed; fixed label Aug 30, 2023
@wsnyder
Copy link
Member

wsnyder commented Aug 30, 2023

Fixed a while ago.

@wsnyder wsnyder closed this as completed Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: data-types Issue involves data-types area: lint Issue involves SystemVerilog lint checking effort: days Expect this issue to require roughly days of invested effort to resolve resolution: fixed Closed; fixed
Projects
None yet
Development

No branches or pull requests

2 participants