File: t_constraint_assoc_arr_bad.v

package info (click to toggle)
verilator 5.032-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 93,932 kB
  • sloc: cpp: 131,288; python: 19,365; ansic: 10,234; yacc: 5,733; lex: 1,905; makefile: 1,229; sh: 489; perl: 282; fortran: 22
file content (38 lines) | stat: -rw-r--r-- 885 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
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain, for
// any use, without warranty, 2024 by PlanV GmbH.
// SPDX-License-Identifier: CC0-1.0


class AssocArrayWarningTest;

    rand int bit_index_arr [bit[78:0]];
    rand int logic_index_arr [logic[64:0]];

    constraint c {
        bit_index_arr[79'd66] == 65;
        logic_index_arr[65'd3] == 70;
    }
    function new();
        bit_index_arr = '{79'd66:0};
        logic_index_arr = '{65'd3:0};
    endfunction

endclass

module t_constraint_assoc_arr_bad;

    AssocArrayWarningTest test_obj;

    initial begin
        test_obj = new();
        repeat(2) begin
            int success;
            success = test_obj.randomize();
            if (success != 1) $stop;
        end
        $write("*-* All Finished *-*\n");
        $finish;
    end
endmodule