1

I have one question related to UVM phases. As I understood the UVM phases e.g. build_phase, connect_phases, are valid only for uvm_component and is derived classes.

That means all classes that derive from uvm_transaction i.e. uvm_sequence, uvm_sequence_item does not support these phases. And in the code if we write the following

class setupSeq  extends uvm_sequence #(seqItem);
        `uvm_object_utils(setupSeq  )

    function build_phase (uvm_phase phase);
         req = seqItem::type_id::create("req");
     endfunction

    task body();
        start_item(req);
          …
        finish_item(req);
    endtask
…

endclass

This will give simulation error, as the build_phase will never be called and body task cannot recognize the “req” object.

So my question is – why the phases are not supported for uvm_transaction i.e. uvm_sequence classes?

haykp
  • 435
  • 12
  • 29

1 Answers1

4

Because you don't need them. By the time you get around to constructing sequences, you are already in the run_phase. The lifetime of all sequences is during the run_phase, so having other phases in a sequence does not make sense. The reason for having separate build/connect/run phases is to bring up the testbench in an orderly fashion so you can make connections from one component to another without worrying if that other component exists yet.

So put your req construction in the constructor of the sequence.

dave_59
  • 39,096
  • 3
  • 24
  • 63