\$\begingroup\$
\$\endgroup\$
2
I have an 8-bit std_logic_vector and I would like to print its value (during simulation) as a 2-digit hexadecimal value.
Current code:
report "Entity: data_in=" & integer'image(to_integer(unsigned(data_in)));
Current output:
Entity: data_in=16
Desired output:
Entity: data_in=10h
What would be the most painless way to achieve this?
asked Oct 18, 2017 at 13:34
-
\$\begingroup\$ See my answer here electronics.stackexchange.com/questions/329699/… \$\endgroup\$ks0ze– ks0ze2017年10月18日 14:40:08 +00:00Commented Oct 18, 2017 at 14:40
-
\$\begingroup\$ I wish there was something like cplusplus.com/reference for VHDL :) \$\endgroup\$minexew– minexew2017年10月19日 06:46:06 +00:00Commented Oct 19, 2017 at 6:46
1 Answer 1
\$\begingroup\$
\$\endgroup\$
In VHDL-2008, one can use:
report "Entity: data_in=" & to_hstring(data_in) & "h";
answered Nov 9, 2017 at 16:26
lang-vhdl