![]() |
|
|
|||||||
![]() |
VHDL - newbe: how to print integer and real numbers? |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
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 =?ISO-8859-1?Q?Sch=FCle_Daniel?= |
|
|
|
|
#2 |
|
Posts: n/a
|
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 |
|
|
|
#3 |
|
Posts: n/a
|
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 |
|
|
|
#4 |
|
Posts: n/a
|
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 |
|
|
|
#5 |
|
Posts: n/a
|
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 |
|