The UVM Factory: Registration, create() and Overrides, Tested on One Bench

In short: The UVM factory decides which class gets built when your code asks for one. Register each class with a uvm_component_utils or uvm_object_utils macro and build it with type_id::create(), never new(). Then a test can swap any class for a child class, everywhere (type override) or at one path (instance override), without touching the code that builds it.

The factory is the reason one UVM environment can run a clean test, an error test and a corner-case test with no edits. It’s also a favourite interview question. So I built one small bench, ran it nine ways on VCS, and every output block below is what it printed.

A simple way to picture it

Think of ordering a coffee at a counter. You say “latte” and you get a latte; you don’t care who makes it.

Now the manager pins a note behind the counter: “today, every latte is made with oat milk”. You still order the same way, but you get something different. The factory is that counter, and an override is the note.

UVM factory override lookup: create() checks an instance override on the path first, then a type override, then builds the requested class
What the factory checks when create() runs, with results from the bench

Step 1: register the class

One macro tells the factory a class exists. Components use uvm_component_utils; objects such as sequence items and sequences use uvm_object_utils.

class tav_driver extends uvm_component;
  `uvm_component_utils(tav_driver)
  function new(string name, uvm_component parent);
    super.new(name, parent);
  endfunction
endclass

class tav_item extends uvm_sequence_item;
  `uvm_object_utils(tav_item)
  function new(string name = "tav_item");
    super.new(name);
  endfunction
endclass

The macro adds a type_id inside the class. That’s the handle you use for create() and for every override call.

Step 2: build with create(), not new()

create() asks the factory for an object, and the factory decides which class to build. new() builds exactly the class you wrote, and the factory never hears about it.

// in tav_agent::build_phase
drv = tav_driver::type_id::create("drv", this);   // through the factory
mon = new("mon", this);                           // plain new(): factory never asked

The bench builds the monitor with new() on purpose, so you can see what that costs.

Type override: swap the class everywhere

A type override says “wherever someone asks for A, build B”. B has to be a child of A.

function void build_phase(uvm_phase phase);
  tav_driver::type_id::set_type_override(tav_err_driver::get_type());
  tav_monitor::type_id::set_type_override(tav_err_monitor::get_type());
  tav_item::type_id::set_type_override(tav_err_item::get_type());
  super.build_phase(phase);
endfunction
UVM_INFO testbench.sv(149) @ 0: uvm_test_top [TAV_WHO] uvm_test_top.env.agt0.drv is tav_err_driver (error-injecting driver)
UVM_INFO testbench.sv(151) @ 0: uvm_test_top [TAV_WHO] uvm_test_top.env.agt0.mon is tav_monitor
UVM_INFO testbench.sv(149) @ 0: uvm_test_top [TAV_WHO] uvm_test_top.env.agt1.drv is tav_err_driver (error-injecting driver)
UVM_INFO testbench.sv(151) @ 0: uvm_test_top [TAV_WHO] uvm_test_top.env.agt1.mon is tav_monitor
UVM_INFO testbench.sv(155) @ 0: uvm_test_top [TAV_WHO] item is tav_err_item

Both drivers and the item changed. Both monitors stayed tav_monitor, even though the test overrode that type too, because the agent builds the monitor with new() and the factory never sees it.

Instance override: swap it at one path

An instance override changes one place in the tree. The path is relative to the component that sets it, here the test.

tav_driver::type_id::set_inst_override(tav_err_driver::get_type(), "env.agt1.drv", this);
UVM_INFO testbench.sv(149) @ 0: uvm_test_top [TAV_WHO] uvm_test_top.env.agt0.drv is tav_driver (normal driver)
UVM_INFO testbench.sv(149) @ 0: uvm_test_top [TAV_WHO] uvm_test_top.env.agt1.drv is tav_err_driver (error-injecting driver)

Only agt1’s driver changed. The factory print stores the full path, uvm_test_top.env.agt1.drv, built from the relative path and the test’s own name.

Type and instance override together: which one wins?

tav_both_test sets a type override to tav_err_driver and an instance override on env.agt1.drv to tav_slow_driver.

UVM_INFO testbench.sv(149) @ 0: uvm_test_top [TAV_WHO] uvm_test_top.env.agt0.drv is tav_err_driver (error-injecting driver)
UVM_INFO testbench.sv(149) @ 0: uvm_test_top [TAV_WHO] uvm_test_top.env.agt1.drv is tav_slow_driver (slow driver)

