Constraint to generate values divisible by 5 in ascending order

In reply to Radheychin:

class random_values;
rand int values[10];

constraint c1 { foreach (values[i]) values[i] % 5 == 0; }
constraint c2 { foreach (values[i]) values[i] < values[i+1]; }

function void post_randomize();
values.sort();
endfunction
endclass

module test;
random_values rv = new();

initial begin
rv.randomize();
$display(“Random values: %p”, rv.values);
end
endmodule