Hello, i am facing issues finishing a test in uvm tb, i have the objection mecanism in the run_phase of the test, but it does not stop the test. This is the test class that i am using.
class serdes_base_test extends uvm_test;
`uvm_component_utils(serdes_base_test)
serdes_virtual_base_sequence h_base_sequence;
//------------------------------------------------
virtual task run_phase (uvm_phase phase);
raise_objection(phase);
create_and_start_virtual_sequence();
drop_objection(phase);
endtask : main_phase
//------------------------------------------------
virtual function void raise_objection(uvm_phase phase);
phase.raise_objection(this);
endfunction : raise_objection
//------------------------------------------------
virtual function void drop_objection(uvm_phase phase);
phase.drop_objection(this);
endfunction : drop_objection
//------------------------------------------------
endclass : serdes_base_test
//---------------- Serdes Directed Test -------------------
class lb_cs_direct_ds_direct_test extends serdes_base_test;
`uvm_component_utils(lb_cs_direct_ds_direct_test)
lb_cs_direct_ds_direct_same_config_all_ds_1 h_seq;
//------------------------------------------------
function new(string name = “lb_cs_direct_ds_direct_test”,uvm_component parent);
super.new(name,parent);
endfunction : new
//------------------------------------------------
virtual task create_and_start_virtual_sequence();
h_seq = lb_cs_direct_ds_direct_same_config_all_ds_1 :: type_id :: create (“h_seq”);
h_seq.start(h_serdes_env.h_serdes_virtual_seqr);
endtask : create_and_start_virtual_sequence
//---------------------------------------------------------
endclass : lb_cs_direct_ds_direct_test
I added to the virtual sequence the starting_phase.raise/drop_objection and the result is the same, i realized in the post_body section starting_phase is always null so that is why the objection does not drop. This is part of the virtual sequence i am using.
class serdes_virtual_base_sequence extends uvm_sequence;
`uvm_object_utils(serdes_virtual_base_sequence)
serdes_sequence h_seq;
`uvm_declare_p_sequencer(serdes_virtual_sequencer)
virtual task pre_body();
if(starting_phase != null)
starting_phase.raise_objection(this, {"Raising Objection for sequence '",get_full_name(), "'"});
endtask : pre_body
//------------------------------------------------
virtual task body();
generate_stimulus();
endtask : body
//------------------------------------------------
virtual task post_body();
if(starting_phase != null)
starting_phase.drop_objection(this, {“Dropping Objection for sequence '”,get_full_name(), “'”});
endtask : post_body
//------------------------------------------------
virtual task generate_stimulus();
repeat(h_chip_config.trans_count) begin
start_serdes_sequence();
end
endtask : generate_stimulus
//------------------------------------------------
virtual task start_serdes_sequence();
endtask : start_serdes_sequence
//------------------------------------------------
endclass : serdes_virtual_base_sequence
//------- Serdes_Virtual_Direct_Sequence --------
class lb_cs_direct_ds_direct_same_config_all_ds_1 extends serdes_virtual_base_sequence;
uvm_object_utils(lb_cs_direct_ds_direct_same_config_all_ds_1) //------------------------------------------------ function new(string name = "lb_cs_direct_ds_direct_same_config_all_ds_1"); super.new(name); endfunction : new //------------------------------------------------ virtual task start_serdes_sequence(); fork begin for(int i=0; i <
NUMBER_OF_DATA_SLICES; i++) begin
fork
int j = i;
begin
`uvm_do_on_with(h_seq,p_sequencer.h_ds_tx_sequencer[j],{h_seq.data_l == 40’hAAAAAAAAAA;})
end
join_none
end
wait fork;
end
join
endtask : start_serdes_sequence
//------------------------------------------------
endclass : lb_cs_direct_ds_direct_same_config_all_ds_1
I have tried removing the pre_body/post_body section and including the raise/drop mecanism in the body but the resul is the same. The driver is reporting item_done to the sequencer too. This is the run_pase in the driver
virtual task run_phase(uvm_phase phase);
reset_dut_inputs();
fork
forever begin
seq_item_port.get_next_item(req);
drive_transfer(req);
seq_item_port.item_done(req);
end
join_none
endtask // run_phase
Can anyone give me ideas in how to solve this problem? Thank you