here i attached a code to read a text file from E drive and store in a array(data1),.
but i can't get the values in array(data1) when the if the size of array (ie data1)is more than 256X32..help me plz
libraryIEEE;useIEEE.STD_LOGIC_1164.ALL;-- Uncomment the following library declaration if using-- arithmetic functions with Signed or Unsigned valuesuseIEEE.NUMERIC_STD.ALL;-- Uncomment the following library declaration if instantiating-- any Xilinx primitives in this code.--library UNISIM;--use UNISIM.VComponents.all;library std;use std.textio.all;useIEEE.std_logic_unsigned.all;use std.textio;entity rr isPort( address :ininteger;
dataout :outinteger);end rr;architecture Behavioral of rr isfile data_in :textisin"E:/sample.txt";type data_array isarray(1to256,1to256)ofstd_logic_vector(7downto0);signal data1 :data_array ;beginprocesstype Y_array isarray(1to256,1to256)ofinteger;type un_array isarray(1to256,1to256)ofunsigned(7downto0);variable Y : Y_array;variable Y_un : un_array;variable inline :line;variable v_char:character;beginfor i in1to256loopassertnot endfile (data_in)report"Premature end of file"severity failure;
readline(data_in,inline);for j in1to256loop
read(inline,Y(i,j));
read(inline,v_char);-- to consume a space character if required
Y_un(i,j):= to_unsigned(Y(i,j),8);
data1(i,j)<=std_logic_vector(Y_un(i,j));endloop;endloop;waitfor2ns;endprocess;end Behavioral;