- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
As you know, in Verilog, initialize $readmemh code is initialized Ram simply. I searched a VHDL code like this but i can't get. Do you help me to find this code? If you know a sample, can you share with me ? Thanks.Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In quartus, there are only 2 ways to initialise a ram using VHDL:
1. using a function to set all values. 2. Use a mif file in conjuntion with a megawizard generated altsyncram. Annoyingly, you cannot use textio to read data in from a text file (like you can with verilog and X based FPGAs).- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If this is for simulation purpose, then initialize the memory content when u create them, but you need to use simulator like ModelSim
If this is an actual circuit then you MUST use mif file to initialize memory content. The programmer tool will initialize the memory when it programs the FPGA.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey
Can you help me, how can i use a .mif file to initialize a RAM, can you give me the steps to do in the programming phase with vhdl language ... or give me an exemple of that (how i should write) .... thank's in advance ........- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Go to the megawizard
create a ram with the specifications you need and specify a mif file to initialise the ram from.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thank's but can you tell me where can i found the megawizard because i am a new user of the quartus II ???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tools menu -> megawizard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thank you it is working fine (i think) just another questions can i write the resulte in a file like .mif using a RAM ?? if there is another way please tell me about it
thank's again .....- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
what results? from a testbench or from a real board?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
from a simulation ( i have an image in jpg ==> i trasnfert it in mif file ligne by ligne ) then i have a bloc creating in vhdl who will read from the ROM the pixels one by one and do some processing and give in result another value for the pixel (like a convolution) me i want to write this result in a file so i can use it after in MATLAB.
I hope i was clear .........- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
VHDL allows you to read and write from text files using the std.textio library
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- If this is for simulation purpose, then initialize the memory content when u create them, but you need to use simulator like ModelSim If this is an actual circuit then you MUST use mif file to initialize memory content. The programmer tool will initialize the memory when it programs the FPGA. --- Quote End --- can you elaborate why you must use a .mif in Quartus? i use initialized contents after declaring the RAM/ROM specifically because it works in synthesis and simulation. the Quartus II HDL templates are also built this way

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