Forum Discussion
Altera_Forum
Honored Contributor
9 years ago --- Quote Start --- Hello Johi, unfortunately I have no idea how your code works. I've never seen code like '$readmemh' before :/ I just want to initialize the memory on my board. But It starts with the problem: How to connect the mif-file with the other files to get an output file generated by compiling which I can upload on my board. I'm also not sure if I wrapped the memory file correctly to my main code. I've never done that before and have no idea how it works. I'll attach the code I got until now. Maybe you see a problem in the wrapping part (after the 'begin' of my architecture)? Best, orPoG --- Quote End --- The trick is the .mif file (a text file icluded in your project) and refer to it in your declaration Then you compile the project and download it to your FPGA. Examples: VHDL: type font_rom_type is array(0 to 255*16) of bit_vector(7 downto 0); signal font_rom : font_rom_type; attribute ram_init_file : string; attribute ram_init_file of font_rom : signal is "Bm437_IBM_VGA8.mif"; VERILOG: // Bitmap font: (* ram_init_file = "Bm437_IBM_VGA8.mif" *) reg [7:0] Bm437_IBM_VGA8[4096]; Best Regards, Johi.