티스토리 뷰

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' 카테고리의 다른 글

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
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/03   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
글 보관함