Hi
Simulating the following block of code:
fork
begin
repeat(4) begin
#1;
`uvm_info("Test", $sformatf("seq_1.start"), UVM_LOW)
end
end
begin
repeat(4) begin
#2;
`uvm_info("Test", $sformatf("seq_2.start"), UVM_LOW)
end
end
begin
repeat(4) begin
#3;
`uvm_info("Test", $sformatf("seq_3.start"), UVM_LOW)
end
end
begin
repeat(4) begin
#4;
`uvm_info("Test", $sformatf("seq_4.start"), UVM_LOW)
end
end
join
I got the following output results:
# UVM_INFO top.sv(226) @ 1: uvm_test_top.m_sequencer@@m_seq [Test] seq_1.start
# UVM_INFO top.sv(232) @ 2: uvm_test_top.m_sequencer@@m_seq [Test] seq_2.start
# UVM_INFO top.sv(226) @ 2: uvm_test_top.m_sequencer@@m_seq [Test] seq_1.start
# UVM_INFO top.sv(238) @ 3: uvm_test_top.m_sequencer@@m_seq [Test] seq_3.start
# UVM_INFO top.sv(226) @ 3: uvm_test_top.m_sequencer@@m_seq [Test] seq_1.start
# UVM_INFO top.sv(244) @ 4: uvm_test_top.m_sequencer@@m_seq [Test] seq_4.start
# UVM_INFO top.sv(232) @ 4: uvm_test_top.m_sequencer@@m_seq [Test] seq_2.start
# UVM_INFO top.sv(226) @ 4: uvm_test_top.m_sequencer@@m_seq [Test] seq_1.start
# UVM_INFO top.sv(238) @ 6: uvm_test_top.m_sequencer@@m_seq [Test] seq_3.start
# UVM_INFO top.sv(232) @ 6: uvm_test_top.m_sequencer@@m_seq [Test] seq_2.start
# UVM_INFO top.sv(244) @ 8: uvm_test_top.m_sequencer@@m_seq [Test] seq_4.start
# UVM_INFO top.sv(232) @ 8: uvm_test_top.m_sequencer@@m_seq [Test] seq_2.start
# UVM_INFO top.sv(238) @ 9: uvm_test_top.m_sequencer@@m_seq [Test] seq_3.start
# UVM_INFO top.sv(244) @ 12: uvm_test_top.m_sequencer@@m_seq [Test] seq_4.start
# UVM_INFO top.sv(238) @ 12: uvm_test_top.m_sequencer@@m_seq [Test] seq_3.start
# UVM_INFO top.sv(244) @ 16: uvm_test_top.m_sequencer@@m_seq [Test] seq_4.start
If I want to justify that @2, first “seq_2.start” is displayed and then “seq_1.start” is displayed after it, I would say that although both of these expressions are scheduled to be displayed during the timeslot at 2, “seq_2.start” is actually scheduled first, namely, at the start of simulation when the value of time is 0, while “seq_1.start” is scheduled later, when the value of time is 1. When the simulator reaches the timeslot at 2, it executes the events scheduled for that timeslot in a FIFO order, therefore, “seq_2.start” is displayed before “seq_1.start”.
Is my justification correct?
Thanks in advance
Farhad