Why pre_shutdown phase occurs at 0ns?

Hi all,

I’ve implemented the shutdown_phase with some register reads in my test, but it occurs at 0ns, before the run_phase starts.
Which event is responsible for triggering shutdown_phase?

This is a code snippet from my test:


class setup_test extends reset_test;

  // Sequences
  init_dut_ahb_api_seq_lib        ahb_m;

  `uvm_component_utils(setup_test)
  
   
  function new (string name, uvm_component parent);
    super.new(name,parent);
    ahb_m      = new("ahb_api_seq_lib");
  endfunction

  virtual function void build_phase(uvm_phase phase);
    super.build_phase(phase);
  endfunction: build_phase

  virtual task run_phase(uvm_phase phase);

  endtask

  function void report_phase(uvm_phase phase);
    super.report_phase(phase);
  endfunction


  
 virtual task check_m_counters();


    ahb_m = new("ahb_api_seq_lib");

    ahb_m.ahb_master_seqr          = tb.virtual_sequencer.ahb_master_seqr;
    ahb_m.ahb_reg_map              = tb.regmap.bus_map;
    ahb_m.ahb_reg_block            = tb.regmap;
    ahb_m.ahb_label                = "m_ctrl__";
    ahb_m.ahb_sm_file_label        = "CFG_FILE_AHB_M";

   ahb_m.check_overall_access();
  endtask
  
  virtual task pre_shutdown_phase(uvm_phase phase);
    uvm_report_info( get_type_name(), "PRE_SHUTDOWN_PHASE", UVM_NONE);
    check_m_counters(); 
  endtask

This is my output

%% UVM_INFO @ 0.00 ns: uvm_test_top [tc_spahb_mi_001] PRE_SHUTDOWN_PHASE

In reply to alexkidd84:

You should review the Verification Academy section on phasing.

The Parallel Run-Time phases will execute in parallel with the run_phase(). These phases will execute in order, and if these parallel phases don’t exist or don’t consume any simulation time, the scheduler will finish one phase and then start the next phase.

In your case, you only have the pre_shutdown_phase(). Since there are no other phases implemented, the UVM phasing scheduler will execute the pre_shutdown_phase() at time 0.

This is a great example why it is recommended to only use the run_phase() and ignore the Parallel Run-Time phases.