mrforever Posted May 21, 2013 Report Share Posted May 21, 2013 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 `define UVM_USE_CALLBACKS_OBJECTION_FOR_TEST_DONE // For heartbeatin 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! Quote Link to comment Share on other sites More sharing options...
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.