I tried the following code, and the last assertion is producing an error. I would expect the total count of objections to be zero, but it seems that uvm_objection.m_drop does not propagate the objection to the parent class properly. Any ideas if this is the intended behaviour or a bug in the UVM code.
You can also find the example here: Edit code - EDA Playground
import uvm_pkg::*;
class Child extends uvm_component;
function new(string name, uvm_component parent);
super.new(name, parent);
endfunction: new
endclass
class Parent extends uvm_component;
Child child;
function new(string name, uvm_component parent);
super.new(name, parent);
child = new("child", this);
endfunction: new
endclass
module tb_top();
Parent parent;
uvm_objection my_obj;
initial begin
my_obj = new("obj2");
parent = new("parent", null);
assert(my_obj.get_objection_total(parent) == 0);
my_obj.raise_objection(parent.child);
assert(my_obj.get_objection_total(parent) == 1);
my_obj.drop_objection(parent.child);
assert(my_obj.get_objection_total(parent) == 0);
end
endmodule