Project

General

Profile

[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  SVN::S4
  Voneline
  WFH
General Info
  Papers

Issue #1442

Updated by Wilson Snyder 3 months ago

<pre>
typedef enum logic[2:0] {P=0, W, E, N, S} Dirs;

module test;

localparam LEN = 3;
localparam COL = 4;
localparam [59:0] SEQ = {LEN'(N), LEN'(E), LEN'(W), LEN'(P)
,LEN'(S), LEN'(E), LEN'(W), LEN'(P)
,LEN'(S), LEN'(N), LEN'(W), LEN'(P)
,LEN'(S), LEN'(N), LEN'(E), LEN'(P)
,LEN'(S), LEN'(N), LEN'(E), LEN'(W)};

endmodule
</pre>

<pre>


$ verilator --lint-only test.v
%Warning-WIDTHCONCAT: test.v:8: Unsized numbers/parameters not allowed in concatenations.
%Warning-WIDTHCONCAT: Use "/* verilator lint_off WIDTHCONCAT */" and lint_on around source to disable this message.
%Warning-WIDTHCONCAT: test.v:9: Unsized numbers/parameters not allowed in concatenations.
%Warning-WIDTHCONCAT: test.v:10: Unsized numbers/parameters not allowed in concatenations.
%Warning-WIDTHCONCAT: test.v:11: Unsized numbers/parameters not allowed in concatenations.
%Warning-WIDTHCONCAT: test.v:12: Unsized numbers/parameters not allowed in concatenations.
%Warning-WIDTHCONCAT: test.v:8: Unsized numbers/parameters not allowed in replications.
%Error: Exiting due to 6 warning(s)
%Error: Command Failed /usr/bin/verilator_bin --lint-only test.v

The fix is to explictly size the enum value. But it seems like the typedef should take care of this
typedef enum logic[2:0] {P=3'd0, W, E, N, S} Dirs;
</pre>

Back