The instance override won at agt1, and the type override covered everything else. So when create() runs, the factory looks for an instance override on that exact path first, and only then for a type override.

That gives you a handy pattern: a type override for the whole testbench, plus an instance override for the one place that should be different.

Does the override have to come before super.build_phase()?

This is the rule most people learn, so tav_late_test breaks it on purpose: it creates the env first and sets the type override after.

UVM_INFO testbench.sv(149) @ 0: uvm_test_top [TAV_WHO] uvm_test_top.env.agt0.drv is tav_err_driver (error-injecting driver)
UVM_INFO testbench.sv(149) @ 0: uvm_test_top [TAV_WHO] uvm_test_top.env.agt1.drv is tav_err_driver (error-injecting driver)

The late override still worked. The test’s build_phase only creates the env; the drivers are created later, when each agent’s build_phase runs, and by then the override is in place.

So the rule is narrower than “before super.build_phase()”: an override has to be set before the create() call it should affect. Setting overrides first is still the safe habit, because then you never have to work out which create() runs when.

Overriding with a class that doesn’t fit

tav_bad_test asks the factory to build tav_other, which isn’t a tav_driver at all, wherever a tav_driver is wanted.

UVM_FATAL @ 0: reporter [FCTTYP] Factory did not return a component of type 'tav_driver'. A component of type 'tav_other' was returned instead. Name=drv Parent=tav_agent contxt=uvm_test_top.env.agt0

set_type_override took the bad class without a word. The run only died later, at the first create() of a driver, with a UVM_FATAL that names the class, the instance and its parent.

Override by name: strings instead of types

Every override also has a string form. You pass class names as strings, so it works when the class is only known at run time, from a plusarg or a config file.

uvm_factory f = uvm_factory::get();
f.set_type_override_by_name("tav_driver", "tav_err_driver");
f.set_inst_override_by_name("tav_driver", "tav_slow_driver",
                            {get_full_name(), ".env.agt1.drv"});   // full path

Two differences from the type form. The instance version takes a full path, with no this to start from, and nothing checks the strings at compile time.

UVM_INFO testbench.sv(149) @ 0: uvm_test_top [TAV_WHO] uvm_test_top.env.agt0.drv is tav_err_driver (error-injecting driver)
UVM_INFO testbench.sv(149) @ 0: uvm_test_top [TAV_WHO] uvm_test_top.env.agt1.drv is tav_slow_driver (slow driver)

The same result as tav_both_test, and the factory print was the same too: one instance override at uvm_test_top.env.agt1.drv, one type override. Once it’s set, an override by name is just an override.

tav_name_typo_test makes the classic mistake on purpose: "tav_err_drvier".

UVM_INFO @ 0: reporter [RNTST] Running test tav_name_typo_test...
UVM_ERROR @ 0: reporter [TYPNTF] Cannot register override for original type 'tav_driver' because the override type 'tav_err_drvier' is not registered with the factory.
UVM_FATAL @ 0: reporter [BUILDERR] stopping due to build errors

The typo compiled fine, as strings always do, and the factory caught it at run time, right at the override call. It’s a UVM_ERROR there, and UVM then stops the whole run with a BUILDERR fatal before anything is built.

Compare that with tav_bad_test: a real, registered class of the wrong kind got through the override call and only failed at create(). The type form would have caught this typo at compile time, so prefer it whenever you can.

Override from the command line

UVM also reads overrides from plusargs, so you can swap a class without writing a test at all.

+UVM_TESTNAME=tav_base_test +uvm_set_type_override=tav_driver,tav_err_driver
UVM_INFO @ 0: reporter [UVM_CMDLINE_PROC] Applying type override from the command line: +uvm_set_type_override=tav_driver,tav_err_driver
UVM_INFO testbench.sv(149) @ 0: uvm_test_top [TAV_WHO] uvm_test_top.env.agt0.drv is tav_err_driver (error-injecting driver)
UVM_INFO testbench.sv(149) @ 0: uvm_test_top [TAV_WHO] uvm_test_top.env.agt1.drv is tav_err_driver (error-injecting driver)

Same result as tav_type_test for the drivers, with no new test class. UVM says so in the log, which helps when someone reruns a regression and wonders why the drivers changed.

Debugging: ask the factory what it knows

