I have an index array which contain color of 20 balls, and a ball
What is the nicest wat to constaint the id distribution according to color?
enum {red, green, gray} color_e;
class A;
color_e [19:0] balls_color;
rand logic [4:0] id;
constraint ball_id_c { id {all red ballons from ballons_color := `LOW,
all reen ballons from ballons_color := `MEDIUM,
all gray ballons from ballons_color := `HIGH;}
}
Thanks