module abc;
class a;
rand int unsigned aa;
rand int unsigned bb;
constraint c2 {
aa + bb <= 10;
}
endclass
initial begin
a a1 = new();
a1.randomize();
$display(a1.aa, a1.bb);
end
endmodule
if I use the ‘int’ datatype, the sum is overflowing and the aa & bb are assigned with bigger values. Is there any solution to constraint aa & bb lessthan 10?