uvm_factory::get().print() lists every override the factory holds. get() is a static method, so it hands back the one factory without any object. Every test in the bench calls it in end_of_elaboration_phase, after the whole tree is built.

From the tav_both_test run (the list of 68 registered types is cut short here):

#### Factory Configuration (*)

Instance Overrides:

  Requested Type  Override Path              Override Type  
  --------------  -------------------------  ---------------
  tav_driver      uvm_test_top.env.agt1.drv  tav_slow_driver

Type Overrides:

  Requested Type  Override Type            
  --------------  -------------------------
  tav_driver      tav_err_driver

All types registered with the factory: 68 total

When an override doesn’t seem to work, this print tells you whether the factory has it at all, and at which full path.

Side by side

Type override Instance override By name Command line
Call set_type_override set_inst_override set_type_override_by_name, set_inst_override_by_name +uvm_set_type_override=A,B
Changes Every create() of that class One path in the tree Same as the type or instance form Every create() of that class
Typo in a class name Compile error Compile error UVM_ERROR at run time Run time (not tried in the bench)
Needs a new test Yes Yes Yes No
Typical use All drivers inject errors Only one agent misbehaves Class name comes from a string Quick experiment from a script

Which one to use

Use a type override when the whole testbench should change, like every driver injecting errors. Use an instance override when one interface out of several should behave differently.

Keep the command-line form for quick experiments. For anything you’ll run in regression, write the override into a test so the test name tells the story.

The bench: one file, nine runs

Everything above comes from one file, tav_factory.sv (download it as a zip, 2 KB). Paste it into testbench.sv on EDA Playground, pick UVM 1.2, leave design.sv empty and set the top module to tav_top.

You pick the test at run time, so the file compiles once.

Run Run options What it shows
1 +UVM_TESTNAME=tav_base_test No overrides
2 +UVM_TESTNAME=tav_type_test Type override on driver, monitor and item
3 +UVM_TESTNAME=tav_inst_test Instance override on env.agt1.drv
4 +UVM_TESTNAME=tav_both_test Type and instance override together
5 +UVM_TESTNAME=tav_late_test Type override set after super.build_phase()
6 +UVM_TESTNAME=tav_bad_test Override with a class that doesn’t fit
7 +UVM_TESTNAME=tav_base_test +uvm_set_type_override=tav_driver,tav_err_driver Override from the command line
8 +UVM_TESTNAME=tav_name_test Type and instance override by name
9 +UVM_TESTNAME=tav_name_typo_test Override by name with a typo

The full code: tav_factory.sv

// tav_factory.sv : the UVM factory, create() vs new(), type and instance overrides.
// The Art of Verification (theartofverification.com)
//
// Run on: Synopsys VCS with UVM 1.2 (EDA Playground).
// Paste into testbench.sv, leave design.sv empty. Top module: tav_top.
// All messages go through `uvm_info / `uvm_error.
//
// One env, two agents. Each agent builds its driver with type_id::create()
// and its monitor with plain new(). Every test prints which class each one
// really got, then the factory's own list of overrides.
//
// Pick the test with a run option:
//   +UVM_TESTNAME=tav_base_test   no overrides
//   +UVM_TESTNAME=tav_type_test   type override: every tav_driver becomes tav_err_driver
//                                 (also tries to override the monitor and the item)
//   +UVM_TESTNAME=tav_inst_test   instance override: only env.agt1.drv changes
//   +UVM_TESTNAME=tav_both_test   type override plus an instance override on agt1:
//                                 which one wins?
//   +UVM_TESTNAME=tav_late_test   type override set AFTER super.build_phase()
//   +UVM_TESTNAME=tav_bad_test    override with a class that isn't a tav_driver
//
// And one without code changes:
//   +UVM_TESTNAME=tav_base_test +uvm_set_type_override=tav_driver,tav_err_driver

`timescale 1ns/1ps
`include "uvm_macros.svh"

