Output -
Int array = '{86981979, 584823717, 388759772, 1607847894, 928990077, 1009032424, 1426036090, 2133673444, 233211323, 190577892} Sum = 20
If I manually sum the array elements printed above I see that the lower most bits have the value of 14 in HEX (20 in decimal).
Please help me understand why the array elements are having huge values.
class constraint_on_int_array;
rand int int_arr[10];
constraint c1 { int_arr.sum == 20;}
constraint c2 { foreach(int_arr[i]) int_arr[i] > 0;}
function void display();
$display("Int array = %p Sum = %0d", int_arr, int_arr.sum);
endfunction
endclass
module tb;
constraint_on_int_array p;
initial begin
p = new();
p.randomize();
p.display();
end
endmodule