run_test and objections

3 posts / 0 new
Last post
vvs3693
Offline
Academy Total Access User
Joined: 11/02/2011
Posts: 12
run_test and objections
`include "uvm_macros.svh"
 
import uvm_pkg::*;
class Driver_callback extends uvm_callback;
 
  function new (string name = "Driver_callback");
    super.new(name);
  endfunction
 
  static string type_name = "Driver_callback";
 
  virtual function string get_type_name();
    return type_name;
  endfunction
 
  virtual task pre_send(); endtask
  virtual task post_send(); endtask
 
endclass : Driver_callback
 
class Driver extends uvm_component;
 
  `uvm_component_utils(Driver)
 
  `uvm_register_cb(Driver,Driver_callback)
 
  function new (string name, uvm_component parent=null);
    super.new(name,parent);
  endfunction
 
 
 virtual task run();
 
//	 uvm_test_done.raise_objection();
     repeat(2)
	   begin 
		 `uvm_do_callbacks(Driver,Driver_callback,pre_send())
		  $display(" Driver: Started Driving the packet ...... %d",$time);          
		 #40ns; 		// Logic to drive the packet goes hear         // let's consider that it takes 40 time units to drive a packet.
 
         $display(" Driver: Finished Driving the packet ...... %d",$time);  
         `uvm_do_callbacks(Driver,Driver_callback,post_send())
     end
//	 uvm_test_done.drop_objection();
  endtask
 
endclass
 
module test;
Driver drvr;
Driver_callback dvr_cb;
initial begin
  drvr = new("drvr");
  run_test();
end 
 
endmodule 

If you run the above test case (I ran in questa10.0) from the statement #40; onwards it wont execute. Any statement from the delay (inside run) will not execute.

This is the output I got without objections.

# ----------------------------------------------------------------
# UVM-1.1
# (C) 2007-2011 Mentor Graphics Corporation
# (C) 2007-2011 Cadence Design Systems, Inc.
# (C) 2006-2011 Synopsys, Inc.
# (C) 2011      Cypress Semiconductor Corp.
# ----------------------------------------------------------------
# UVM_INFO @ 0: reporter [RNTST] Running test ...
#  Driver: Started Driving the packet ......                    0
# 
# --- UVM Report Summary ---
# 
# ** Report counts by severity
# UVM_INFO :    1
# UVM_WARNING :    0
# UVM_ERROR :    0
# UVM_FATAL :    0
# ** Report counts by id
# [RNTST]     1
# ** Note: $finish    : /home/Questa_work/uvm-1.1/src/base/uvm_root.svh(408)
#    Time: 0 ns  Iteration: 191  Instance: /test

o/p with objections:

# ----------------------------------------------------------------
# UVM-1.1
# (C) 2007-2011 Mentor Graphics Corporation
# (C) 2007-2011 Cadence Design Systems, Inc.
# (C) 2006-2011 Synopsys, Inc.
# (C) 2011      Cypress Semiconductor Corp.
# ----------------------------------------------------------------
# UVM_INFO @ 0: reporter [RNTST] Running test ...
#  Driver: Started Driving the packet ......                    0
#  Driver: Finished Driving the packet ......                   40
#  Driver: Started Driving the packet ......                   40
#  Driver: Finished Driving the packet ......                   80
# UVM_INFO /home/Questa_work/uvm-1.1/src/base/uvm_objection.svh(1120) @ 80: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
# 
# --- UVM Report Summary ---
# 
# ** Report counts by severity
# UVM_INFO :    2
# UVM_WARNING :    0
# UVM_ERROR :    0
# UVM_FATAL :    0
# ** Report counts by id
# [RNTST]     1
# [TEST_DONE]     1
# ** Note: $finish    : /home/Questa_work/uvm-1.1/src/base/uvm_root.svh(408)
#    Time: 80 ns  Iteration: 48  Instance: /test

When I used objections, It worked fine. Why not in the other case?

mperyer
Offline
Verification Forum Moderator
Joined: 07/24/2010
Posts: 146
Re: run_test and objections

In UVM, a phase completes when all the objections to the phase's completion have been dropped. If no objections are raised, then it will end immediately. This is why you see the difference in behaviour.

vvs3693
Offline
Academy Total Access User
Joined: 11/02/2011
Posts: 12
Re: run_test and objections

Hi,
Thanks for the help. So, you mean to say that there must be at least one user raised objection in the run_phase even if there is only a single component. But isn't the uvm_phases have an internal raise and drop objection mechanism?