S
sps
Guest
Hello ppl,
I was trying to synthesize this function with XST
It gives the following error...Can anybody suggest some changes
*********************
'Return' statement must be the last statement in a function.
***********************
The Function is :
************************************************************************
function GetCategory (Coef : in std_logic_vector) return integer is
variable Coeff : std_logic_vector(Coef'High downto 0);
begin
if Coef(Coef'High) = '1' then
Coeff := (not Coef) + 1;
else
Coeff := Coef;
end if;
for index in Coeff'range loop
if Coeff(index) = '1' then
return(index + 1);
end if;
end loop;
return 0;
end GetCategory;
**************************************************************************
Thanx
I was trying to synthesize this function with XST
It gives the following error...Can anybody suggest some changes
*********************
'Return' statement must be the last statement in a function.
***********************
The Function is :
************************************************************************
function GetCategory (Coef : in std_logic_vector) return integer is
variable Coeff : std_logic_vector(Coef'High downto 0);
begin
if Coef(Coef'High) = '1' then
Coeff := (not Coef) + 1;
else
Coeff := Coef;
end if;
for index in Coeff'range loop
if Coeff(index) = '1' then
return(index + 1);
end if;
end loop;
return 0;
end GetCategory;
**************************************************************************
Thanx