Forum Discussion
Altera_Forum
Honored Contributor
8 years agoTrouble populating memory from text file
Hello everyone, I need help populating my memory from a text file. Here is my RAM vhdl code: LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_ARITH.ALL;
USE STD.TEXTIO.ALL;
-- Ad...
Altera_Forum
Honored Contributor
8 years agoNo, you have to use an attribute to populate the ram with a .mif/.hex:
http://quartushelp.altera.com/15.0/mergedprojects/hdl/vhdl/vhdl_file_dir_ram_init.htm Be aware though, that this will NOT initialise the ram during simulation. You will need to read in the text file and parse it manually. If you use a ram from the megafunctions library, you can specify the .mif as a generic and this block will parse the file for you, populating the contents in both simulation and synthesis.