Hi,
I have a doubt on randomization of array elements with a particular value by using inline constraint.
For ex:-
class A
rand bit[127:0]array[256];
endclass
I want to make most of element’s value of an array as ‘0’ and other elements values can be randomized.
How can do the above operation by using inline constraint.
May i know which approach is correct?
this.randomize(array) with {foreach(array[i])
array[i] dist{'0:=90, [1:((2**(128)-1]):=10};};
(or)
foreach(array[i]) begin
this.randomize(array) with {array[i] dist{'0:=90, [1:((2**(128)-1]):=10};};
(or)
is there any approach?