I need to generate constraint numbers in the following pattern (0,12,24,36,48… but i do not need negative numbers how to generate them?) The below solution does not work. Thank you for the help.
class varc;
rand int var1;
constraint c1{ ((var1)%12==0);}
endclass
module tb;
varc v;
initial begin
repeat(20) begin
v = new;
v.randomize;
$display(v);
end
end
endmodule