我有以下代码(简化):转换和调整矢量
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
use ieee.std_logic_arith.all;
entity foo is
end entity;
architecture fum of foo is
signal slv16 : STD_LOGIC_VECTOR(15 DOWNTO 0);
signal slv5 : STD_LOGIC_VECTOR(7 DOWNTO 0);
begin
slv16 <= std_logic_vector(resize(unsigned(slv5), slv16'length));
end architecture;
我得到的错误消息“调整大小”无法被匹配到一个子程序。为什么?
我不知道。我没有看到任何错误。我已经在3种不同的模拟器上试过了,他们也认为它也可以:https://www.edaplayground.com/x/pRr。你在用什么模拟器? –
显示完整的错误信息和任何警告,这些警告也会指示该工具。调整大小[无符号,自然返回无符号]在程序包numeric_std中声明。 – user1155120
GHDL('ghdl -a --std = 08 --ieee = standard')或Mentor Graphics Modelsim('vcom -2008')没有错误。 –