下面是我的示例:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity queue is
port(
reset: in std_logic;
input_ready: out std_logic
);
end entity;
architecture reference of queue is
signal queue_size: unsigned(15 downto 0);
begin
process
begin
input_ready <= (reset = '0') and (queue_size < 1024);
end process;
end architecture;这一行:
input_ready <= (reset = '0') and (queue_size < 1024);产生
no function declarations for operator "and"
ghdl: compilation error跑步时
ghdl -a queue.vhdl在Arch上使用GHDL 0.32rc1 (20141104) [Dunoon edition]。
根据VHDL算子,这两个比较都返回布尔值,并且有两个布尔值的and定义。那我做错什么了?
发布于 2015-03-15 23:38:40
两个子表达式(reset = '0')和(queue_size < 1024)返回一个布尔值。and运算符还返回一个布尔结果,您正试图将该结果分配给std_logic输出。
解决办法:
input_ready <= '1' when (reset = '0') and (queue_size < 1024) else '0';注:这一行不需要周围的处理。
https://stackoverflow.com/questions/29067374
复制相似问题