Randomization

Hi,

Please help write the code for the following randomization problem.
Write a constraint to create a random array of integers such that array size is between 10 to 16 and the values of the array are in descending order.

Thanks,
Sruthi.

In reply to sruthikrapa:
The following code will assign the value in accending order. should it be any value ?


 rand int dyn[];

 constraint c_dyn_size {
    dyn.size insie {[10:16]};
}

 constraint c_dyn_value{
   foreach(dyn[i]) dyn[i] = i ;
}

``` verilog

Hi kddholak,

Thank you for the response.
Yes, it should be any value.

Thanks,
Sruthi.