Read some hex value in a file for test bench

Discussion in 'VHDL' started by Teten, Sep 3, 2005.

  1. Teten

    Teten Guest

    Hi,

    I have a file which contain a lot of hex values 0x47 0x20 0x57 . . . .

    I mus program a testbench which read these values to inject them in a
    vhdl module (to validate it).

    I use the textio package without any good results.

    It is the fist time that i use it and have some difficulties.

    Can you help me ?

    I thank you a lot !

    Teten

    -- my source code which may that (no correct functionning ...)

    PROCESS
    FILE fichier : text IS IN fichier_TS_in;

    VARIABLE ligne : line;
    VARIABLE data_int : STD_LOGIC_VECTOR(7 downto 0);
    VARIABLE good: boolean; -- Status of the read operations
    BEGIN


    WHILE NOT ENDFILE(fichier) LOOP

    readline(fichier, ligne); -- ouverture du fichier ts
    hread(ligne,data_int,good); -- Read the B argumen
    WHILE good LOOP
    WAIT UNTIL rising_edge(CLK_TS); -- pour synchroniser
    DATA_TS <= data_int;
    hread(ligne,data_int,good);
    END LOOP;
    END LOOP;
    END PROCESS;
     
    Teten, Sep 3, 2005
    #1
    1. Advertisements

  2. Teten

    Ajeetha Guest

    Hi,
    What exactly is the problem here? Do you get wrong values being read
    in? Do you see a crash? Please explain and if you like, send me a
    working code (with sample text file) via email @ gmail.com @ ajeetha.

    Good Luck
    www.noveldv.com
     
    Ajeetha, Sep 3, 2005
    #2
    1. Advertisements

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. Joseph A. Zammit

    Xilinx test bench and user group

    Joseph A. Zammit, Feb 25, 2004, in forum: VHDL
    Replies:
    3
    Views:
    2,321
  2. Pete Fraser
    Replies:
    4
    Views:
    7,935
    Mike Treseler
    Nov 4, 2004
  3. Replies:
    10
    Views:
    7,188
    Neredbojias
    Aug 19, 2005
  4. Bengt Richter
    Replies:
    6
    Views:
    792
    Juha Autero
    Aug 19, 2003
  5. jack
    Replies:
    4
    Views:
    885
  6. tim

    hex string to hex value

    tim, Nov 22, 2005, in forum: Python
    Replies:
    8
    Views:
    21,144
  7. tim
    Replies:
    2
    Views:
    1,789
    Dennis Lee Bieber
    Nov 23, 2005
  8. janaka
    Replies:
    1
    Views:
    1,066
    veevee1
    Sep 28, 2007
Loading...