J
jens
Guest
The code listed below yields the following errors in ModelSim:
Ambiguous type in infix expression; ieee.numeric_std.unsigned or
work.test_package.unsigned8_array.
Illegal type conversion to ieee.numeric_std.signed (operand type is
not known).
The original code does something a little more useful, I just whittled
it down. Commenting out the seemingly unrelated type definition fixes
the problem, as does changing the typedef to a signed array. Moving
the "000" outside of the type conversion also works ("000" &
signed(...)). Various other attempts to remove the error typically
didn't work (including using a type qualifier for the "000").
In the meantime I've avoided the problem by using shift_left, but it
seems like there's nothing ambiguous here and that it should work.
Note that nothing's actually using the typedef. Any ideas?
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
package test_package is
type unsigned8_array is array (natural range <>
of unsigned(7
downto 0); -- here's what causes the error
end package test_package;
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
library work;
use work.test_package.all;
entity test is
port
(
input_unsigned: in unsigned(15 downto 0);
output_signed: out signed(15 downto 0)
);
end entity test;
architecture arch of test is
begin
output_signed <= signed("000" & input_unsigned(15 downto 3)); --
this is the line with the error
end architecture arch;
Ambiguous type in infix expression; ieee.numeric_std.unsigned or
work.test_package.unsigned8_array.
Illegal type conversion to ieee.numeric_std.signed (operand type is
not known).
The original code does something a little more useful, I just whittled
it down. Commenting out the seemingly unrelated type definition fixes
the problem, as does changing the typedef to a signed array. Moving
the "000" outside of the type conversion also works ("000" &
signed(...)). Various other attempts to remove the error typically
didn't work (including using a type qualifier for the "000").
In the meantime I've avoided the problem by using shift_left, but it
seems like there's nothing ambiguous here and that it should work.
Note that nothing's actually using the typedef. Any ideas?
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
package test_package is
type unsigned8_array is array (natural range <>
downto 0); -- here's what causes the error
end package test_package;
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
library work;
use work.test_package.all;
entity test is
port
(
input_unsigned: in unsigned(15 downto 0);
output_signed: out signed(15 downto 0)
);
end entity test;
architecture arch of test is
begin
output_signed <= signed("000" & input_unsigned(15 downto 3)); --
this is the line with the error
end architecture arch;