Override Methdds

Hello,

Can anyone explain me the difference of using the set_type_override_by_type and set_type_override_by_name?
i am not getting any practical usage for using set type override by name. what ever we want to do we can do it with type override by type and inst override by type. then why this 2 methods by name are introduced in uvm?

Thanks in Advance :)

In reply to Dhanesh_Padia:
https://verificationacademy.com/forums/ovm/difference-between-settypeoverride-and-settypeoverridebyname

Set_type_override_by_type is used to override the component within the Test itself without touching the environment

Set_type_override_by_inst_name does the similar thing but the difference is with help of environment object handle it tries to change the object to some other object .

In reply to bhasker:

Set_type_override_by_type is used to override the component within the Test itself without touching the environment
Set_type_override_by_inst_name does the similar thing but the difference iswith help of environment object handle it tries to change the object to some other object .

Hi Bhasker,

Can you explain it in some detail or with any small example.

In reply to dave_59:

Thanks Dave,

I read this but not getting a clear idea about why to use override by name, because whatever we want to override can be overridden by type override by type or inst override by type.

In reply to Dhanesh_Padia:

I too prefer overrides by_type because your mistakes show up as compiler errors, rather than waiting for runtime error messages. But sometimes a string name is all you have to work with, e.g. if you are getting a name from the command line.