package tav_fac_pkg;
  import uvm_pkg::*;

  // ------------------------------------------------------------------ item
  class tav_item extends uvm_sequence_item;
    `uvm_object_utils(tav_item)
    rand bit [7:0] data;
    function new(string name = "tav_item");
      super.new(name);
    endfunction
  endclass

  class tav_err_item extends tav_item;
    `uvm_object_utils(tav_err_item)
    function new(string name = "tav_err_item");
      super.new(name);
    endfunction
  endclass

  // ------------------------------------------------------------ drivers
  class tav_driver extends uvm_component;
    `uvm_component_utils(tav_driver)
    function new(string name, uvm_component parent);
      super.new(name, parent);
    endfunction
    virtual function string what();
      return "normal driver";
    endfunction
  endclass

  class tav_err_driver extends tav_driver;
    `uvm_component_utils(tav_err_driver)
    function new(string name, uvm_component parent);
      super.new(name, parent);
    endfunction
    virtual function string what();
      return "error-injecting driver";
    endfunction
  endclass

  class tav_slow_driver extends tav_driver;
    `uvm_component_utils(tav_slow_driver)
    function new(string name, uvm_component parent);
      super.new(name, parent);
    endfunction
    virtual function string what();
      return "slow driver";
    endfunction
  endclass

  // not a tav_driver at all
  class tav_other extends uvm_component;
    `uvm_component_utils(tav_other)
    function new(string name, uvm_component parent);
      super.new(name, parent);
    endfunction
  endclass

  // ----------------------------------------------------------- monitors
  class tav_monitor extends uvm_component;
    `uvm_component_utils(tav_monitor)
    function new(string name, uvm_component parent);
      super.new(name, parent);
    endfunction
  endclass

  class tav_err_monitor extends tav_monitor;
    `uvm_component_utils(tav_err_monitor)
    function new(string name, uvm_component parent);
      super.new(name, parent);
    endfunction
  endclass

  // -------------------------------------------------------------- agent
  class tav_agent extends uvm_component;
    `uvm_component_utils(tav_agent)
    tav_driver  drv;
    tav_monitor mon;
    function new(string name, uvm_component parent);
      super.new(name, parent);
    endfunction
    function void build_phase(uvm_phase phase);
      super.build_phase(phase);
      drv = tav_driver::type_id::create("drv", this);   // through the factory
      mon = new("mon", this);                           // plain new(): factory never asked
    endfunction
  endclass

  // ---------------------------------------------------------------- env
  class tav_env extends uvm_env;
    `uvm_component_utils(tav_env)
    tav_agent agt0, agt1;
    function new(string name, uvm_component parent);
      super.new(name, parent);
    endfunction
    function void build_phase(uvm_phase phase);
      super.build_phase(phase);
      agt0 = tav_agent::type_id::create("agt0", this);
      agt1 = tav_agent::type_id::create("agt1", this);
    endfunction
  endclass

  // -------------------------------------------------------------- tests
  class tav_base_test extends uvm_test;
    `uvm_component_utils(tav_base_test)
    tav_env env;
    function new(string name, uvm_component parent);
      super.new(name, parent);
    endfunction

    function void build_phase(uvm_phase phase);
      super.build_phase(phase);
      env = tav_env::type_id::create("env", this);
    endfunction

    function void end_of_elaboration_phase(uvm_phase phase);
      tav_agent agts[2];
      tav_item  it;
      agts[0] = env.agt0;
      agts[1] = env.agt1;
      foreach (agts[i]) begin
        `uvm_info("TAV_WHO", $sformatf("%s is %s (%s)", agts[i].drv.get_full_name(),
                  agts[i].drv.get_type_name(), agts[i].drv.what()), UVM_LOW)
        `uvm_info("TAV_WHO", $sformatf("%s is %s", agts[i].mon.get_full_name(),
                  agts[i].mon.get_type_name()), UVM_LOW)
      end
      it = tav_item::type_id::create("it");
      `uvm_info("TAV_WHO", {"item is ", it.get_type_name()}, UVM_LOW)
      uvm_factory::get().print();
    endfunction
  endclass

  class tav_type_test extends tav_base_test;
    `uvm_component_utils(tav_type_test)
    function new(string name, uvm_component parent);
      super.new(name, parent);
    endfunction
    function void build_phase(uvm_phase phase);
      tav_driver::type_id::set_type_override(tav_err_driver::get_type());
      tav_monitor::type_id::set_type_override(tav_err_monitor::get_type());
      tav_item::type_id::set_type_override(tav_err_item::get_type());
      super.build_phase(phase);
    endfunction
  endclass

  class tav_inst_test extends tav_base_test;
    `uvm_component_utils(tav_inst_test)
    function new(string name, uvm_component parent);
      super.new(name, parent);
    endfunction
    function void build_phase(uvm_phase phase);
      tav_driver::type_id::set_inst_override(tav_err_driver::get_type(), "env.agt1.drv", this);
      super.build_phase(phase);
    endfunction
  endclass

  class tav_both_test extends tav_base_test;
    `uvm_component_utils(tav_both_test)
    function new(string name, uvm_component parent);
      super.new(name, parent);
    endfunction
    function void build_phase(uvm_phase phase);
      tav_driver::type_id::set_type_override(tav_err_driver::get_type());
      tav_driver::type_id::set_inst_override(tav_slow_driver::get_type(), "env.agt1.drv", this);
      super.build_phase(phase);
    endfunction
  endclass

  class tav_late_test extends tav_base_test;
    `uvm_component_utils(tav_late_test)
    function new(string name, uvm_component parent);
      super.new(name, parent);
    endfunction
    function void build_phase(uvm_phase phase);
      super.build_phase(phase);                 // env is created here...
      tav_driver::type_id::set_type_override(tav_err_driver::get_type());   // ...override after
    endfunction
  endclass

  class tav_bad_test extends tav_base_test;
    `uvm_component_utils(tav_bad_test)
    function new(string name, uvm_component parent);
      super.new(name, parent);
    endfunction
    function void build_phase(uvm_phase phase);
      tav_driver::type_id::set_type_override(tav_other::get_type());
      super.build_phase(phase);
    endfunction
  endclass

  // Override by name: strings instead of types. Run with
  //   +UVM_TESTNAME=tav_name_test        type and instance override by name
  //   +UVM_TESTNAME=tav_name_typo_test   same, with a typo in the class name
  class tav_name_test extends tav_base_test;
    `uvm_component_utils(tav_name_test)
    function new(string name, uvm_component parent);
      super.new(name, parent);
    endfunction
    function void build_phase(uvm_phase phase);
      uvm_factory f = uvm_factory::get();
      f.set_type_override_by_name("tav_driver", "tav_err_driver");
      f.set_inst_override_by_name("tav_driver", "tav_slow_driver",
                                  {get_full_name(), ".env.agt1.drv"});   // full path
      super.build_phase(phase);
    endfunction
  endclass

  class tav_name_typo_test extends tav_base_test;
    `uvm_component_utils(tav_name_typo_test)
    function new(string name, uvm_component parent);
      super.new(name, parent);
    endfunction
    function void build_phase(uvm_phase phase);
      uvm_factory f = uvm_factory::get();
      f.set_type_override_by_name("tav_driver", "tav_err_drvier");      // typo, on purpose
      super.build_phase(phase);
    endfunction
  endclass
endpackage

module tav_top;
  import uvm_pkg::*;
  import tav_fac_pkg::*;

  initial run_test();
endmodule

What VCS printed

VCS X-2025.06-SP1 with UVM 1.2. Here is the full tav_base_test run; the other eight printed the same shape, and their key lines are in the sections above. The list of registered types also holds UVM’s own classes, so I’ve kept only ours (it said 68 before the two by-name tests were added, 70 after).

UVM_INFO @ 0: reporter [RNTST] Running test tav_base_test...
UVM_INFO testbench.sv(149) @ 0: uvm_test_top [TAV_WHO] uvm_test_top.env.agt0.drv is tav_driver (normal driver)
UVM_INFO testbench.sv(151) @ 0: uvm_test_top [TAV_WHO] uvm_test_top.env.agt0.mon is tav_monitor
UVM_INFO testbench.sv(149) @ 0: uvm_test_top [TAV_WHO] uvm_test_top.env.agt1.drv is tav_driver (normal driver)
UVM_INFO testbench.sv(151) @ 0: uvm_test_top [TAV_WHO] uvm_test_top.env.agt1.mon is tav_monitor
UVM_INFO testbench.sv(155) @ 0: uvm_test_top [TAV_WHO] item is tav_item
UVM_INFO .../uvm-1.2/src/base/uvm_factory.svh(1645) @ 0: reporter [UVM/FACTORY/PRINT] 
#### Factory Configuration (*)

  No instance or type overrides are registered with this factory

All types registered with the factory: 68 total
  Type Name
  ---------
  ...
  tav_agent
  tav_bad_test
  tav_base_test
  tav_both_test
  tav_driver
  tav_env
  tav_err_driver
  tav_err_item
  tav_err_monitor
  tav_inst_test
  tav_item
  tav_late_test
  tav_monitor
  tav_other
  tav_slow_driver
  tav_type_test

** Report counts by severity
UVM_INFO :    8
UVM_WARNING :    0
UVM_ERROR :    0
UVM_FATAL :    0
Run agt0.drv agt1.drv monitors item
tav_base_test tav_driver tav_driver tav_monitor tav_item
tav_type_test tav_err_driver tav_err_driver tav_monitor tav_err_item
tav_inst_test tav_driver tav_err_driver tav_monitor tav_item
tav_both_test tav_err_driver tav_slow_driver tav_monitor tav_item
tav_late_test tav_err_driver tav_err_driver tav_monitor tav_item
tav_bad_test UVM_FATAL [FCTTYP] at the first driver
command line tav_err_driver tav_err_driver tav_monitor tav_item
tav_name_test tav_err_driver tav_slow_driver tav_monitor tav_item
tav_name_typo_test UVM_ERROR [TYPNTF], then UVM_FATAL [BUILDERR]

Common mistakes (and the fix for each)

1. Building with new(). In tav_type_test the monitor override was set, the factory print listed it, and both monitors were still tav_monitor, because they’re built with new(). Fix: build every component and object with type_id::create().

2. Forgetting the registration macro. Without uvm_component_utils there’s no type_id, so create() and the overrides don’t even compile. Fix: one macro per class, first line inside the class.

3. A wrong path in an instance override. The path is relative to the component that sets it, and a typo matches nothing, quietly. Fix: copy the path from get_full_name() or the topology print, and check the factory print.

4. Overriding with a class that isn’t a child. The override call itself is accepted; the run dies later with UVM_FATAL [FCTTYP] at the first create(). Fix: the new class must extend the one it replaces.

5. Setting the override too late. In tav_late_test the override came after super.build_phase() and still reached both drivers, because they’re created later in the agents. The real rule: set it before the create() it should change. Fix: set overrides at the top of build_phase anyway, so you never have to think about it.

6. A typo in an override by name. It compiles, then the run stops with UVM_ERROR [TYPNTF] and UVM_FATAL [BUILDERR], as tav_name_typo_test showed. Fix: use the type form, get_type(), unless the class name really has to come from a string.

Where AI helps, and where it doesn’t

An AI assistant is quick at the boilerplate: the macro, the constructor, the type_id::create line for every member. It’s also good at turning “only the second agent should inject errors” into the right set_inst_override call.

What it can’t tell you is what your UVM version prints, or whether a late override still reaches a component deep in the tree. That’s what the nine runs are for.

Practice challenge

Add a third agent, agt2, and write one test where agt0 gets tav_err_driver, agt1 gets tav_slow_driver and agt2 stays normal. Use as few override calls as you can.

Then change the agent to build the monitor with create() and run tav_type_test again.

FAQ

What is the UVM factory? It’s a table inside UVM that decides which class to build when your code calls type_id::create(). Overrides change the table, so a test can swap a class without editing the code that builds it.

What is the difference between new() and create()? new() builds exactly the class you name. create() asks the factory, which may return a child class if an override is set.

What is the difference between a type override and an instance override? A type override replaces a class everywhere it’s created. An instance override replaces it only at one path in the tree.

Which wins, a type override or an instance override? The instance override, at its own path. In tav_both_test, agt1 got the instance override’s tav_slow_driver and agt0 got the type override’s tav_err_driver.

Can I override a sequence item? Yes, the same way: tav_item::type_id::set_type_override(...), as long as the item is built with create().

How do I see which overrides are active? Call uvm_factory::get().print() after the build, for example in end_of_elaboration_phase.

What is override by name? The same override, with class names passed as strings: set_type_override_by_name("tav_driver", "tav_err_driver"). It gave the same result as the type form in the bench, but a misspelled name only shows up at run time.

References

  • Accellera UVM 1.2 Class Reference: uvm_factory, uvm_component_registry, uvm_object_registry.
  • IEEE 1800.2-2020, UVM standard: section 8 (factory classes).
  • Accellera UVM 1.2 User’s Guide: the factory and overrides.

Keep learning

To see where every create() call lives in a full bench, read the UVM testbench architecture guide, and UVM phasing explains why build_phase runs top-down, which is why the late override still worked. If you’re still deciding whether UVM is worth it, the factory is one of the main advantages of UVM over plain SystemVerilog.

There’s more in the UVM category, the SystemVerilog category and the interview questions.