Using data type conversion blocks to convert between enumeration and integer types is not currently support for HDL Coder.
As a workaround, you may use the following:
1) Enumeration to integer: Use a multiport switch or use a MATLAB Function block with a switch statement, as shown in the attached model
2) Integer to enumeration: Use a selector block or use a MATLAB Function block with a switch statement, as shown in the attached model.
Please note that there is not one accepted approach, and each approach will generate slightly different HDL code. Therefore, please choose the option that best suits your modeling needs in Simulink.
Finally, please note that enumerations have further limitations when used with HDL Coder, as described here: