TB源码:
process
file input_file: text open read_mode is "E:\median_filter_test\raw_data.raw";
file output_file: text open write_mode is "E:\median_filter_test\output_tb.dat";
variable inline, outline : line;
variable input : std_logic_vector(7 downto 0);
variable output : std_logic_vector(7 downto 0);
begin
while not endfile(input_file) loop
if (reset = '1') then
data_in <= (others => '0');
else
readline(input_file, inline);
read(inline, input);
data_in <= input;
--data_valid <= '1';
output := data_out;
write(outline, output);
writeline(output_file, outline);
end if;
wait until clk = '1';
end loop;
end process;