set_drain_time Link to heading

class test extends uvm_test;
 task run_phase (uvm_phase phase);
   phase.raise_objection(this);
   
   my_seq.start(m_sequencer);
   phase.phase_done.set_drain_time(this, 20ns);

   phase.drop_objection(this);
 endtask: run_phase
endclass

function for UVM names Link to heading

get_full_name() returns hierarchy from uvm_top

get_type_name() returns class name

get_name()  return UVM object name. passed to new()

How to start sequence Link to heading

class seq extends uvm_sequence;

task body();
	start_item(obj);
	obj.randomize();
	finish_item(obj);
endtask
endclass

seq sq;
sq.start(seqencer);
`uvm_do (seq/item) On calling this macro, create, randomize and send to the driver will be executed

`uvm_do_with (seq/item, constraints) It is the same as `uvm_do but additionally, constraints can be defined while randomizing

`uvm_do_pri(seq/item, priority) It is the same as `uvm_do but additionally, the mentioned priority is considered.

`uvm_do_pri_with(seq/item, constraints, priority).  It is a combination of `uvm_do_with and `uvm_do_pri

`uvm_create(seq/item) This creates a sequence or item.

`uvm_send(seq/item) It directly sends seq/item without creating and randomizing it. So, make sure the seq/item is created and randomized first.

`uvm_rand_send(seq/item) It directly sends a randomized seq/item without creating it. So, make sure the seq/item is created first.

`uvm_rand_send_with(seq/item) It directly sends a randomized seq/item with constraints but without creating it. So, make sure seq/item is created first

`uvm_send_pri(seq/item, Priority) It is the same as `uvm_send but additionally. priority is also considered.

`uvm_rand_send_pri(seq/item, Priority) It is combination of `uvm_rand_send and `uvm_send_pri

`uvm_rand_send_pri_with(seq/item, Priority) It is a combination of `uvm_rand_send_with and `uvm_send_pri.

UVM messages Link to heading

uvm info messages had the following levels

  • UVM_NONE
  • UVM_LOW
  • UVM_MEDIUM
  • UVM_HIGH
  • UVM_FULL
  • UVM_DEBUG

Default is UVM_MEDIUM. So, the following are printed

  • UVM_NONE
  • UVM_LOW
  • UVM_MEDIUM
+UVM_VERBOSITY=UVM_HIGH
`uvm_info( "id1",  get_full_name(), UVM_DEBUG  ) 
`uvm_info("MYINFO1", $sformatf("val: %0d", val), UVM_LOW)