I can print an integer
as decimal to stdout with:
library std;
use std.textio.all;
entity min is
end min;
architecture behav of min is
begin
p
Assuming an integer i
, and VHDL-2008, you could use:
write(output, integer'image(i) & LF); -- Plain integer value
write(output, "0x" & to_hstring(to_signed(i, 32)) & LF); -- Hexadecimal representation
You need to have use std.textio.all;
for this to work. Change the 32
to reduce the length of the hex value. I chose 32 so that it can represent any integer value in most simulators.
These will also work for report
statements, e.g.
report "i = 0x" & to_hstring(to_signed(i, 32));