newbe: how to print integer and real numbers?

S

Schüle Daniel

Guest
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.

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


Schüle Daniel wrote:
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.

--
Daniel
 
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
 
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
 
Amal schrieb:
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


--
Daniel
 

Welcome to EDABoard.com

Sponsor

Back
Top