Re: Writing Hex values to file in VHDL?

Discussion in 'VHDL' started by backhus, Mar 23, 2010.

  1. backhus

    backhus Guest

    On 23 Mrz., 02:10, "Pete Fraser" <> wrote:
    > I'm trying to dump eight hex values per line
    > into a file, and can't work out how to do it.
    >
    >    for index in 0 to 127 loop
    >     for sample_sel in 0 to 7 loop
    >      sample_val := integer(scale * sin(phase(sample_sel)));
    >      write ( sample_line, sample_val, RIGHT, 10);
    >      phase(sample_sel) := phase(sample_sel) + phase_inc(sample_sel);
    >     end loop;
    >     writeline ( ip_dat, sample_line );
    >    end loop;
    >
    > does what I want, but with decimal values.
    >
    > If I change to:
    > hwrite ( sample_line, sample_val, RIGHT, 10);
    > or:
    > write ( sample_line, to_hstring(sample_val), RIGHT, 10);
    > it doesn't compile.
    >
    > Any thoughts?
    >
    > Thanks
    >
    > Pete


    Hi Peter,
    which simulator do you use?
    Probably the compile options are set to some old VHDL standard or you
    are using wrong or outdated libraries for the functions you intend to
    use.
    Maybe this link is helpful too:

    http://eesun.free.fr/DOC/vhdlref/re...s/reading_and_writing_files_with_text_i_o.htm

    Have a nice simulation
    Eilert
    backhus, Mar 23, 2010
    #1
    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. Replies:
    10
    Views:
    6,134
    Neredbojias
    Aug 19, 2005
  2. Bengt Richter
    Replies:
    6
    Views:
    448
    Juha Autero
    Aug 19, 2003
  3. he
    Replies:
    0
    Views:
    955
  4. Magne Munkejord

    Re: Writing Hex values to file in VHDL?

    Magne Munkejord, Mar 23, 2010, in forum: VHDL
    Replies:
    1
    Views:
    3,279
    Magne Munkejord
    Mar 23, 2010
  5. Tricky
    Replies:
    0
    Views:
    1,299
    Tricky
    Mar 23, 2010
Loading...

Share This Page