Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17263 讨论

How to initialize a large buffer by quartus prime

CAlex
新分销商 II
2,464 次查看

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.

标签 (1)
0 项奖励
1 解答
RichardTanSY_Altera
2,358 次查看

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:

Link: https://www.intel.com/content/www/us/en/docs/programmable/683283/18-1/ram-initialization-file-for-inferred-memory.html


Best Regards,

Richard Tan


在原帖中查看解决方案

0 项奖励
8 回复数
FvM
名誉分销商 II
2,459 次查看

Hi,

please show how you reference the .mif file in your design.

0 项奖励
CAlex
新分销商 II
2,420 次查看

Hi

in the RAM design:

// initial
initial
begin
    if (DPBUFFER_INITIAL_FILE == "DPbuffer_init.mif")begin
        $readmemh(DPBUFFER_INITIAL_FILE,mem);
    end
   
// read data initial
    ava_read_data <= 0;
    read_data <= 0;
end
 
I've tried different path, but the quartus still cant recognize the mif file.
I've placed the mif file both under qpf file and my IP verilog file.
 
0 项奖励
RichardTanSY_Altera
2,412 次查看

Could you help to share your design .qar file (Project> Achieve Project) so I could investigate further?


Best Regards,

Richard Tan


0 项奖励
CAlex
新分销商 II
2,386 次查看

Sure,

the qar file is attached.

 

I changed the mif file to mem file so that it can be compiled successfully.

But I still need to use mif file to start.

The IP name is DPbuffer.

0 项奖励
RichardTanSY_Altera
2,359 次查看

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:

Link: https://www.intel.com/content/www/us/en/docs/programmable/683283/18-1/ram-initialization-file-for-inferred-memory.html


Best Regards,

Richard Tan


0 项奖励
RichardTanSY_Altera
2,180 次查看

May I know does my latest reply helps?

Do you need further help in regards to this case?


Best Regards,

Richard Tan


0 项奖励
CAlex
新分销商 II
2,172 次查看

Hi

sorry for the late reply,

Yes, it works.

 

Thank you for the help

0 项奖励
RichardTanSY_Altera
2,148 次查看

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


0 项奖励
回复