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
链接已复制
Hi
in the RAM design:
Could you help to share your design .qar file (Project> Achieve Project) so I could investigate further?
Best Regards,
Richard Tan
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
May I know does my latest reply helps?
Do you need further help in regards to this case?
Best Regards,
Richard Tan
Hi
sorry for the late reply,
Yes, it works.
Thank you for the help
Thank you for acknowledging the solution provided. I'm glad to hear that your question has been addressed. Now, I will transition this thread to community support. If you have any further questions or concerns, please don't hesitate to reach out. Thank you and have a great day!
Best Regards,
Richard Tan