|
From: R. D. <rdi...@ya...> - 2011-11-03 10:53:00
|
Hi all: I'm trying to read a hex firmware file into a Verilog array with $readmemh(). The firmware file's size depends on the C source code, so that, although it will always be smaller than the Verilog array, its size is not fixed. I'm getting these warnings: WARNING: minsoc_bench.v:111: $readmemh: Standard inconsistency, following 1364-2005. WARNING: minsoc_bench.v:111: $readmemh(../../sw/uart/uart.hex): Not enough words in the file for the requested range [0:32767]. The "Standard inconsistency" text could by the way be more user friendly. I guess the problem is that I'm trying to read too much. How do I find out the file size before calling $readmemh(), in order to avoid those warnings? The file's data length is inside the file itself, as a 4-byte header, but if I try to read just that 4-byte header, I get this warning, because I'm reading too little (!): WARNING: minsoc_bench.v:111: $readmemh(../../sw/uart/uart.hex): Too many words in the file for the requested range [0:3]. Thanks, R. Diez |