Serwan Bamerni
Member level 2
- Joined
- Dec 21, 2014
- Messages
- 45
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 6
- Activity points
- 367
Dear EDABoard users
i want to read data in a text file and after a small processing I write the data in other text file
I wrote this code but unfortunately i got error when I synthesis it
the following error occur
line 59: Second argument of write must have a constant value.
please can any one help me in solving the problem
i want to read data in a text file and after a small processing I write the data in other text file
I wrote this code but unfortunately i got error when I synthesis it
Code dot - [expand] 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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 library IEEE; use IEEE.STD_LOGIC_1164.ALL; use STD.TEXTIO.all; use IEEE.STD_LOGIC_TEXTIO.all; ENTITY read_write_text_file_dhl IS PORT( Clock : IN STD_LOGIC); END read_write_text_file_dhl; architecture Behavioral of read_write_text_file_dhl is file read_file : text; file write_file : text; constant filename_r : string :="D:\1.txt"; constant filename_w : string :="D:\2.txt"; signal dataout: std_logic_vector(3 downto 0); begin FILE_READ : process (Clock) variable line_out : line; variable fstatus:File_open_status; variable data: std_logic_vector(3 downto 0); variable xx: std_logic := '0'; begin if (xx = '0') then -------------------------- file_open(fstatus, read_file, filename_r, read_mode); -- the file should be -- end if; -- opened one time only -- -------------------------- if rising_edge(Clock) then if (not endfile(read_file)) then readline(read_file,line_out); read(line_out, data); dataout <= data; end if; end if; xx := '1'; end process FILE_READ; ------------------------------------------------- FILE_WRITE : process (Clock) variable line_out : line; variable fstatus:File_open_status; variable zz: std_logic := '0'; begin if (zz = '0') then file_open(fstatus,write_file,filename_w,write_mode); end if; -------------------------------- if rising_edge(Clock) then write(line_out, dataout); writeline(write_file, line_out); end if; zz := '1'; end process FILE_WRITE; -------------------------------------------------- end Behavioral;
the following error occur
line 59: Second argument of write must have a constant value.
please can any one help me in solving the problem
Last edited by a moderator: