VHDL 中块和进程语句之间的区别



我最近遇到了一个关于VHDL块和进程结构的问题,但在教科书或互联网论坛上找不到任何解释。
下面代码中的块和进程语句之间有什么区别吗?

library IEEE;
use IEEE.std_logic_1164.all;
entity example is
port ( a, b, clock : in  std_logic;
c           : out std_logic);
end entity;
architecture rtl of example is
begin
test_block : block (clock'event and clock = '1')
begin
c <= guarded a and b;
end block test;
end rtl;

library IEEE;
use IEEE.std_logic_1164.all;
entity example is
port ( a, b, clock : in  std_logic;
c           : out std_logic);
end entity;
architecture rtl of example is
begin
test_proc : process (clock)
begin
if (clock'event and clock = '1') then
c <= a and b;
end if;
end process test_proc;
end rtl;

主要区别在于关键字guarded.如果你在没有它的情况下编写代码,整个逻辑将是规则的组合。所以,我想,如果你想用一些顺序逻辑编写大部分并发代码,你可以小心使用block语句,当顺序需要使用guarded。我问过在FPGA设计方面拥有丰富背景的同事,他们说block有点不合时宜,几乎没有人使用它,但它仍然是标准,为设计人员提供了一些选择。

最新更新