Hi ,
I have recently started with UVM phases and have a basic question .
class my_monitor extends uvm_monitor ;
`uvm_component_utils(my_monitor)
// Standard 3-line Constructor
virtual task main_phase ( uvm_phase phase );
phase.raise_objection(this) ;
$timeformat(-9,3,"ns",8);
#10ns ;
`uvm_info(get_type_name(),$sformatf(" %0t %0s:: main_phase() done ",$time,get_name()),UVM_NONE)
phase.drop_objection(this) ;
endtask
endclass
class test extends uvm_test ;
`uvm_component_utils(test)
// Standard 3-line Constructor
my_monitor m_monitor ;
function void build_phase ( uvm_phase phase ) ;
m_monitor = new("m_monitor",this);
endfunction
virtual task run_phase ( uvm_phase phase );
phase.raise_objection(this) ;
$timeformat(-9,3,"ns",8);
#5ns ;
`uvm_info(get_type_name(),$sformatf(" %0t %0s:: run_phase() done ",$time,get_name()),UVM_NONE)
phase.drop_objection(this) ;
endtask
endclass
initial begin
run_test("test") ;
end
I see following Output ::
UVM_INFO @ 0: reporter [RNTST] Running test test…
UVM_INFO @ 0.000ns: uvm_test_top [test] 0.000ns uvm_test_top:: run_phase() done
UVM_INFO @ 0.000ns: reporter [TEST_DONE] ‘run’ phase is ready to proceed to the ‘extract’ phase
UVM_INFO @ 0.000ns: uvm_test_top.m_monitor [my_monitor] 0.000ns m_monitor:: main_phase() done
Need help with how the above code works .
I understand that run_phase starts parallel to pre_reset phase .
[1] Since I don’t have reset N configure in monitor shouldn’t run_phase of test run parallel to main_phase of monitor .
[2] Shouldn’t run_phase of test finish at 5 ns ? . In output I see run_phase is done at 0ns . How ?
[3] I purposely gave a delay in monitor greater than test so that the task based phases finish after monitor has dropped objection .
Is there a way to drop objection after monitor completes ( by using mixture of run && main phase ) ?
Thanks ,
ABD