Hi,
I would like to know the difference between the two lines in the constraint statement below:
class array ;
parameter size = 10;
parameter int UNIQ = 3;
rand bit [5:0] array [size];
rand bit [5:0] rand_element;
constraint AB {
array.sum () with (int'(item == rand_element)) == UNIQ;
// array.sum () with ((item == rand_element)) == UNIQ;
}
endclass
The one which is commented out gives constraint errors, the other works fine. The constraint is to have 3 same elements in an array of size 10.