Base_test doesn't need to implement uvm_config_wrapper?

Dear All,

I’m trying to understand the usage of UVM_TESTNAME and some test and sequences.
I have made snippet code as the below,

When I run “+UVM_TESTNAME=test2”, then yapp_5_packet sequence has been run, that’s what I expected it. No problem.
But when I run “+UVM_TESTNAME=short_packet_test”, then still yapp_5_packet sequence has been run not incr_test_seq
So I commented out about

   uvm_config_wrapper::set(this, "tb.yapp.tx_agent.sequencer.run_phase",
                                  "default_sequence",
                                  yapp_5_packets::get_type());

then I can run incr_test_seq.

So I’m confuse that this is whether normal usage for test or not? (should I have to commented out"uvm_config_wrapper" in the base_test for each another sequence test?


class base_test extends uvm_test;

  // component macro
  `uvm_component_utils(base_test)

  router_tb tb;

  // component constructor
  function new(string name, uvm_component parent);
    super.new(name, parent);
  endfunction : new

  // UVM build_phase()
  function void build_phase(uvm_phase phase);
    super.build_phase(phase);
    uvm_config_int::set( this, "*", "recording_detail", 1);
    tb = router_tb::type_id::create("tb", this);

   uvm_config_wrapper::set(this, "tb.yapp.tx_agent.sequencer.run_phase",
                                  "default_sequence",
                                  **yapp_5_packets**::get_type());

  endfunction : build_phase
  
  function void end_of_elaboration_phase(uvm_phase phase);
    uvm_top.print_topology();
  endfunction : end_of_elaboration_phase


  function void start_of_simulation_phase(uvm_phase phase);
    `uvm_info(get_type_name(), {"start of simulation for ", get_full_name()}, UVM_HIGH);
  endfunction : start_of_simulation_phase

  function void check_phase(uvm_phase phase);
    // configuration checker
    check_config_usage();
  endfunction

endclass : base_test

class test2 extends base_test; 
 
  // component macro 
  `uvm_component_utils(test2) 
 
  // component constructor 
  function new(string name, uvm_component parent); 
    super.new(name, parent); 
  endfunction : new 
 
endclass : test2

class short_packet_test extends base_test;

  // component macro
  `uvm_component_utils(short_packet_test)

  // component constructor
  function new(string name, uvm_component parent);
    super.new(name, parent);
  endfunction : new

  function void build_phase(uvm_phase phase);
    yapp_packet::type_id::set_type_override(short_yapp_packet::get_type());
    super.build_phase(phase);
    uvm_config_wrapper::set(this, "tb.yapp.tx_agent.sequencer.run_phase",
                                   "default_sequence",
                                   incr_test_seq::get_type());
  endfunction : build_phase

endclass : short_packet_test


Here For your convenient

In reply to UVM_LOVE:

It is highly recommended to never use a “default_sequence” in your environment. This is a legacy method to start a sequence and can cause issues when trying to debug why things aren’t working (as you have discovered).

Instead, you should start() any required sequences as part of your test.

In reply to cgales:

In reply to UVM_LOVE:
It is highly recommended to never use a “default_sequence” in your environment. This is a legacy method to start a sequence and can cause issues when trying to debug why things aren’t working (as you have discovered).
Instead, you should start() any required sequences as part of your test.

Thanks for reply.
Ok I’ll use start(0 instead “default_sequence”.
BTW, What if I have to use “default_sequence” instead start(). then what am I supposed to do to fix the problem?

In reply to UVM_LOVE:

I think your issue stems from calling “super.build_phase()” at the wrong point. You should always call the “super.function()” as the first statement in “function()”. This way, anything you have coded after the super call will override what was configured in in the base class.

Since the example you provided doesn’t effectively demonstrate your issue, I’m not 100% sure about this.