I have a ethernet transaction in which I have a payload_data; the size of of which is constrained dependin gon the packet type (as in below).
typedef enum {NORMAL,JUMBO} PKT_TYPE;
typedef enum {GOOD,BAD} CRC_TYPE;
bit unsigned [6:0] [7:0] preamble;
bit [7:0] sfd;
rand bit [5:0] [7:0] d_addr, s_addr;
rand bit [1:0] [7:0] data_len;
randc bit [7:0] payload_data[];
bit [3:0] [7:0] crc;
rand PKT_TYPE type_pkt;
rand CRC_TYPE type_crc;
constraint eth_mac_frame_normal
{
if (type_pkt == NORMAL)
{payload_data.size() inside {[46:1500]};
payload_data.size() == data_len;}
}
constraint eth_mac_frame_jumbo
{
if (type_pkt == JUMBO)
{payload_data.size() inside {[1501:9000]};
payload_data.size() == data_len;}
}
When I run the test, (I am using Questa 10.0) It gives me the following error :
** Error: (vsim-7020) eth_SEQ.sv(22): Illegal attempt to resize random dynamic array 'pkt.payload_data' to 8421 elements. (SolveArrayResizeMax=2000)
# Time: 0 ps Iteration: 37 Region: /uvm_pkg::uvm_sequence_base::start
eth_SEQ.sv(22) is where I am randomizing the transaction.
Can anyone please help why this error is coming? I searched over the net but i could’nt understand it clearly.