- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I need to initialize a ROM. I will probably use the Cyclone EP1C6 device. My questions are:
1. Is there a dedicated memory\way of declaration for ROM\RAM or can I just define it in my code in the same way I define other constants (i.e. an arrays of constant <constant-name> : type := <value>;)? 2. The datasheet says: "When configured as RAM or ROM, you can use an initialization file to pre-load the memory contents." Can I get some explanation on how to do that? Thanks in advanceLink Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. Yes. Which HDL are you using? There are coding guidelines in the quartus handbook - Volume 1 Section III chapter 10. But declaring a constant array is a simple way of doing it. You can even use a complex function to initialise the array.
2. If you use the megawizard, you can specify a .mif file. If you declare an array/constant like above, I think you can use attributes to specify the array to read. Annoyingly, Quartus only allows you to read .txt files in Verilog (I have asked for support in VHDL, but they havent been forthcoming yet).- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tricky,
I'm using VHDL. BTW I couldn't find the coding lines you mentioned - there is only chapter 7 in section III. Anyway, I understand that it's ok to simply define an array? If there are no advantages using the megawizard I suppose that I'll go for that solution. Thanks- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Heres a direct link:
http://www.altera.com/literature/hb/qts/qts_qii51007.pdf The megawizard is required if you need a dual port dual clocked memory, but if its a single port ROM it can be overkill. Just stick with defining a constant. And dont think it has to be an array of std_logic_vector either. You can use integers, signed, unsigned, ufixed, sfixed, boolean. Use the most appropriate type.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Got it, thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
for ROM/RAM i use the HDL templates under Edit > Insert Template, seasoned to taste
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- for ROM/RAM i use the HDL templates under Edit > Insert Template, seasoned to taste --- Quote End --- You learned me something new, thx.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page