我正在尝试创建一个实体来填充来自信号的数组,但我得到了以下错误: near text "=“期望"(”或“‘”或“”。“
这是我的vhdl代码
library ieee;
use ieee.std_logic_1164.all;
library work;
use work.all;
entity decryptionarray is
port(
clk: in std_logic;
key_in: in std_logic_vector(7 downto 0);
encrypted_data : in std_logic_vector(127 downto 0);
encrypted_data_in : in std_logic_vector(127 downto 0);
decryption_key: out std_logic_vector(7 downto 0)
);
end entity decryptionarray;
architecture bhv of decryptionarray is
type deckeyarray is array (0 to 10) of std_logic_vector(127 downto 0);
signal dkey, keyin : std_logic_vector(7 downto 0);
signal edatain, edata : std_logic_vector(127 downto 0);
begin
P0:process(clk) is
begin
if(deckeyarray(10)/=null) then
for j in 0 to 10 loop
deckeyarray(j)=null;
end loop;
else
keyin <= key_in;
edata <= encrypted_data;
edatain <= encrypted_data_in ;
dkey <= decryption_key ;
end if;
end process P0;
end architecture bhv; 发布于 2016-05-10 17:28:02
VHDL语言不像deckeyarray(10)/=null那样具有与null的可比性,deckeyarray是一种类型,而不是一种信号。
要检查所有0,您可以执行以下操作:
use ieee.numeric_std.all;
...
type deckeyarray_t is array (0 to 10) of std_logic_vector(127 downto 0);
signal deckeyarray : deckeyarray_t;
...
if unsigned(deckeyarray(10)) = 0 then也可以在不使用unsigned和numeric_std的情况下进行比较,而是使用deckeyarray(10) = (deckeyarray(10)'range => '0')。
要填充所有0,您可以执行以下操作:
deckeyarray(j) <= (others => '0');请注意,在dkey <= decryption_key;中读取decryption_key输出端口,这是没有意义的。
https://stackoverflow.com/questions/37134303
复制相似问题