This is a simple entity just to know the usage of "process"
My question is: Why the process is executed when the simulation just starts? I think the process wakes up when the signals in the sensitivity list change, but in this example, the assignment to signal 'a' is 3ns after the simulation starts.
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;
Here is the testbench
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;
message from console of 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