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