Jump to content

issue about uvm_heartbeat


Recommended Posts

Hi all,

There are such codes in heartbeat class:

 virtual task run_phase(uvm_phase phase); 
    uvm_callbacks_objection cb;
    uvm_heartbeat hb;
    uvm_event e;
    uvm_component comps[$];
    if (heartbeat_window == 0) begin
      return; 
    end
    e = new("e");
    assert($cast(cb, phase.get_objection()))
    else  
      `uvm_fatal("heartbeat", run_phase objection isn't the type of uvm_callbacks_objection. You need to define UVM_USE_CALLBACKS_OBJECTION_FOR_TEST_DONE!)
    hb = new(get_full_name(), m_context, cb);
    uvm_top.find_all("*", comps, m_context);

    hb.set_mode(UVM_ANY_ACTIVE);
    hb.set_heartbeat(e, comps); 
    fork    
      forever begin
        #heartbeat_window e.trigger();
      end     
    join_none
  endtask: run_phase

 

 

The VCS always reports assertion fail even though I defined UVM_USE_CALLBACKS_OBJECTION_FOR_TEST_DONE in define.svh or in command line.

The way of defining UVM_USE_CALLBACKS_OBJECTION_FOR_TEST_DONE:

in define.svh

  1. `define UVM_USE_CALLBACKS_OBJECTION_FOR_TEST_DONE // For heartbeat

in command line:

VCS =   vcs -sverilog -debug_all -picarchive -timescale=1ns/1ps \
        +acc +vpi \
        +define+UVM_OBJECT_MUST_HAVE_CONSTRUCTOR+UVM_USE_CALLBACKS_OBJECTION_FOR_TEST_DONE \

 

If I defined UVM_USE_CALLBACKS_OBJECTION_FOR_TEST_DONE, phase.get_objection() should return the uvm_callbacks_objection type and the assert should be successful, but it doesn't. Why?

 

Thanks in advance!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...