What is the 'standard' way to convert an std_logic_vector value into character type? It seems that first I convert it to an integer and then to character using the ASCII table. However, I am not sure how to do this in code.
Also, what is the 'standard' way to do the reverse conversion from character to std_logic_vector?
Some answers on the internet are quite old. This question is about the current form of the VHDL language and its libraries.
function to_string (inp: std_logic_vector) return string is variable image_str: string (1 to inp'length); alias input_str: std_logic_vector (1 to inp'length) is inp; begin for i in input_str'range loop image_str(i) := character'VALUE(std_ulogic'IMAGE(input_str(i))); end loop; return image_str; end function;
\$\endgroup\$