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

How to Initialize Multiple Instanses of on chip mem in SoPC

Altera_Forum
Honored Contributor II
1,695 Views

Hi, 

 

I have a custom SoPC component that instantiates an on-chip memory. I need to use multiple instances of this component in my SoPC system, each with its own memory initialization file. In my custom component (I use VHDL), I have instantiated the memory using the MeagFunction PlugIn Wizard. It allows me to set a memory initialization file, but the file will be the same for all instances. I could modify the MegaFunction wrapper VHDL file to export the init_file parameter as a generic and then export it again from my component so that it becomes a parameter in my SoPC component. Is there a better way? 

 

Thanks! 

Niki
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
984 Views

Mega-wizard generated blocks are fairly inflexible for things like that, you're stuck with however you set it up in the wizard. 

 

You can probably do as you describe, but then you wont be able to modify it again in the megawizard and you will have to put your own wrapper around a normal instantiation. 

 

Personally, I avoid using the megawizard whenever possible because it just generates a load of files you dont really need and makes it all infexible.
0 Kudos
Altera_Forum
Honored Contributor II
984 Views

You can solve this in the way that you proposed. 

 

An other solution in line with the global design tool flow of Quartus SOPC could be as follows: 

 

Each memory module with a different content (different .mif file) can be seen as a different component. So if you generate for every on-chip memory block with specific inital content a new MegaWizard module in SOPC, the whole flow is OK again. 

 

(Of course you have a point that it would not be necessary... But then you have to intervene in the design flow, causing trouble in the use of your design afterwards or by other people...)
0 Kudos
Altera_Forum
Honored Contributor II
984 Views

Thanks! Maybe I will just instantiate the RAM in my own wrapper (no MegaWizard), as you suggest. 

 

Regards, 

Niki
0 Kudos
Altera_Forum
Honored Contributor II
984 Views

I'm not a VHDL guru. I use Verilog. But I frequently do what you are trying to do. My method is to override the memory initialization file for each particular instance using the assignment editor.  

Here is an example of the resulting assignment in the QSF file: 

set_parameter -name INIT_FILE trio_boot_loader_epcs.hex -to "trio_sopc:trio_sopc_inst|epcs_controller:the_epcs_controller|altsyncram:the_boot_copier_rom" 

 

So this takes precedence over whatever file is called out in the code itself. The easiest way to do this is to browse through the design hierarchy in the project navigator until you find the RAM module that you want to change the MIF file for, then right click on it and select Locate->In Assignment Editor. Then just make a "Parameter" assignment to it. 

 

This is just one method but it works well for me. 

 

Jake
0 Kudos
Reply