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

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

Rodo
New Contributor I
1,935 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
11 Replies
sstrell
Honored Contributor III
1,921 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
1,887 Views

Hi Rodo,

 

Do you have any updates on your question?

 

Thank you.

 

Best regards,

Ean

0 Kudos
Rodo
New Contributor I
1,877 Views
0 Kudos
YEan
Employee
1,860 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
1,848 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
1,834 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
1,825 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
GSica
Beginner
498 Views

Sorry I reopen the post away a long time.
I'm using a 10M02SCE144I7G device. I tried to configure a 24bit - 64 words ROM with the Megawizard by inserting the .MIF initialization file, but when I compile the project, I got the error "Error (16031): Current Internal Configuration mode does not support memory initialization or ROM. Select Internal Configuration mode with ERAM."
So ERAM is an External Ram and therefore it is not possible to configure the internal flash for the memory configuration?

How can I do?

Where am I wrong?

What is the right configuration to use?

Thanks

 

Giovanni

0 Kudos
FvM
Honored Contributor I
496 Views

Hi,
ERAM means embedded RAM, I presume. Problem is limited flash capacity of SC (single supply, compact) MAX10 device types. Unfortunately, they don't provide memory initialization at all. The "solution" to select a different configuration scheme doesn't exist for this device. ROM table can be nevertheless emulated in logic cells, not sure if 10M02 has sufficient free resources. .mif initialization is probably not supported, try inferred ROM with initialization function, see Quartus HDL templates.

 

Regards

Frank

0 Kudos
FvM
Honored Contributor I
462 Views
Another way to initialize ROM is to store the data in UFM and copy UFM data to RAM during startup. 10M02 UFM can hold up to 96 kbit of data.
0 Kudos
GSica
Beginner
409 Views

Hi,

it's true. I changed the device and put the 10M04SAE144I7G and in fact the error disappeared and it allows me the initial configuration of the ROM.

Thanks

 

Giovanni

0 Kudos
Reply