Jump to content
Sign in to follow this  
mrforever

uvm_heartbeat issue

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!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×