newbe: how to print integer and real numbers?

  • Thread starter =?ISO-8859-1?Q?Sch=FCle_Daniel?=
  • Start date
?

=?ISO-8859-1?Q?Sch=FCle_Daniel?=

Hello,

quick question
I am simulating some simple VHDL code and need to
print integer and real variables.
Can someone give me examples or introduction pages to
basic IO in VHDL?
What I am also looking for is, kind of table
what type conversion function are provided and what are not
provided.

Thx in advance.
 
D

dipesh.trivedi

Hi Daniel.
i think that you can do it by using textIO statements. try this i hope
it will work.
 
R

Ralf Hildebrandt

Schüle Daniel wrote:

I am simulating some simple VHDL code and need to
print integer and real variables.
Can someone give me examples or introduction pages to
basic IO in VHDL?


Have a look into the package std.textio and see the available functions.
See, which parameters can be given to the available functions.

If you want to have ANSI C like text-I/O, have a look at
http://bear.ces.cwru.edu/vhdl/ Note that there is also a paper
describing the files.

Ralf
 
A

Amal

Include STD.textio.all and use the image attribute to convert from
real/integer to string.

process
variable l : line;
variable r : real;
variable i : integer;
begin
-- real
write( l, real'image(r) );
writeline( output, l );

-- integer
write( l, integer'image(i) );
writeline( output, l );
end process;

-- Amal
 
?

=?ISO-8859-1?Q?Sch=FCle_Daniel?=

Amal said:
Include STD.textio.all and use the image attribute to convert from
real/integer to string.

process
variable l : line;
variable r : real;
variable i : integer;
begin
-- real
write( l, real'image(r) );
writeline( output, l );

-- integer
write( l, integer'image(i) );
writeline( output, l );
end process;

thx, this is what i was looking for
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top