1

这是一个简单的实体,只是为了了解“进程”的用法

我的问题是:为什么在模拟刚开始时执行该过程?我认为当灵敏度列表中的信号发生变化时该过程会唤醒,但在此示例中,分配给信号“a”的时间是在模拟开始后 3ns。

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;  
use ieee.numeric_std.all;         
use ieee.math_real.all;           

entity test4 is
    port (
        a : in bit;
        f : out bit
    );

end test4;

architecture test4_arc of test4 is
    signal b : bit;
begin

    process(a)
    begin
        report "process triggered";
        
        b <= a;
        f <= not a;
    end process;

end test4_arc;

这是测试台

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use std.textio.all;
use ieee.std_logic_textio.all;
-----------------------------------------------------------
entity test4tb is
end entity ;
-----------------------------------------------------------
architecture testbench of test4tb  is

   component test4
    port (
        a : in bit;
        f : out bit
    );
   end component;

signal atest,ftest : bit;

begin
    -----------------------------------------------------------
    process
    begin
        wait for 3ns;
        atest <= '0';
        wait for 5ns;
        atest <= '1';
        wait for 5ns;
    end process ;

    dut : test4 port map (
        a => atest,
        f => ftest
    );

end architecture testbench;

来自 Modelsim 控​​制台的消息

# ** Note: process triggered
#    Time: 0 ns  Iteration: 0  Instance: /test4tb/dut
# ** Note: process triggered
#    Time: 8 ns  Iteration: 1  Instance: /test4tb/dut
# ** Note: process triggered
#    Time: 16 ns  Iteration: 1  Instance: /test4tb/dut
# ** Note: process triggered

在此处输入图像描述

4

1 回答 1

2

所有进程将在时间 0 处至少执行一次。process假设具有敏感度列表的Await on <list>作为进程中的最后一条语句。您可以在VHDL LRM 第 11.3 节流程声明中阅读此内容:

如果在保留字 process 之后出现进程敏感度列表,则假定进程语句包含隐式等待语句作为进程语句部分的最后一条语句;这个隐式等待语句的形式是

wait on sensitivity_list;

在 LRM 第14.7.5.2 节初始化中进一步:

f) 对于模型中的每个非延迟进程 P,以下动作按指示的顺序发生: 1) 进程执行直到它挂起。

因此,所有进程将一直运行,直到它们在模拟的第一个增量周期中首次挂起。因为进程实际上是无限循环,所以它们必须从某个地方开始。

于 2022-01-06T13:25:02.820 回答