There is no such format. $readmem was defined to read memories,
which are 1-dimensional arrays. It is not defined to read the
multi-dimensional arrays that were added in Verilog-2001. If
you want to use $readmem, then you will have to flatten your
array into a 1-dimensional array.
If you want to use multi-dimensional arrays, then you cannot
use $readmem to read values into them. However, Verilog-2001
also added general file reading capabilities to the language.
This allows you to write your own Verilog code to read data
files into your multi-dimensional arrays. For example, you
could write
integer i,j,fd,rv;
initial
begin
fd = $fopen( "mem.data", "r");
for (i = 0; i < 4; i = i + 1)
for (j = 0; j < 3; j = j + 1)
rv = $fscanf(fd, "%h", mem[j][i]);
end
Your code determines what order the elements will be read
and what format the input data must be in. If you wanted
to add more complex capabilities like embedding addresses
in the file, you could do so, but you would have to write
the Verilog code to parse and interpret the contents of
the file for yourself.
If your simulator supports Verilog-2001 multi-dimensional
arrays but does not support Verilog-2001 file I/O routines,
then you have a problem. I suppose you could write VPI to
do the job, assuming that your simulator supports VPI and
VPI access to multi-dimensional arrays.
No -- the simulation should read the entire file into the array in
zero simulation time.
-a
There is no reason to add a delay to the line. Presumably you want the
entire memory initialized at once at the start of the simulation, not
one location at a time. For a large memory, the later locations in the
memory wouldn't get initialized until a long time into the simulation
if you added a delay between initializing each location.
If it isn't working without a delay, then your simulator is broken.