raghava
Member level 2
HI all,
I am facing problems with file reading in VHDL. I am newbie to VHDL.
I am expecting answers.
Here is the code and error message I have got.
***********************
procedure PrepareInput is
variable inLIne: line;
variable int_text : integer:= 0;
variable index : integer:= 0;
--file file_in : text open read_mode is "../data/input/lena_64_64.txt";
--file file_in : integer;
type int_file is file of integer;
file file_in : int_file is in "../data/input/lena_64_64.txt";
begin
while not endfile(file_in) and (index<IR*IC) loop
--readline(file_in, inLIne);
--exit when endfile (file_in);
--read(inLIne, int_text);
read(file_in, pixelImage(index));
index := index + 1;
end loop;
file_close(file_in);
end PrepareInput;
Error message is ERROR: In process testbench.vhd:stim_proc
../data/input/lena_64_64.txt read error on type int_file
INFO: Simulator is stopped.
I am facing problems with file reading in VHDL. I am newbie to VHDL.
I am expecting answers.
Here is the code and error message I have got.
***********************
procedure PrepareInput is
variable inLIne: line;
variable int_text : integer:= 0;
variable index : integer:= 0;
--file file_in : text open read_mode is "../data/input/lena_64_64.txt";
--file file_in : integer;
type int_file is file of integer;
file file_in : int_file is in "../data/input/lena_64_64.txt";
begin
while not endfile(file_in) and (index<IR*IC) loop
--readline(file_in, inLIne);
--exit when endfile (file_in);
--read(inLIne, int_text);
read(file_in, pixelImage(index));
index := index + 1;
end loop;
file_close(file_in);
end PrepareInput;
Error message is ERROR: In process testbench.vhd:stim_proc
../data/input/lena_64_64.txt read error on type int_file
INFO: Simulator is stopped.