Hi,
I defined an enumeration type ("reg") in a package header:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
... 
...
type reg is (R0, R1, R2, R3);

...and a conversion function which converts type "std_logic_vector" to
my type "reg":
function CONVTOREG (DATA :std_logic_vector) return reg; 
In the body of the package I have the corresponding implementation of
this conversion function:
function CONVTOREG (DATA :std_logic_vector) return reg IS
variable result :integer;
begin
result := CONV_INTEGER(unsigned(DATA));
return reg'VAL(result);
end function; 
This works fine. Now I need another conversion function which converts
the type "reg" back to std_logic_vector" which is declared like this:
function CONV_REG_TO_STDLV (DATA :reg) return std_logic_vector; 
But I don't know how to implement that since there is no type conversion
which accepts my enumeration type. Has anybody an idea how to do that?
Thanks a lot!
Best regards.
M.R.