2024-12-12 17:31:54 +01:00
|
|
|
// 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;
|
|
|
|
|
|
2025-01-09 14:33:38 +01:00
|
|
|
rand int string_arr [string];
|
2024-12-12 17:31:54 +01:00
|
|
|
|
|
|
|
|
constraint c {
|
2025-01-09 14:33:38 +01:00
|
|
|
string_arr["a_very_long_string"] == 65;
|
2024-12-12 17:31:54 +01:00
|
|
|
}
|
|
|
|
|
function new();
|
2025-01-09 14:33:38 +01:00
|
|
|
string_arr["a_very_long_string"] = 0;
|
2024-12-12 17:31:54 +01:00
|
|
|
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
|