Quantcast
Channel: UVM Forums RSS Feed
Viewing all articles
Browse latest Browse all 756

the bug of the sync of run_phase and post_shutdown_phase!

$
0
0

Hi, all

 

 We have one monitor and one driver as follow:

 

class monitor extends uvm_monitor;

 `uvm_component_utils(monitor)

   function new(string name, uvm_component parent);
      super.new(name, parent);
   endfunction

   virtual task post_shutdown_phase(uvm_phase phase);
   
     #50ns;
     `uvm_info(get_type_name(), "Monitor is printing at post_shutdown_phase executing...", UVM_LOW )
   
   endtask: post_shutdown_phase
   
   virtual function void phase_ready_to_end(uvm_phase phase);
     if(phase.get_name == "post_shutdown")
       `uvm_info(get_type_name(), "Monitor is printing at phase_ready_to_end...", UVM_LOW )
   
   endfunction: phase_ready_to_end
   
   
   virtual function void phase_ended(uvm_phase phase);
     if(phase.get_name == "post_shutdown")
       `uvm_info(get_type_name(), "Monitor is printing at phase_ended...", UVM_LOW )
   
   endfunction: phase_ended

endclass : monitor

 

 

 

class driver extends uvm_driver;

  `uvm_component_utils(driver)

  function new(string name, uvm_component parent);
    super.new(name);
  endfunction

  task run_phase(uvm_phase phase);
    phase.raise_objection(this, "Starting test");
    #100ns;
    `uvm_info(get_type_name(), "Driver is printing at run_phase executing...", UVM_LOW )    
    phase.drop_objection(this, "Finishing test");
  endtask: run_phase

  virtual function void phase_ready_to_end(uvm_phase phase);
    if(phase.get_name == "run")
      `uvm_info(get_type_name(), "Driver is printing at phase_ready_to_end...", UVM_LOW )

  endfunction: phase_ready_to_end

  virtual function void phase_ended(uvm_phase phase);
    if(phase.get_name == "run")
      `uvm_info(get_type_name(), "Driver is printing at phase_ended...", UVM_LOW )

  endfunction: phase_ended

endclass: driver

 

 when it run one of cases, it printed the information as follow:

 

# UVM_INFO @ 0: reporter [RNTST] Running test tc_read_ver_reg...
# UVM_INFO ../../monitor.sv(41) @ 0: uvm_test_top.tb.agent.monitor [monitor] Monitor is printing at phase_ready_to_end...
# UVM_INFO ../../monitor.sv(35) @ 50000: uvm_test_top.tb.agent.monitor [monitor] Monitor is printing at post_shutdown_phase executing...
# UVM_INFO ../../driver.sv(22) @ 100000: uvm_test_top.tb.agent.driver [driver] Driver is printing at run_phase executing...
# UVM_INFO ../../driver.sv(28) @ 100000: uvm_test_top.tb.agent.driver [driver] Driver is printing at phase_ready_to_end...
# UVM_INFO ../../monitor.sv(48) @ 100000: uvm_test_top.tb.agent.monitor [monitor] Monitor is printing at phase_ended...
# UVM_INFO ../../driver.sv(34) @ 100000: uvm_test_top.tb.agent.driver [driver] Driver is printing at phase_ended...
#

 

The post_shutdown_phase of the monitor reached to phase_ready_to_end at 0, but it's task post_shutdown_phase did not finish until  @ 50000.

 

What is wrong with it?

 

Thank you in advanced!

 

BR

 

QIN


Viewing all articles
Browse latest Browse all 756

Trending Articles