Hi I am trying to read data from a file which contains 62500 lines of 12-bit binary numbers in order to instantiate my 2D array(sort of a RAM). However, my problem is that this process happens in one clock cycle, which puts extreme amount of pressure on the hardware and synthesis does not end. I want to read one line of data from file in every clock cycle. However, I cannot because the function I call is not very open to modification. How can I read a single line of data in every clock cycle??
Here is what I have so far after weeks of research and experimentation
type RamType is array(0 to PICTURE_WIDTH_HEIGHT - 1, 0 to PICTURE_WIDTH_HEIGHT - 1) of bit_vector(11 downto 0); impure function InitRamFromFile (RamFileName : in string) return RamType is FILE RamFile : text is in RamFileName; variable RamFileLine : line; variable RAM : RamType; begin for y in 0 to 249 loop for x in 0 to 249 loop readline (RamFile, RamFileLine); read (RamFileLine, RAM(x,y)); end loop; end loop; return RAM; end function; signal RAM : RamType := InitRamFromFile("\\ASUS\Users\AsusPc\Desktop\project_son\pictureData.data");
I tried to replace nested FOR loops above with nested IFs and convert variables above to signals in order to make this process suitable for my purpose but I received errors which simply says RamFile and RamFileLine must be variable. I have already run out of ideas. Please help me. I am using BASYS3 board and Vivado2017.2 environment.
By the way, picture_height_width is 250 and I did not do what I said above in function. I got rid of function decleration and tried to do it in classic manner.
pictureData.data contains pure binary data and nothing else.