XST errors out with the following error message when synthesizing constants as shown below. Why?
"ERROR:Xst - CheckCondition - Xst_HdlConst_Utility::ConvertIntegerToType : unable to adjust constant <'S'> (type char) to type enum (0, R, W, S, )."
CONSTANT my_testA : Register_Definition := ( 16#00# /2 , "SSSSSSSSSSSSSSSS", "0000000000000001");
CONSTANT my_testB : Register_Definition := ( 16#02# /2 , "SSSSSSSSSSSSSSSS", "0000000000000010");
CONSTANT my_testC : Register_Definition := ( 16#04# /2 , "SSSSSSSSSSSSSSSS", "0000000000000000");
with
subtype MCU_Bus_Add_Type is std_logic_vector(15 downto 0);
type Register_Bit is ('0','R','W','S'); -- '0' -> Reserved , 'R' -> Read Only , 'W' -> Write Only, 'S' -> Standard (Read/Write)
type Register_Bit_Vector is array (NATURAL range <>) of Register_Bit;
type Register_Definition is record
Address : Integer;
Access_Type : Register_Bit_Vector(MCU_Bus_Data_Type'Range);
Reset : MCU_Bus_Data_Type;
end record;
This issue is fixed in the 9.2i Service Pack, available at:
http://www.xilinx.com/xlnx/xil_sw_updates_home.jsp
The first service pack containing the fix is 9.2i Service Pack 2.
To work around the problem, use the syntax below:
CONSTANT my_testA : Register_Definition := ( 16#00# /2 , 'S'&'S'&'S'&'S'&'S'&'S'&'S'&'S'&'S'&'S'&'S'&'S'&'S'&'S'&'S'&'S', "0000000000000001");
CONSTANT my_testB : Register_Definition := ( 16#02# /2 , (others => 'S'), "0000000000000010");
CONSTANT my_testC : Register_Definition := ( 16#04# /2 ,('S','S','S','S','S','S','S','S','S','S','S','S','S','S','S','S') , "0000000000000000")