Adding functionality to sequencer

Hi,
I’m trying to add some functionality to the sequencer, so that when there are no more sequence items to send to the driver, it will automatically send one last sequence item.
I thought of adding in the run_phase something like this:

task run_phase()
  raise_objection;
  forever begin

    // I need to insert here something that says that the last req is done

    //checking if there are anymore seq_items available
    if(!seq_item_export.has_do_available()) begin
      s_item.randomize();
      execute_item(s_item);
      break;
    end
  end
  drop_objection;
endtask

So, my question is how do I check in the sequencer that the last item sent is finished?
Does the sequence keep running if I add this code in the sequencer?

Thanks

P.S. The driver uses get()/put().

Modifying the sequencer is not going to be straight-forward and you may well cause re-use issues later in the life of the verification component you are creating.

Is there any reason why you can’t do this on the sequence side of the stimulus generation chain? For instance, having a special sequence that sends the last sequence item that is run at the end of the run_phase. This will be much easier to implement.

The thing is that I always need to send a dummy request at the end of the sequence in order to get the response for the previous request and I wanted to keep this detail from the user, allowing him to write only “meaningful” code.
I thought of creating this dummy sequence, as you suggest, but it will have to be started at the end of every sequence that runs on this sequencer, thus introducing an overhead I would have liked to avoid.
I believe that the re-usability is not an issue in this case as this protocol is being used for a while now and it will probably be used in the future.
If nobody tried to do this “monstrosity” before, I guess I will do everything in the sequence.

In reply to boldy00:

Actually, I don’t know how to start a sequence at the end of the run_phase. Maybe you have a short example?
I thought of adding the dummy sequence in the post_body or post_start (which is better?) task of the base sequence. Would that be OK?

From what you’ve said, I think that adding a post_body() method to your base sequence will probably do the trick. The post_body() method will send the last transaction and this not need be visible to your users.