How to randomize an array of bit arrays in verilog? -


i new verilog.

how can randomize following:

 bit [7:0] data []; 

*without use randomize() of systemverilog.

systemverilog not change size of dynamic array unless put constraint on it. either need allocate array before calling randomize(), or use constraint randomize size.

bit [7:0] data [];  data = new[10]; randomize(data); 

or

bit [7:0] data [];  randomize(data) {data.size inside {[5:15]} ;}; 

or if not have access randomize() systemverilog, can

  data = new[10];   foreach(data[ii]) data[ii] = $urandom; 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -