GHDL:运算符 "and" 没有函数声明
GHDL: no function declarations for operator "and"
这是我的剥离示例:
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]
Linux。
根据 VHDL operators 两个比较 return 布尔值并且有两个布尔值的 and
定义。那我做错了什么?
两个子表达式(reset = '0')
和(queue_size < 1024)
return一个布尔值。 and
运算符还 return 一个布尔结果,您正试图将其分配给 std_logic 输出。
解决方法:
input_ready <= '1' when (reset = '0') and (queue_size < 1024) else '0';
注意:此行不需要环绕处理
这是我的剥离示例:
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]
Linux。
根据 VHDL operators 两个比较 return 布尔值并且有两个布尔值的 and
定义。那我做错了什么?
两个子表达式(reset = '0')
和(queue_size < 1024)
return一个布尔值。 and
运算符还 return 一个布尔结果,您正试图将其分配给 std_logic 输出。
解决方法:
input_ready <= '1' when (reset = '0') and (queue_size < 1024) else '0';
注意:此行不需要环绕处理