Zeev Gal
Zeev Gal

Reputation: 11

specman : how to generate a list with certain number of specific value?

I have a list of 5 items. I need to generate a list with 3 items equal to 4 and 2 others equal to 2. how to generate it?

my code was :

my_list : list of uint;

gen my_list keeping my_list.count(it==4) = 3;

but i got syntax error for it

Upvotes: 1

Views: 39

Answers (1)

Nils
Nils

Reputation: 129

I think, you want:

gen my_list keeping { it.is_a_permutation({4;4;4;2;2}) };

Upvotes: 0

Related Questions