How to stop and start one of the sequence out of multiple sequence running in parallel

Hi,

I have situation where multiple sequence are running in parallel and one
of the sequence has to be stopped while others are continuning to run.
After that a sequence similar to the one stopped needs to be started again.
Is there any example available or can someone share some idea.

Psuedo code
Say 2 usb sequences are started on single sequencer.

// Sequencer
usb_sequencer usb_sqr;
// sequences
usb_seq_bulk usb_bulk_1;
usb_seq_interrupt usb_intr_1;

task body();
fork
begin
ovm_do_on(usb_bulk_1,usb_sqr); end begin ovm_do_on(usb_intr_1,usb_sqr);
end
begin
ep_type_to_stop;
wait_for_reset_ep(ep_type_to_stop);
// stop
if(ep_type_to_stop == intr)begin
// logic to stop sequence related to interrupt ???
// logic to start intr sequence
end
else if(ep_type_to_stop == bulk)begin
// logic to stop sequence related to bulk ???
// logic to start bulk sequence
end
end
join
endtask


Sathiya

Hi,

I have situation where multiple sequence are running in parallel and one
of the sequence has to be stopped while others are continuning to run.
After that a sequence similar to the one stopped needs to be started again.
Is there any example available or can someone share some idea.


Psuedo code
Say 2 usb sequences are started on single sequencer.
// Sequencer
usb_sequencer usb_sqr;
// sequences
usb_seq_bulk usb_bulk_1;
usb_seq_interrupt usb_intr_1;

task body();
   fork
      begin
	 `ovm_do_on(usb_bulk_1,usb_sqr);
      end
      begin
	 `ovm_do_on(usb_intr_1,usb_sqr);
      end
      begin
	 ep_type_to_stop;
	 wait_for_reset_ep(ep_type_to_stop);
	 // stop
	 if(ep_type_to_stop == intr)begin
	    // logic to stop sequence related to interrupt ????
	    // logic to start intr sequence
	 end
	 else if(ep_type_to_stop == bulk)begin
	    // logic to stop sequence related to bulk ????
	    // logic to start bulk sequence
	 end
      end
   join
endtask
 

In reply to sathiya:

You might have already tried stop_sequences(), which kills all sequences, which is not your requirement though.

As per my exp, this has to be done in driver itself. If we get interrupt, stop getting that particular seq_item from the sequencer. Then later ISR is served, driver can continue getting the seq_item. If you have separate drivers for these seq_items, then this seems easy. I am not sure if a driver can have more seq_item_ports and can drive more seq_items.