Set_type_override -- how do you use it
Anonymous
The set_type_override can be used in several ways : 1- set_type_override_by_type( original_type, override_type) :- When we are using overriding by type here the original_type and override_type are the handles to the type of objects , thus the preregistration of the objects are not required . 2- set_type_override_by_name(original_type_name, override_type_name) :- When we are using overriding by name then the original_type_name must be registered to the factory . Here the type_name refers to the name of the object/component registered to the factory using `uvm_component_utils macros . 3- type override can also be done by uvm registry method : uvm_component_registry#(T,Tname)::set_type_override(override_type) How to use it ? 1- Register all the uvm types with the factory method ( `uvm_component_utils(class_name) / `uvm_object_utils(object_name) 2- Create the instances using the factory create call method . We must ensure that all the objects /components must be create() method rather than new() for factory overriding . 3- After which write the object /component u wnat to override and then call the override method For example I want specific stimulus to be generated thus I have created another transaction class (short_yapp class) extending the original transaction class (yapp_packet class) . -> If want to override this by set_type_override_by_type :- Syntax :- set_type_override_by_type( yapp_packet::get_type(), short_yapp::get_type()) -> if we want to override by set_type_override_by_name :- Syntax :- set_type_override_by_type( yapp_packet::type_name, short_yapp::type_name)
Check out your Company Bowl for anonymous work chats.