Dear Forum,
I know this topic were discussed hundreds of times, but still please help to clarify one thing
1) Why needed raise/drop objection in a sequence?
All my life I use test class as a place to raise/drop objection and never face issues. However recently I got new environment where the raise/drop objections are done in sequence. There is a one layer of sequence which raise/drop objections in pre/post_body phases. What is the benefits of using such method?
I assume may be it is done for VIP level, when someone creates VIP, than they raise/drop objections in sequence as they don’t have access to test class. Is my understanding right?
2) Starting_phase variable: I know this is for UVMV 1.1 and in 1.2 changed to set/get_starting_phase. But my questions is why we need to check if it is null? When we call sequence we are already in run_phase, right? We just cannot call sequence in null phase as all other phases take 0 time.
And in UVM1.1. how staring_phase variable get initialized?
Also in doc is written to use starting_phase in defaul_sequence, which is now depreciated…
This is code example:
class pkt_sequence extends uvm_sequence#(packet);
`uvm_object_utils(pkt_sequence)
function new(string name="pkt_sequence");
super.new(name);
endfunction // new
virtual task pre_body();
if(starting_phase != null) begin
`uvm_info(get_type_name(), $sformatf("%s pre_body() raise objection[if], %s", get_sequence_path(), starting_phase.get_name()), UVM_LOW)
starting_phase.raise_objection(this);
end
else begin
`uvm_info(get_type_name(), $sformatf("%s pre_body() raise objection[else]", get_sequence_path()), UVM_LOW)
end
endtask // pre_body
virtual task post_body();
if(starting_phase != null) begin
`uvm_info(get_type_name(), $sformatf("%s post_body() raise objection[if], %s", get_sequence_path(), starting_phase.get_name()), UVM_LOW)
starting_phase.drop_objection(this);
end
else begin
`uvm_info(get_type_name(), $sformatf("%s post_body() raise objection[else]", get_sequence_path()), UVM_LOW)
end
endtask // post_body