Get the status of a sequence

Good morning everyone and thank you to take the time to read my question.

I have an issue with the UVM project I designed. I am relatively new in UVM so some of my choices can be weird.

My test runs a virtual sequence on a virtual sequencer. This virtual sequence creates a list of sequences to make and sends them. To check if everything goes well, the virtual sequence gets information of the DUT through a link monitor-virtual sequencer. If there is an issue, the virtual sequence prints an error and recalculate the list of sequences to do.

My problem is that I need for the check to get the information of the beginning and the end of the sequence on the driver (suppose here that 1 sequence creates only one item). The item sends from the monitor to the virtual sequence will also be linked to a string “BEGIN” or “END” of the sequence

My first idea was to get these information in the virtual sequencer through the call of get_next_item() and item_done(), but I don’t know how to change the run_phase to get these data.
What do you think about that? Is it possible or is it another way to get this information?

Here is a pseudo code of the virtual sequence:

class virtual_sequence extends uvm_sequence;
   `uvm_declare_p_sequencer (virtual_sequencer)

  uvm_tlm_analysis_fifo#(fsm_rsp) item_collected_fifo; //link with the monitor
  uvm_sequence[$] seq_list;

  function new (string name="virtual Sequence");;
  endfunction // new

  task send_seq();
    int i=0;


  task body();


In reply to CarolineC:

It is not really clear to me what your intention is and what the task/function check is doing.
Do you want to make decisions for the sequence constarints you might have or what is it.
For sending back responses from the driver to the sequencer you can use ‘put’ or ‘item_done’.
But this is not useful for a virtual sequence, because it does not generate seq_items.

In reply to CarolineC:

The purpose of a test and test sequence is to configure the DUT to behave in a specific manner and then send in data to test that behavior. The test and test sequence should be completely independent from the DUT and have no connections to any monitor or scoreboard.

It is the responsibility of the scoreboard to receive transactions from all of the monitors and ensure that the DUT is functioning correctly.

For your case, you should never change any sequence ordering or add/remove sequences. Nor should the sequence ever try to determine if the DUT behavior is correct. This can sometimes confuse users new to UVM as traditional testing tries to test and verify in the same component.

The task check is using some data of the sequence which is send (in the task send_seq) and compare those with the data received from the DUT. If there is an error, in the comparison of these two information, a computation changes seq_list. At this stage, an item is sent by the monitor each 1us. So, the check in the task check() is done each 1us.
The problem is that during the execution of the sequence, the state of the DUT cannot be compare to the data in the sequence. So the list is always changed.

I’m looking for a way to do this comparison only when the sequence begins (when the driver called the method get_next_item()) and before the end (just before the driver called item_done()). However, because the project should be automatic, I cannot modify the sequence, only the virtual sequence and the environment. So my idea was to modify the run_phase of the sequencer to get the calls to get_next_item and item_done and pass them through an item in the FIFO to the virtual sequence. This way, the check task will see that the sequence is “running” on the driver or is near the end. In this two cases, the task will check the data received and not changed the list of sequences to execute.

In reply to CarolineC:

As I stated previously, the sequence should NEVER be checking any response from the DUT. That is the responsibility of the scoreboard. You should remove the check() task from your sequence and only generate/start sequences/sequence_items.

Even in the scoreboard, the task check will need the status of the sequence on the driver to do a correct check. The check should not be done all the time because the expected value can change during the sequence and not at the end. If I do, I will have some errors at some point.

In reply to CarolineC:

Absolutely not. The scoreboard is completely independent of any stimulus generation. The scoreboard will receive transactions from all of the monitors attached to the DUT. These monitors will provided the scoreboard with the information on how the DUT is configured, what stimulus was sent to the DUT, and how the DUT responded. The scoreboard will take this information and apply it to the DUT reference model and determine if there is any discrepancies.