我有以下代碼(簡化):轉換和調整矢量
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')沒有錯誤。 –