How to initialize a large buffer by quartus prime
Hi, I want to init my written RAM by a mif file.
Here is my mif file:
DEPTH = 256;
WIDTH = 32;
ADDRESS_RADIX = HEX;
DATA_RADIX = HEX;
CONTENT
BEGIN
00 : 0000 0000;
01 : 0000 0000;
02 : 0000 0000;
03 : 0000 0000;
04 : 0000 0000;
05 : 0000 0000;
.
.
.
FF : 0000 0000;
END;
And here is the error from the quartus prime:
Error (10852): Verilog HDL error at DPbuffer_init.mif(1): illegal character 'p' in hexadecimal number
Error (10170): Verilog HDL syntax error at DPbuffer_init.mif(1) near text: p. Check for and fix any syntax errors that appear immediately before or at the specified keyword. The Intel FPGA Knowledge Database contains many articles with specific details on how to resolve this error. Visit the Knowledge Database at https://www.altera.com/support/support-resources/knowledge-base/search.html and search for this specific error message number.
Error (12152): Can't elaborate user hierarchy "soc_system:soc_inst|m_buffer:dpbuffer_0"
Do you guys know how to fix that or is there another way to init the RAM?
Thank you.
I discovered that we cannot use the $readmemb funciton to read a MIF file.
To read the MIF file, you should use the ram_init_file attribute instead.
You may refer to the document below for instructions on how to apply this attribute:
Best Regards,
Richard Tan