Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
Signed-off-by: Ryszard Rozak <[email protected]>
  • Loading branch information
RRozak committed Nov 7, 2024
1 parent 2e1128b commit ec8affe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test_regress/t/t_randomize_array.v
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class unconstrained_dynamic_array_test;
rand int dynamic_array_1d[];
rand int dynamic_array_2d[][];
rand Cls class_dynamic_array[];
rand Cls class_dynamic_array_null[];

function new();
// Initialize 1D dynamic array
Expand All @@ -94,6 +95,8 @@ class unconstrained_dynamic_array_test;
class_dynamic_array[i] = new;
end

class_dynamic_array_null = new[2];

endfunction

function void check_randomization();
Expand All @@ -108,6 +111,9 @@ class unconstrained_dynamic_array_test;
foreach (class_dynamic_array[i]) begin
`check_rand(this, class_dynamic_array[i].x)
end
foreach (class_dynamic_array_null[i]) begin
if (class_dynamic_array_null[i] != null) $stop;
end
endfunction

endclass
Expand Down

0 comments on commit ec8affe

Please sign in to comment.