endfunctionconststaticstringtype_name="uvm_agent";virtualfunctionstringget_type_name();returntype_name;endfunction// Function: get_is_active//// 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.virtualfunctionuvm_active_passive_enumget_is_active();returnis_active;
uvm_active_passive_enumis_active=UVM_ACTIVE;// TODO: Make ~is_active~ a field via field utils`uvm_component_abstract_utils(uvm_agent)// Function -- NODOCS -- new//// Creates and initializes an instance of this class using the normal// constructor arguments for <uvm_component>: ~name~ is the name of the// instance, and ~parent~ is the handle to the hierarchical parent, if any.//// The int configuration parameter is_active is used to identify whether this// agent should be acting in active or passive mode. This parameter can// be set by doing:////| uvm_config_int::set(this, "<relative_path_to_agent>, "is_active", UVM_ACTIVE);// @uvm-ieee 1800.2-2020 auto 13.4.2.1functionnew(stringname,uvm_componentparent);
// @uvm-ieee 1800.2-2020 auto 13.3.1virtualclassuvm_envextendsuvm_component;`uvm_component_abstract_utils(uvm_env)// Function -- NODOCS -- new//// Creates and initializes an instance of this class using the normal// constructor arguments for <uvm_component>: ~name~ is the name of the// instance, and ~parent~ is the handle to the hierarchical parent, if any.// @uvm-ieee 1800.2-2020 auto 13.3.2functionnew(stringname="env",uvm_componentparent=null);super.new(name,parent);endfunctionendclass
// @uvm-ieee 1800.2-2020 auto 13.2.1virtualclassuvm_testextendsuvm_component;`uvm_component_abstract_utils(uvm_test)// Function -- NODOCS -- new//// Creates and initializes an instance of this class using the normal// constructor arguments for <uvm_component>: ~name~ is the name of the// instance, and ~parent~ is the handle to the hierarchical parent, if any.// @uvm-ieee 1800.2-2020 auto 13.2.2functionnew(stringname,uvm_componentparent);super.new(name,parent);endfunctionendclass
// @uvm-ieee 1800.2-2020 auto 13.5.1virtualclassuvm_monitorextendsuvm_component;`uvm_component_abstract_utils(uvm_monitor)// Function -- NODOCS -- new//// Creates and initializes an instance of this class using the normal// constructor arguments for <uvm_component>: ~name~ is the name of the// instance, and ~parent~ is the handle to the hierarchical parent, if any.// @uvm-ieee 1800.2-2020 auto 13.5.2functionnew(stringname,uvm_componentparent);super.new(name,parent);endfunctionendclass
// @uvm-ieee 1800.2-2020 auto 13.6.1virtualclassuvm_scoreboardextendsuvm_component;`uvm_component_abstract_utils(uvm_scoreboard)// Function -- NODOCS -- new//// Creates and initializes an instance of this class using the normal// constructor arguments for <uvm_component>: ~name~ is the name of the// instance, and ~parent~ is the handle to the hierarchical parent, if any.functionnew(stringname,uvm_componentparent);super.new(name,parent);endfunctionendclass