VHDL 2008引入了一个不错的功能,称为“匹配语句”。
我应该使用“大小写?”关键字还是“ case”?之间还留有空格?
我不清楚。莱迪思LSE允许两者都使用。 Synplify仅接受第一个。
标准的定义是:
case_statement ::=
[ case_label : ]
case [ ? ] expression is
case_statement_alternative
{ case_statement_alternative }
end case [ ? ] [ case_label ] ;
你是对的。还不清楚,是吗? case?
和case ?
似乎都起作用:
library IEEE;
use IEEE.std_logic_1164.all;
entity E is
end entity ;
architecture A of E is
begin
process
variable V : std_logic_vector(1 downto 0) := "00";
begin
case ? V is
when "-0" => report "even";
when "-1" => report "odd";
when others => report "others";
end case ?;
wait;
end process;
end architecture A;
案例?是关键字。没有空间。