Hi,
Can you tell me how to assign run_phase.get_objection to the uvm_callback_objection?
so that i can give the callback objection to the uvm_heartbeat new function.
Here is the code:
function void heartbeat(uvm_phase phase);
uvm_callbacks_objection cb = new("cb"); // CALLBACK OBJECTION
uvm_heartbeat hb; // HEARTBEAT COMPONENT
uvm_event e = new("e"); // UVM EVENT
uvm_component comps[$]; // LIST OF COMPONENT QUEUE
chip_timeout_catcher catcher; // TIMEOUT CATCHER
uvm_phase run_phase = phase.find_by_name("run",0);
catcher = chip_timeout_catcher :: type_id :: create("catcher",this);
catcher.m_run_phase = run_phase;
uvm_report_cb :: add(null, catcher);
if(!$cast(cb,run_phase.get_objection()))
`uvm_fatal("run_phase", $psprintf("run phase objection type isn't of type uvm_callbacks_objection. You need to define UVM_USE_CALLBACKS_OBJECTION_FOR_TEST_DONE!"));
//assert ($cast(cb,run_phase.get_objection()))
// else
// `uvm_fatal("run_phase", $psprintf("run phase objection type isn't of type uvm_callbacks_objection. You need to define UVM_USE_CALLBACKS_OBJECTION_FOR_TEST_DONE!"));
hb = new("activity_heartbeat",this,cb); // HEARTBEAT COMPONENT CREATION
uvm_top.find_all("*",comps,this);
hb.set_mode(UVM_ALL_ACTIVE);
hb.set_heartbeat(e, comps);
fork begin
forever begin
#`HEARTBEAT_TIMEOUT e.trigger();
`uvm_fatal("TEST LIBRARY","NO ACTIVITY IN THE CHIP")
end
end
join_none
endfunction : heartbeat
F.Y.I :
UVM1.2 updates the constructor of uvm_hearbeat to
function new(string name, uvm_component cntxt, uvm_objection objection=null);
// Typedef - Exists for backwards compat
typedef uvm_objection uvm_callbacks_objection;
//UVM1.1 function new(string name, uvm_component cntxt, uvm_callbacks_objection objection=null);
super.new(name);
You have to stop heartbeat at some time. In your code, env’s run phase stopped running as loops are completed so no activity and it resulted in failure. Although, component was still working but somehow heartbeat is not capturing its activity.
In reply to Murui Li:
Hi Murui,
Yes, I solved the issue. The issue is regarding the uvm version. Upgrade the version to UVM 1.2.
But still i am not sure about the heartbeat monitor is working as expected as I am getting the heartbeat objection failure.
Here is my code :
Can you help me to figure out the issue?
Link : Hearbeat Monitor not working - EDA Playground
Thanks in advance,
SANJAIKUMAR K