Mixed packed and unpacked array

Hi,

i didnt understand the below declaration of arrays. can any one explain me the declaration of below array and how to assign values to the below arrays? how to do part select with these arrays?

  1. reg [7:0] [0:4] mem2 [0:1];

  2. reg [7:0] [0:4] mem3 [0:1] [0:1];

Thanks in advance,

In reply to nag_sv:

http://lmgtfy.com/?q=packed+and+unpacked+arrays+in+systemverilog

hi nag_sv

while dealing with memory we consider like this
[WIDTH] mem [DEPTH]; // left side is width and right side is depth.
we can make slices the width and depth.
we can take entire slice or one bit of slice.
To access the memory of width first we require in which slice our data is after that which bit.
i.e reg [7:0] [0:4] mem2 [0:1];
in this example [bit_position][slice_position]mem [depth];
our memory is having 5 ([0:4]) slices each having 8 bits ([7:0]).

our memory 76543210 | 76543210 | 76543210 | 76543210 |76543210
slice 0 | 1 | 2 | 3 | 4

like that there (0,1) depths are there.

to access the memory location in which depth it is after that which slice
it is after that what is the bit position.
i.e [3][1]mem[0] which means in depth of 0 in slice 1 3rd bit.

Thanks
Gunnesh