티스토리 뷰

DigitalFactory

VHDL file I/O

산들바람 2009.12.17 20:07
library
Use std.textio.all;

routines
read( )
readline( )
write( )
writeline( )



examples
read_ex : process
file my_file           : text is in "./reading.txt";
variable text_line  : line;
variable tmp        : bit_vector(15 downto 0);
begin
  while not endfile(my_file) loop
    readline(my_file, text_line);
    read(text_line, tmp);
    wait until clk = '0';
  end loop;
end process;

read_ex2 : process(clk)
file my_life           : text is in "./reading.txt";
variable text_line   : line;
variable tmp         : bit_vector(15 downto 0);
begin
  if(clk = '1' and clk'event) then
    readline(my_file, text_line);
    read(text_line, tmp);
  end if;
end process;


write_ex : process(clk)
file my_file          : text is out "./writing,txt";
variable text_line  : line;
begin
  if(clk = '1' and clk'event) then
    write(text_line, integer'(conv_integer(out_data)));
    write(my_file, text_line);
  end if;
end process;

'DigitalFactory' 카테고리의 다른 글

VHDL file I/O  (0) 2009.12.17
Published  (0) 2009.05.06
1st Step  (0) 2009.04.06
SCI, SCIE journal 검색  (0) 2009.04.06
SCI impact factor 검색  (0) 2009.04.05
내 생애 첫 MPW  (6) 2009.01.13
댓글
댓글쓰기 폼