Heartbeats provide a way for environments to easily ensure that their descendants are alive. A uvm_heartbeat is associated with a specific objection object. A component that is being tracked by the heartbeat object must raise (or drop) the synchronizing objection during the heartbeat window. The synchronizing objection must be a uvm_callbacks_objection type.
The uvm_heartbeat object has a list of participating objects. The heartbeat can be configured so that all components (UVM_ALL_ACTIVE), exactly one (UVM_ONE_ACTIVE), or any component (UVM_ANY_ACTIVE) must trigger the objection in order to satisfy the heartbeat condition.
uvm_heartbeat | |
Heartbeats provide a way for environments to easily ensure that their descendants are alive. | |
Methods | |
new | Creates a new heartbeat instance associated with cntxt. |
set_mode | Sets or retrieves the heartbeat mode. |
set_heartbeat | Sets up the heartbeat event and assigns a list of objects to watch. |
add | Add a single component to the set of components to be monitored. |
remove | Remove a single component to the set of components being monitored. |
start | Starts the heartbeat monitor. |
stop | Stops the heartbeat monitor. |
function new( string name, uvm_component cntxt, uvm_callbacks_objection objection = null )
Creates a new heartbeat instance associated with cntxt. The context is the hierarchical location that the heartbeat objections will flow through and be monitored at. The objection associated with the heartbeat is optional, if it is left null but it must be set before the heartbeat monitor will activate.
uvm_callbacks_objection myobjection = new("myobjection"); //some shared objection class myenv extends uvm_env; uvm_heartbeat hb = new("hb", this, myobjection); ... endclass
function uvm_heartbeat_modes set_mode ( uvm_heartbeat_modes mode = UVM_NO_HB_MODE )
Sets or retrieves the heartbeat mode. The current value for the heartbeat mode is returned. If an argument is specified to change the mode then the mode is changed to the new value.
function void set_heartbeat ( uvm_event e, ref uvm_component comps[$] )
Sets up the heartbeat event and assigns a list of objects to watch. The monitoring is started as soon as this method is called. Once the monitoring has been started with a specific event, providing a new monitor event results in an error. To change trigger events, you must first stop the monitor and then start with a new event trigger.
If the trigger event e is null and there was no previously set trigger event, then the monitoring is not started. Monitoring can be started by explicitly calling start.
function void add ( uvm_component comp )
Add a single component to the set of components to be monitored. This does not cause monitoring to be started. If monitoring is currently active then this component will be immediately added to the list of components and will be expected to participate in the currently active event window.
function void remove ( uvm_component comp )
Remove a single component to the set of components being monitored. Monitoring is not stopped, even if the last component has been removed (an explicit stop is required).
function void start ( uvm_event e = null )
Starts the heartbeat monitor. If e is null then whatever event was previously set is used. If no event was previously set then a warning is issued. It is an error if the monitor is currently running and e is specifying a different trigger event from the current event.
Creates a new heartbeat instance associated with cntxt.
function new( string name, uvm_component cntxt, uvm_callbacks_objection objection = null )
Sets or retrieves the heartbeat mode.
function uvm_heartbeat_modes set_mode ( uvm_heartbeat_modes mode = UVM_NO_HB_MODE )
Sets up the heartbeat event and assigns a list of objects to watch.
function void set_heartbeat ( uvm_event e, ref uvm_component comps[$] )
Add a single component to the set of components to be monitored.
function void add ( uvm_component comp )
Remove a single component to the set of components being monitored.
function void remove ( uvm_component comp )
Starts the heartbeat monitor.
function void start ( uvm_event e = null )
Stops the heartbeat monitor.
function void stop ()
The uvm_callbacks_objection is a specialized uvm_objection which contains callbacks for the raised and dropped events.
class uvm_callbacks_objection extends uvm_objection