I have a three dimensional array, where the array length is 64, the members in the array are 8 bits wide and I have 4 such arrays. may be some thing like the following:
bit[7:0] temp_data [] [:63];
now using foreach loop
I want to fill in data_byte with 64 entries of 8 bit number each in array[0], followed by array[1], array[2] and array[3]. How can we use nested foreach loop to achieve this. I have defined entries in temp_data[0], temp_data[1] and so on as below:
temp_data[0] = {'h0f,'h00,'h78,'h9a,'h20,'h12,'h78,'h9a,'h34,'h56,'h78,'h9a,'h34,'h56,'hac,'ha0,'h0f,'h00,'hab,'hab,'hac,'ha0,'hbc,'hde,'hab,'hcd,'h12,'h76,'h34,'h9a,'haa,'hbb, 'hde,'hcd,'h12,'h78,'h56,'h78,'h1b,'h2d,'h34,'h56,'h78,'h9a,'h34,'h06,'ha0,'ha0,'hb3,'hd4,'h0b,'hac,'h34,'h9a,'hae,'h9b,'h0b,'h0d,'h20,'h79,'h34,'h9a,'hae,'h9b};
for(ii=0;ii<4;ii++)
begin
foreach(data_byte[i]) data_byte[i] = temp_data[ii][i];
where data_byte basically is queue like : [7:0] data_byte[$];
I m having error like Incompatible complex type.The type of the target is ‘bit[7:0]$[3:0][63:0]’, while the
type of the source is 'bit[31:0].