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
Post a Comment