情况? VHDL2008匹配案例声明

问题描述 投票:-1回答:2

VHDL 2008引入了一个不错的功能,称为“匹配语句”。

我应该使用“大小写?”关键字还是“ case”?之间还留有空格?

我不清楚。莱迪思LSE允许两者都使用。 Synplify仅接受第一个。

标准的定义是:

case_statement ::=
    [ case_label : ]
    case [ ? ] expression is
        case_statement_alternative
        { case_statement_alternative }
    end case [ ? ] [ case_label ] ;
syntax vhdl
2个回答
1
投票

你是对的。还不清楚,是吗? 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;

https://www.edaplayground.com/x/4xD9


0
投票

案例?是关键字。没有空间。

© www.soinside.com 2019 - 2024. All rights reserved.