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

Make RAM from ROM

Altera_Forum
Honored Contributor II
1,529 Views

Hi, I used the MegaWizard Plug-In Manager to create a 1-Port ROM and used a .mif file for the memory content. What I am trying to do next is create RAM. Each time the device is powered-up, the RAM needs to be created from the ROM already loaded onto the device. 

 

I assume I could create another .mif file, and use the MegaWizard to create a 2-Port RAM to be used for simulation? (Also not too sure on when to use 1 vs 2 vs 3 ports...) 

 

But how would I go about creating a module that only runs once, right when the device powers up, to recreate the RAM each time in case some inputs are different? 

 

I am pretty new at this, so any help would be greatly appreciated. Thanks!
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
824 Views

 

--- Quote Start ---  

to recreate the RAM each time in case some inputs are different? 

--- Quote End ---  

 

 

recreate seems to be an inappropriate term in my opinion. The RAM is actually created during compilation, or at FPGA configuration time, whatever view you prefer. I guess, you intend to reload the RAM content from a ROM. That's possible, but only sequentially, one address per clock cycle. You have to code a sequencer to perform it. 

 

To initialize a RAM once, you don't need an additional ROM. Simply assign a *.mif or *.hex initialization file to the RAM. But unfortunately, you can't "replay" the initialization during runtime.
0 Kudos
Altera_Forum
Honored Contributor II
824 Views

Since RAM is volatile and is not retained when the device loses power, by recreate I guess I just mean that it has to be created each time the device is powered up. So rather than continuously create RAM the entire time the device is powered up (because what happens when the RAM is finished being created, but the clock keeps cycling), I assumed you would just do it once at the beginning. So when you say "The RAM is actually created during compilation, or at FPGA configuration time," that sounds like what I was thinking. If this is true, how would I go about doing this? Thanks again!

0 Kudos
Altera_Forum
Honored Contributor II
824 Views

a RAM can actually be initialized at powerup in FPGAs, just like ROM. open the MegaWizard, go to Memory Compiler and choose one of the RAMs and name it. in the wizard you'll see a tab called Mem Init, just specify your .mif there.

0 Kudos
Altera_Forum
Honored Contributor II
824 Views

 

--- Quote Start ---  

recreate seems to be an inappropriate term in my opinion. The RAM is actually created during compilation, or at FPGA configuration time, whatever view you prefer. I guess, you intend to reload the RAM content from a ROM. That's possible, but only sequentially, one address per clock cycle. You have to code a sequencer to perform it. 

 

To initialize a RAM once, you don't need an additional ROM. Simply assign a *.mif or *.hex initialization file to the RAM. But unfortunately, you can't "replay" the initialization during runtime. 

--- Quote End ---  

 

 

 

Do you know how to do this using the SDRAM in DSP builder?? Thanks
0 Kudos
Altera_Forum
Honored Contributor II
824 Views

Do you think is possible to store values in SDRAM or any other RAM of the DE2 board using DSP builder??? 

 

Please let me know!!! 

 

 

thanks
0 Kudos
Reply