Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutRoadmapCareersInternshipsFAQContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Puzzle Bank
  • SystemVerilog Language Puzzles25
  • Difficulty Guide
  • Full Topic Map
  • Interview-Day Tips
  • Study Route: One Week Before the Interview
  • Study Route: Two Weeks
  • Study Route: Four Weeks (Full Course)4
  • OOP & Testbench Puzzles25
  • Concurrency & Timing Puzzles25
  • Randomization & Constraint Puzzles25
  • SVA Assertion Puzzles25
  • Functional Coverage Puzzles25
  • Logic & Aptitude Puzzles25
  • Scenario & Debug Puzzles25
  • UVM Testbench Puzzles25
    • UVM Phases and Objections
    • Factory and config_db
      • Virtual Interface Set with a Relative Path from Top
      • Child Set Later, Parent Set Wins
      • Config Object Set as Base, Got as Derived
      • Config Set Too Late for build_phase
      • Factory Instance Override Path: Relative or Full
      • Override of a Parameterized Component
    • Sequences and Sequencers
    • Analysis, Scoreboards and RAL
    • UVM Testbench Puzzles: Tricky Q&A
  • Clock, Reset & CDC Puzzles25
  • Bus and Interface Protocol Puzzles25
  • Interview Prep: Puzzle Rounds7
  • DV Puzzle Cheatsheet
Loading lesson

←Factory and config_db
  1. Topics
  2. DV Interview Puzzles
  3. UVM Testbench Puzzles
  4. Factory and config_db
  5. Factory Instance Override Path: Relative or Full
On this page

    VLSI DV Interview PuzzlesAll levels

    Factory Instance Override Path: Relative or Full

    UVM 1.2. Two tests want the same override of `base_drv` by `err_drv` for `env.agent.drv`. Test A calls the component method `set_inst_override_by_type`; test B calls the factory directly with the same string. Which test actually gets an err_drv, and why does the other get no message at all?

    Puzzle

    Difficulty: Medium · Puzzle 5 of 6 · Topic: Factory and config_db

    UVM 1.2. Two tests want the same override of `base_drv` by `err_drv` for `env.agent.drv`. Test A calls the component method `set_inst_override_by_type`; test B calls the factory directly with the same string. Which test actually gets an err_drv, and why does the other get no message at all?

    Code

    design.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    class test_a extends uvm_test;
      `uvm_component_utils(test_a)
      function new(string name, uvm_component parent); super.new(name, parent); endfunction
      function void build_phase(uvm_phase phase);
        super.build_phase(phase);
        set_inst_override_by_type("env.agent.drv", base_drv::get_type(), err_drv::get_type());
        env = my_env::type_id::create("env", this);
      endfunction
    endclass
    
    class test_b extends uvm_test;
      `uvm_component_utils(test_b)
      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();
        super.build_phase(phase);
        f.set_inst_override_by_type(base_drv::get_type(), err_drv::get_type(), "env.agent.drv");
        env = my_env::type_id::create("env", this);
      endfunction
    endclass

    Hint

    One of the two prefixes the path with something. Which?

    Step-by-step solution

    Diagram
    1) The component method `uvm_component::set_inst_override_by_type(relative_inst_path, ...)` prepends the calling component's full name, so test A applies it to `uvm_test_top.env.agent.drv`, which matches the real path of the driver.
    2) The factory's own method takes the full instance path as given. Test B's string `env.agent.drv` is matched against `uvm_test_top.env.agent.drv`, does not match, and the override is simply never applied.
    3) The factory does not warn about an override that never matches. Diagnose with `factory.print()` or `uvm_top.print_topology()` and fix with the full path (`uvm_test_top.env.agent.drv`) or a leading wildcard (`*.env.agent.drv`).

    Answer

    Answer: Test A gets err_drv; test B's path is missing the `uvm_test_top.` prefix and silently never matches.

    How this was checked

    Not run here: The UVM library is not installed here, so this cannot be executed; uvm_factory path matching is library behaviour; the claim rests on uvm_component::set_inst_override_by_type prepending get_full_name() in the UVM 1.2 source.. The answer follows the language rules and the solution steps above.

    Why candidates get it wrong

    Same method name, different path rules: the component method takes a path relative to the component, the factory method takes the full path, and an unmatched override is silent.

    Interviewer follow-up

    How do you find out which override fired for a given create? Model answer: call `factory.debug_create_by_type(base_drv::get_type(), "uvm_test_top.env.agent", "drv")` (or `factory.print()`), which prints the matching override chain for that type, parent path and name.

    Related topics

    • Back to Factory and config_db

    • UVM Testbench Puzzles section

    Previous

    221 / 293

    Next: Override of a Parameterized Component

    Up next

    Up nextOverride of a Parameterized Component

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • Virtual Interface Set with a Relative Path from Top
    • Child Set Later, Parent Set Wins
    • Config Object Set as Base, Got as Derived