Posted on:
I am having a large text file which contains only the pixel values of an
image.....here i can able to read the pixels using $readmemh system
task..... but the prolem is memory......am using only 1000 words of
memory as below
reg [31:0] Mem [0:999];
initial $readmemh("pixels.txt",Mem);
By this i can get only 1000 pixles from the text file and i will give
these pixels to the next module for furthur processing....then i have to
read the next 1000 pixels from the text file and put it in the
Mem....similarly i want all the pixels to be readed from the txt file
with the Mem size as 1000 and give those to the next module for furthur
processing......so how i can do this plz i will be very thank full to
u...plz help me.....
Posted on:
The Verilog system tasks $readmemb/h are prepared to fill only a part of the memory but not to read only a part of the file. This is different from C. So, I would suggest that you increase the size of the memory so that the complete file is read with one single call of $readmemh. Afterwards you may process the data in chunks of 1000 samples out of the memory.
Posted on:
Is there any method where we can read chunks of datas from a file using verilog....
Posted on:
No. It's quite simple to read the complete file. Why don't you do this?
Posted on:
i have tried but in icarus simulator the its reading upto 1980 words....after that it is giving error as below Error: Invalid input character
Posted on:
That's surprising! Are you sure that there is no invalid character in the file. If you delete the first n items does the error number stay the same?
Posted on:
thanks a lot for ur reply......s u r right sir....i found one invalid charachter over there now it is reading properly...