uvm_agent

class uvm.comps.uvm_agent.UVMAgent(name, parent)[source]

Bases: UVMComponent

The UVMAgent virtual class should be used as the base class for the user- defined agents. Deriving from UVMAgent will allow you to distinguish agents from other component types also using its inheritance. Such agents will automatically inherit features that may be added to UVMAgent in the future.

While an agent’s build function, inherited from UVMComponent, can be implemented to define any agent topology, an agent typically contains three subcomponents: a driver, sequencer, and monitor. If the agent is active, subtypes should contain all three subcomponents. If the agent is passive, subtypes should contain only the monitor.

build_phase(phase)[source]

The UVMBuildPhase phase implementation method.

Any override should call super().build_phase(phase) to execute the automatic configuration of fields registered in the component by calling apply_config_settings. To turn off automatic configuration for a component, do not call super().build_phase(phase).

This method should never be called directly.

Parameters

phase (UVMPhase) –

type_name = 'uvm_agent'
get_type_name()[source]

This function returns the type name of the object, which is typically the type identifier enclosed in quotes. It is used for various debugging functions in the library, and it is used by the factory for creating objects.

This function must be defined in every derived class.

A typical implementation is as follows:

class mytype (UVMObject):
  ...
  type_name = "mytype"

  def get_type_name(self):
    return my_type.type_name

We define the type_name static variable to enable access to the type name without need of an object of the class, i.e., to enable access via the scope operator, ~mytype::type_name~.

Returns

Type name of the object.

Return type

str

get_is_active()[source]

Returns UVM_ACTIVE is the agent is acting as an active agent and UVM_PASSIVE if it is acting as a passive agent. The default implementation is to just return the is_active flag, but the component developer may override this behavior if a more complex algorithm is needed to determine the active/passive nature of the agent.

m_children: Dict[str, 'UVMComponent']
m_children_by_handle: Dict['UVMComponent', 'UVMComponent']
m_children_ordered: List['UVMComponent']
event_pool: UVMEventPool