File: t_lint_width_arraydecl.v

package info (click to toggle)
verilator 5.038-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 162,552 kB
  • sloc: cpp: 139,204; python: 20,931; ansic: 10,222; yacc: 6,000; lex: 1,925; makefile: 1,260; sh: 494; perl: 282; fortran: 22
file content (45 lines) | stat: -rw-r--r-- 1,042 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain, for
// any use, without warranty, 2009 by Wilson Snyder.
// SPDX-License-Identifier: CC0-1.0

localparam UADDR_WIDTH = 4'd10;
localparam UROM_WIDTH = 5'd17;
localparam UROM_DEPTH = 11'd1024;


module t(
         input clk,
         input [UADDR_WIDTH-1:0] mAddr,
         output logic [UROM_WIDTH-1:0] mOutput);

   // Issue #3959
   reg [UROM_WIDTH-1:0] uRam[UROM_DEPTH];

   always @(posedge clk) mOutput <= uRam[mAddr];

   // Issue #6045
   typedef enum logic [1:0] { e_0, e_1, e_2, e_3 } enum_e;

   typedef struct packed {
      integer unsigned x;
      integer unsigned y;
   } foo_s;

   typedef struct packed {
      integer unsigned y;
   } bar_s;

   // Warning due to concatenation, but this is actually a member assignment
   localparam foo_s foo = '{
      y: (1 << e_0) | (1 << e_3)
      , default: '0
   };

   // No warning
   localparam bar_s bar = '{
      y: (1 << e_0) | (1 << e_3)
   };

endmodule