Heart beat Monitor

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 

In reply to SANJAIKUMAR:

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);

In reply to VE:

Hi,
Thanks for the reply.

Since i have been using 1.1-d version, though i used the backward compat i.e typedef of the uvm_objection it is mentioning the same error.

ERROR : Illegal type assignment compatible

Thanks
SANJAIKUMAR

Hi,

I met the same problem. Have you solved this issue?

Thanks,
Murui

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

In reply to SANJAIKUMAR:

Hi SanjaiKumar,

Did you get to solve your query.
What was the issue in your code.
Even I have to use the heartbeat monitor to debug my environment.

Thanks
GA

In reply to geetika6:

Your problem is simple:

phase.get_objection();

does not return an object. You have to say what should happen in this situation. You are simply issuing an error message.

BTW I try to understand what do you want to debug with the heartbeat. In my understanding this is a feature to visualize something.

@sanjaikumar

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 SANJAIKUMAR:

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