Writing hexadecimal to file

  • Thread starter Ralf Hildebrandt
  • Start date
R

Ralf Hildebrandt

I want to write the hexadecimal representation of
a 64bit vector into a file. Which library do I have to use ?

Did you try the stdio_h from <http://bear.ces.cwru.edu/vhdl/>? This
library offers C-like file I/O. If you trap into conversion problems,
you could split the vector into smaller groups and convert them.

Ralf
 
A

ALuPin

Hi newsgroup,


I want to write the hexadecimal representation of
a 64bit vector into a file. Which library do I have to use ?

The "std_textio" library does not seem to have a write function
for std_logic_vector, so I use "std_logic_textio" as overload
library. But how can I write the contents as hexadecimal format ?

Thank you for your opinion.



signal data64b : std_logic_vector(63 downto 0);

process(clk)
file F : text;
variable L : line;
begin
if rising_edge(clk) then
...
if ls_store='1' then
write(L, data64b);
writeline(F,L);
end if;
end process;
 
M

Mike Treseler

Hi newsgroup,


I want to write the hexadecimal representation of
a 64bit vector into a file. Which library do I have to use ?

use ieee.std_logic_1164.all;
...
constant baz:std_logic_vector(63 downto 0):=x"aaaabbbbccccdddd";


-- Mike Treseler
 
J

Jim Lewis

Use hwrite :)

Current limitations are that your array must have a
multiple of 4 bits in it - which yours does. If not
it is trivial to manually extend it.

std_logic_textio is not a standard yet. it was donated
to ieee. Updates were made as part of Accellera VHDL 3.0
standard (July 2006).

Cheers,
Jim
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top