I have to call the stop_sequence like below, since stop_sequence is a function, I can’t use posedge as it will be considered a time_consuming statement, is there any other I can do it without using a fork-join_none
//Sequence .
class dummy extends uvm_sequence #(REQ= packet);
bit received_item_done;
task body();
wait_for_grant();
assert(req.randomize());
send_req(req);
received_item_done = 0;
wait_for_item_done();
received_item_done = 1;
endtask
endclass
//Test
begin
fork
begin
wait(dummy_linkup == 1);
end
begin
forever
dummy.start(Sequencer);
end
join_any
@(posedge dummy.received_item_done);
disable fork;
Sequencer.stop_sequence();
end
Making things simple is always an option!!
Why are you are starting a sequence on a sequencer again and again. This makes never sense.
And where is your problem with the stop_sequences function.
You can call a function inside a task. This is not a problem.
In your test run_phase you are running a fork/join_any. One of the threads is a forever loop. It will never finish.
The other thread is stopping when received_item_done = 1;
Then you are killing the remaining process in the fork/join_any. This is the sequence process.
This kills any running sequence.