VHDL and .txt

Discussion in 'VHDL' started by strykaar, Sep 14, 2006.

  1. strykaar

    strykaar

    Joined:
    Aug 28, 2006
    Messages:
    3
    Hi All

    I am trying to read and write(after modifying) some data from/to a text file and I am using the below program. I am using Xilinx ISE 8.2i, when I synthesize it, i am getting the error that the "File <infile> does not exist.", Please help me as I am unable to remove the error.


    library ieee;
    use ieee.std_logic_1164.all;
    use ieee.std_logic_textio.all;
    USE std.TEXTIO.ALL;
    ENTITY square IS
    PORT( go : IN std_logic);
    END square;
    ARCHITECTURE simple OF square IS
    BEGIN
    PROCESS(go)
    FILE infile : TEXT IS IN "C:\infile.txt";
    FILE outfile : TEXT IS OUT "C:\outfile.txt";
    VARIABLE out_line, my_line : LINE;
    VARIABLE int_val : INTEGER;
    BEGIN
    WHILE NOT( ENDFILE(infile)) LOOP
    -- read a line from the input file
    READLINE( infile, my_line);
    -- read a value from the line
    READ( my_line, int_val);
    -- square the value
    int_val := int_val **2;
    -- write the squared value to the line
    WRITE( out_line, int_val);
    -- write the line to the output file
    WRITELINE( outfile, out_line);
    END LOOP;
    END PROCESS;
    END simple;

    Thanks

    Sandeep
     
    strykaar, Sep 14, 2006
    #1
    1. Advertising

  2. strykaar

    Adrian Jongenelen

    Joined:
    Sep 27, 2006
    Messages:
    5
    Location:
    Wellington, New Zealand
    It is my understanding that text io can't actually be synthesized.

    If this is for a testbench it would (should) work fine, but with Xilinx ISE8.2 the source should not be under the 'Synthesis/Implementation' tab.
     
    Adrian Jongenelen, Sep 27, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ronny Hengst

    VHDL and .txt

    Ronny Hengst, Jun 24, 2003, in forum: VHDL
    Replies:
    5
    Views:
    17,238
    Jim Lewis
    Jun 26, 2003
  2. walala
    Replies:
    3
    Views:
    4,809
    walala
    Sep 18, 2003
  3. Sameen
    Replies:
    2
    Views:
    447
    Victor Bazarov
    Aug 29, 2005
  4. afd
    Replies:
    1
    Views:
    8,365
    Colin Paul Gloster
    Mar 23, 2007
  5. Jochen Brenzlinger
    Replies:
    7
    Views:
    5,583
    Roedy Green
    Sep 15, 2011
Loading...

Share This Page