Guest
All,
I am having problems with the readline function within a subprogram.
Check out the following processes. In the first process
"proc_wo_subprogram", everything works correctly. The next line from
the file is read and the pointer is assigned to "data_line" and I can
access the object that "data_line" points to. But in the second process
"proc_w_subrprogram", I can't access the object and I don't really
understand why. Can any one explain?
proc_wo_subprogram : process
variable stat : file_open_status;
file data_file : text;
variable data_line : line;
begin
file_open(stat, data_file, "test_data.dat", read_mode);
readline(data_file, data_line);
file_close(data_file);
wait;
end process;
proc_w_subprogram : process
procedure go is
variable stat : file_open_status;
file data_file : text;
variable data_line : line;
begin
file_open(stat, data_file, "test_data.dat", read_mode);
readline(data_file, data_line);
file_close(data_file);
end procedure;
begin
go;
wait;
end process;
I am having problems with the readline function within a subprogram.
Check out the following processes. In the first process
"proc_wo_subprogram", everything works correctly. The next line from
the file is read and the pointer is assigned to "data_line" and I can
access the object that "data_line" points to. But in the second process
"proc_w_subrprogram", I can't access the object and I don't really
understand why. Can any one explain?
proc_wo_subprogram : process
variable stat : file_open_status;
file data_file : text;
variable data_line : line;
begin
file_open(stat, data_file, "test_data.dat", read_mode);
readline(data_file, data_line);
file_close(data_file);
wait;
end process;
proc_w_subprogram : process
procedure go is
variable stat : file_open_status;
file data_file : text;
variable data_line : line;
begin
file_open(stat, data_file, "test_data.dat", read_mode);
readline(data_file, data_line);
file_close(data_file);
end procedure;
begin
go;
wait;
end process;