Overriding of components in UVM

if i want to override a existing driver by new driver do i need to create new test class or i can override with the existing test class??

This question makes it seem like you do not understand the difference between the test and the testbench. The driver is part of the testbench, and the test decides which things need to be overridden in the testbench.

If you modify an existing test class, then you have essentially created a new test by destroying the old test class. So the question back to you is do you want only one test, or two different tests?

Hi,
Just check this command to override a driver by instance
set_inst_override_by_type(“env_name.agent_name.old_driver”,old_driver::get_type(),new_driver::get_type());

new_driver is the class name which u might have extended from old_driver

No need to create a new test class I think

In reply to dave_59:

I want only one test.

In reply to anilhr:

If you only want one test (which I find unusual), then you can modify the existing test class and put the override in that test. But then you have lost the existing test. But then why didn’t just change the component you wanted at the place of its construction.

The point of the factory is so you can create many tests, with each test performing different overrides of components or other objects.