V
Ved
Guest
Hi,
I have just started using Fixed point package (fixed_pkg).
I have written a program where absolute values of elements of an array
are compared.
I get error (mentioned below) when I use "abs" operator.
When I remove abs operator, things work fine but ofcourse with
considering the signed value, which does not solve my purpose.
First I thought that it might be because of presence of ARITH and
SIGNED package and since they also have abs and > operator, so
ambiguity might be because of that. But removing those packages also
didn't help.
----Error message
** Error: : Subprogram '>' is ambiguous.
** Error: : Type error resolving infix expression ">".
--------------------------------------------------------------------------------
library WORK,IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_SIGNED.ALL;
use WORK.CONV.ALL;
use work.fixed_pkg.all; ---fixed package
type FiTYPE_IO is array(0 to N-2) of sfixed(4 downto -9);
.................
process(clock)
variable TEST: FiTYPE_IO ;
begin
if abs(TEST(j+1)) > abs(TEST(j)) then
-----Do something
else
----do something else
end if;
end process;
......................
Please give your valuable comments.
Thanks
Ved
I have just started using Fixed point package (fixed_pkg).
I have written a program where absolute values of elements of an array
are compared.
I get error (mentioned below) when I use "abs" operator.
When I remove abs operator, things work fine but ofcourse with
considering the signed value, which does not solve my purpose.
First I thought that it might be because of presence of ARITH and
SIGNED package and since they also have abs and > operator, so
ambiguity might be because of that. But removing those packages also
didn't help.
----Error message
** Error: : Subprogram '>' is ambiguous.
** Error: : Type error resolving infix expression ">".
--------------------------------------------------------------------------------
library WORK,IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_SIGNED.ALL;
use WORK.CONV.ALL;
use work.fixed_pkg.all; ---fixed package
type FiTYPE_IO is array(0 to N-2) of sfixed(4 downto -9);
.................
process(clock)
variable TEST: FiTYPE_IO ;
begin
if abs(TEST(j+1)) > abs(TEST(j)) then
-----Do something
else
----do something else
end if;
end process;
......................
Please give your valuable comments.
Thanks
Ved