Writing hexadecimal to file

A

ALuPin@web.de

Guest
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;
 
ALuPin@web.de schrieb:


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
 
ALuPin@web.de wrote:
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
 
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

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;
 
<ALuPin@web.de> wrote in message
news:1173196813.034393.288530@30g2000cwc.googlegroups.com...
Hi newsgroup,


I want to write the hexadecimal representation of
a 64bit vector into a file. Which library do I have to use ?
Google the following...
http://www.google.com/search?hl=en&q=Image_Pkg+%22Ben+Cohen%22

And the first hit will be
http://members.aol.com/vhdlcohen/vhdl/vhdlcode/image_pb.vhd

You want the 'heximage' function.

Kevin Jennings
 

Welcome to EDABoard.com

Sponsor

Back
Top