I'm facing an issue using TextIO in initialising a ROM block in my design...
Here's the code snippet with the issue ::
architecture Behavioral of roms2 is type rom_mem_type is array (0 to 31) of std_logic_vector (15 downto
0); FILE rom_file_ptr : TEXT open READ_MODE is "E:/roms.txt";impure function rom_function(temp : in string) return rom_mem_type is variable line_buffer : LINE ; variable count: integer := 0; variable word: bit_vector(1 to 16); variable rom_word_buffer : std_logic_vector(15 downto 0); variable rom_buffer : rom_mem_type;
begin for I in rom_mem_type'range loop
readline (rom_file_ptr, line_buffer);
exit when endfile (rom_file_ptr); read (line_buffer, word);
-- exit when endfile (rom_file_ptr); rom_buffer(I) := to_stdlogicvector(word); end loop; return rom_buffer;
end function;
signal rom_mem : rom_mem_type := rom_function("") ;
Answer record on ::
Has anyone figured a way around this ? Xilinx people pl. help (!)