shaiko
Advanced Member level 5
Hello,
My entity's "generic" section has a set of 5 enabling configurations (that are concatenated into a vector ) - as follows:
The function marked in red shall return the Hex value of "concatenated_enables" in a string format.
For example:
if
enable_4 = '1' ;
enable_3 = '1' ;
enable_2 = '1' ;
enable_1 = '0' ;
enable_0 = '0' ;
so
configuration_sting = "FC"
if
enable_4 = '0' ;
enable_3 = '1' ;
enable_2 = '1' ;
enable_1 = '0' ;
enable_0 = '0' ;
configuration_sting = "0C"
My entity's "generic" section has a set of 5 enabling configurations (that are concatenated into a vector ) - as follows:
Code:
entity some_entity is
generic
(
enable_0 : std_logic ;
enable_1 : std_logic ;
enable_2 : std_logic ;
enable_3 : std_logic ;
enable_4 : std_logic ;
)
port
(
...
) ;
end entity some_entity ;
architecture rtl_some_entity is
constant concatenated_enables : std_logic_vector ( 4 downto 0 ) := enable_4 & enable_3 & enable_2 & enable_1 & enable_0 ;
constant configuration_sting : string := [COLOR="#FF0000"]std_logic_vector_to_string [/COLOR](concatenated_enables ) ;
begin
...
end architecture rtl_some_entity ;
The function marked in red shall return the Hex value of "concatenated_enables" in a string format.
For example:
if
enable_4 = '1' ;
enable_3 = '1' ;
enable_2 = '1' ;
enable_1 = '0' ;
enable_0 = '0' ;
so
configuration_sting = "FC"
if
enable_4 = '0' ;
enable_3 = '1' ;
enable_2 = '1' ;
enable_1 = '0' ;
enable_0 = '0' ;
configuration_sting = "0C"