use std.textio.all; entity tb is end; architecture arch of tb is file oFile : text open write_mode is "output.txt"; file iFile_a : text open read_mode is "input_a.txt"; file iFile_b : text open read_mode is "input_b.txt"; begin process variable a,b,c : integer :=0; variable oLine : line; variable iLine : line; begin while not(endfile(iFile_a)) loop readline(iFile_a, iLine); read (iLine, a); c:=0; while not(endfile(iFile_b)) loop readline(iFile_b, iLine); read (iLine, b); c:= c + (a * b); end loop; file_close(iFile_b); file_open(iFile_b,"input_b.txt", read_mode); write(oLine, c); writeline(oFile,oLine); end loop; file_close(iFile_a); file_close(iFile_b); file_close(oFile); wait; end process; end;