i would like to randomize my payload with different length in UVM.
so,can anyone give the solution how to do that.?
thanks,
i would like to randomize my payload with different length in UVM.
so,can anyone give the solution how to do that.?
thanks,
In reply to Rao.Bee:
You can declare payload as dynamic array & randomize by giving constraints for the size of the dynamic array.
Thanks & Regards,
Shanthi
In reply to Rao.Bee:
class packet;
rand bit [7:0] payload[];
int max_size=200;
int min_size=100
constraint payload_size { payload.size() inside {[min_size:max_size]}; }
endclass