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

How to create a *.mif (Memory Initialization File) from a picture (*.bmp)

Altera_Forum
Honored Contributor II
4,967 Views

Hello  

 

I' am trying to make a *.mif (memory initialization file) from a picture(gray scale) and initialize it with memory i have create in fpga. 

The memory is  

reg [7:0] ram[76799:0] // 320X240 

My question is how to create the file an how to initialize it with ram? 

 

Thank you A.A
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
3,032 Views

The mif format is explained in Quartus Help when you look up "mif". It's a rather simple format and you can probably write a script or small software on your PC that reads the bmp file and writes the contents to a text file to generate the mif. Alternatively you can use a hex conversion program such as srecord (http://srecord.sourceforge.net/) that knows how to export to the MIF format.

0 Kudos
Altera_Forum
Honored Contributor II
3,032 Views

I create the mif file from Quartus. 

How to connect it with verilog and initial memory ?
0 Kudos
Altera_Forum
Honored Contributor II
3,032 Views

The easiest way is to use the megawizard to create a ROM/RAM block. Then you can specify the .mif file to use for the block contents.

0 Kudos
Reply