"Dkthechamp" <> a écrit dans le message de news:
om...
> Hi,
> i am trying to read a txt file with binary strings as content but the
> snippet written below reads only one line, wheras the txt file has
> many entries. The "output" is of type std_logic_vector with the same
> length of 's'.
>
> Thanks in advance.
> DK
>
> -- snippet
you forget a WAIT statement in the while loop so
the whole file is read at the same time instant.
Try the following code
FILE inFile : TEXT open read_mode is "tb.txt";
VARIABLE inLine : LINE;
VARIABLE s : std_logic_vector(159 downto 0);
begin
while (not endfile(inFile)) loop
readline(inFile, inLine);
read(inLine,s);
output <= s after 10 ns;
wait for clk'event and clk = '1' ;
end loop;
wait;
end