rx_tx : process
-- other procedures
procedure data_rx_ddf is
-- Write to file variables
variable outline : line ; -- line number declaration
file outfile : text ; -- Declare write file variable, file pointer
variable fstatus : FILE_OPEN_STATUS;
begin
report "Got status from file: '" & FILE_OPEN_STATUS'image(fstatus) & "'"; -- Always reports with 'open_ok'
-- Open/Append file for writing
if fstatus /= OPEN_OK then -- Seems like file is always open if it is not closed(?)
file_open(fstatus, outfile, "C:\Work\fpga_a7\sources\sim\dump_data_results.txt", write_mode);
else
file_open(fstatus, outfile, "C:\Work\fpga_a7\sources\sim\dump_data_results.txt", append_mode);
end if;
.
.
-- Remaining part where write-to-file operations are done based on some logic
-- file_close() is never called
end data_rx_ddf;
begin
procedure0;
wait for 10 ns;
procedure1;
if error = '0' then -- signal
procedure3;
wait for 10 ns;
start <= '1'; -- signal
wait for 1 us;
-- Check data repeteadly
while (start='1') loop
data_rx_ddf; -- procedure of interest
-- Reset signals
lf_byte_cnt <= (others => '0');
lf_total_byte_cnt <= (others =>'0');
lf_num <= (others => '0');
jf_rx_mtu <= (others => '0');
end loop;
wait;
else
wait; -- Do nothing in case of errors
end if;
end process rx_tx;