Respected Sir,
This was the error message procured by me while synthesizing the code.............. pls do the needful as early as possible........
ERROR:Xst:769 - "C:/adpcm2/HD_ADPCM_Codec.vhd" line 944: Operator <DIVIDE> must have constant operands or first operand must be power of 2 ERROR: XST failed
pls do the needful in this matter
This was for this code part
process(CLOCK_IN, ACTIVE_IN) variable Last_PCM_Data : integer range -32767 to 32768; variable PCM_Data : integer range 0 to 65535; variable PCM_Data_Difference : integer range -32767 to 32768; variable ADPCM_Decoder_Step_Size_Table_Pointer : integer range 0 to 1000; variable ADPCM_Decoder_State_Counter : integer range 0 to 5;
begin
if rising_edge(CLOCK_IN) then
if Active_Module = not ACTIVE_IN then
case ADPCM_Decoder_State_Counter is
when 0 =>
PCM_Data_Difference := (ADPCM_Decoder_Step_Size_Table_Pointer * ADPCM_Decoder_Step_Size_Table_Pointer) /100;
when 1 =>
if Last_ADPCM_Data = ADPCM_DATA_IN then
if ADPCM_Decoder_Step_Size_Table_Pointer < 1000 then
ADPCM_Decoder_Step_Size_Table_Pointer := ADPCM_Decoder_Step_Size_Table_Pointer + 1;
end if;
else
if ADPCM_Decoder_Step_Size_Table_Pointer > 0 then
ADPCM_Decoder_Step_Size_Table_Pointer := ADPCM_Decoder_Step_Size_Table_Pointer - 1;
end if;
end if;
when 2 =>
Last_ADPCM_Data <= ADPCM_DATA_IN;
if ADPCM_DATA_IN = '1' then
Last_PCM_Data := Last_PCM_Data - PCM_Data_Difference;
else
Last_PCM_Data := Last_PCM_Data + PCM_Data_Difference;
end if;
when 3 =>
PCM_Data := Last_PCM_Data;
when 4 =>
for i in 15 downto 0 loop
if PCM_Data > PCM_Data_Converter(i) then
PCM_Data := PCM_Data - PCM_Data_Converter(i);
PCM_DATA_OUT(i) <= '1';
else
PCM_DATA_OUT(i) <= '0';
end if;
end loop;
when others => null;
end case;
if ADPCM_Decoder_State_Counter = 5 then
ADPCM_Decoder_State_Counter := 0;
Active_Module <= ACTIVE_IN;
else
ADPCM_Decoder_State_Counter := ADPCM_Decoder_State_Counter + 1;
end if;
end if;
end if;
end process;
end HD_ADPCM_Codec_Function;
This was for this code part
in the decoder section
for this statement
PCM_Data_Difference := (ADPCM_Decoder_Step_Size_Table_Pointer * ADPCM_Decoder_Step_Size_Table_Pointer) /100;
Dear kushal,
The code is provided in Quartus-II IDE and it works fine. Cyclone-II has enough multipliers to do the mathematics and VHDL compiler accepts this type of mathematical operations as well.
It seems you are trying to synthesis the code in ISE IDE and it reports you this message:
ERROR:Xst:769 - "C:/adpcm2/HD_ADPCM_Codec.vhd" line 944: Operator must have constant operands or first operand must be power of 2
You are getting this error message because of VHDL compiler limitations on division operator. this issue is still active in Xilinx web answer since 11/14/2007 :
<a href="http://www.xilinx.com/support/answers/13492.htm">ERROR:Xst:769</a>
As you can see the formula, the first operand can not be constant and can not be also power of 2.
I think you can get rid of this issue by Google search and exploring relevant forums.