uvm_heartbeat

UVM HeartBeat

Heartbeats provide a way for environments to easily ensure that their descendants are alive. or in other words, the uvm_heart beat catches the deadlock or hang states of the verification components.

How uvm_heartbeat work?

UVM_heartbeat watches for an activity in the test bench and if it finds that there is no activity in the specified interval of time, then uvm_heratbeat issue a fatal message which leads to the end of the simulation.

What are the benefits of using the uvm_heartbeat?

As mentioned earlier uvm_heartbeat identifies the simulation hang situation and terminates the run,

  • which will help in identifying the component which is cause for deadlock
  • saves the simulation time and releases the resources by early termination of simulation

How to use the uvm_heartbeat?

It involves the below steps,

  • Create the heart_beat object
  • Set the components to be monitored
  • trigger the heartbeat monitor

To make the above steps easy, the uvm_heartbeat has a set of inbuilt methods.

uvm_heartbeat methods

new

function new(
  string name,
  uvm_component cntxt,
  uvm_objection objection = null
)
  • Creates a new heartbeat instance associated with cntxt.
  • The cntxt is the hierarchy of components to be monitored.
  • The object of uvm_objections_callback type

set_heartbeat

function void set_heartbeat (
  uvm_event#(uvm_object) e,
  ref uvm_component comps[$]
)

This method sets a list of objects to be watched at event e.

set_mode

function uvm_heartbeat_modes set_mode (
  uvm_heartbeat_modes mode = UVM_NO_HB_MODE
)

This method call Sets or retrieves the heartbeat mode.

the mode shall be,
UVM_ALL_ACTIVE  – all components
UVM_ONE_ACTIVE – exactly one component
UVM_ANY_ACTIVE – any component

add

function void add (
  uvm_component comp
)

The add method Adds a single component to the set of components to be monitored.

remove

function void remove (
  uvm_component comp
)

The Remove method removes a single component from the set of components being monitored.

start

function void start (
  uvm_event#(uvm_object) e = null
)

Calling the start method Starts the heartbeat monitor.

stop

function void stop ()

Calling stop method Stops the heartbeat monitor.
❮ Previous Next ❯