Hi,
I have three values which are signed logic vectors as shown below. I am trying to build a constraint where the sum of the three numbers, positive and negative included should be less than a constant.
parameter signed LIMIT = 200;
rand logic signed [15:0] a;
rand logic signed [15:0] b;
rand logic signed [15:0] c;
constraint limit {a+b+c < LIMIT);
I tried the above code snippet but it does not obey the constraint.I would like the value of a ,b and c be negative/and or positive but the sum to be less than the constant.
How can i write this constraint ?