In reply to dave_59:
Thank you Dave , My bad I wrongly Assumed we neeed 7 unique elements && 3 same elements
For what I had in my mind added one more check to see that the other 3 elements are same
rand bit [3:0] constval;
....
constraint uniq { unique {unum};
foreach (unum[i]) num.sum() with (4'(item==unum[i]))==1;
num.sum() with (4'(item==constval))==3; // Make sure three elements are similar
}
now clear thank u :)