这是一个简单的实体,只是为了了解“进程”的用法
我的问题是:为什么在模拟刚开始时执行该过程?我认为当灵敏度列表中的信号发生变化时该过程会唤醒,但在此示例中,分配给信号“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