Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20688 Discussions

MAX10, on-board RAM or ROM: What does memory initialization do?

Rodo
New Contributor I
1,005 Views

Hi all,

I'm playing with a BeMicroMAX10 that I've had for a while. Last time I used it was in Quartus web (free) v15, now using v21.1.0 (also free).

I was getting an error at compile with error initialization. In the platform designer (old qsys?) I add on-board ROM or RAM and I click the textbox for memory initialization. Anyhow ... I got rid of the error by clicking the box below to give it a name.  If I click the boxes or don't click the boxes the total memory bits usage does not change. So, what does memory initialization actually do? I wonder if it really sets the value of each memory cell to a certain hex value? This sounds silly unless it is needed for some reason. When using microcontrollers I always assume the value of uninitialized memory is a random value.

Thanks

0 Kudos
7 Replies
sstrell
Honored Contributor III
991 Views

It's an FPGA, so you can program the contents of memories with whatever values you want when you program the device.  You need to associate a .hex or a .mif file with a particular memory for this to work, and you can do that in the IP parameter editor for the memory or with a synthesis attribute in your HDL code.

If you don't have a .hex or .mif file, make sure you disable memory initialization in the parameter editor.

0 Kudos
YEan
Employee
957 Views

Hi Rodo,

 

Do you have any updates on your question?

 

Thank you.

 

Best regards,

Ean

0 Kudos
Rodo
New Contributor I
947 Views
0 Kudos
YEan
Employee
930 Views

Hi Rodo,

I think that your issue has been resolved by sstrell.

I'll now transition this thread to community support.
If you have a new question, feel free to open a new thread to get the support from Intel experts.

Thank you.

Best regards,

Ean

0 Kudos
Rodo
New Contributor I
918 Views
  1. I disagree.  The answer from sstrell does not address the issue of why you would need the memory initialized. Although I thank sstrell for his time and effort. I haven't figure the stuff out yet but the answer seems to be in booting nios. Combining the elf file with the sof file to get a pof and program the pof where nios will boot and copy either some or all of the application to RAM. This copying seems to need the memory init option set. As I said earlier, not sure how the whole booting thing works yet. There are several options available. AN730 seems to talk about it. I also have some old notes about this but I'm not sure I'm gonna get into the flash IP and boot options yet. I'm still adding components to the platform designer and using the byte blaster option to program the max10. This program goes away after power down the kit because I'm not programming the flash with any boot option as discussed in AN730. It is slow going but steady. Thanks guys.
0 Kudos
sstrell
Honored Contributor III
904 Views

Memory initialization is useful for many things: test and debug, error insertion, source code and source data.  It's also required if you are creating a ROM (vs. a RAM).

Your initial question mentioned nothing about Nios, so I was answering based on just the use of memory blocks on their own in an FPGA design.

0 Kudos
Rodo
New Contributor I
895 Views

sstrell:"Your initial question mentioned nothing about Nios"

 

Yeap...that was a useful piece of info I should have included. Sorry. Thanks again.

0 Kudos
Reply