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. Virtual Interface Set with a Relative Path from Top
On this page

    VLSI DV Interview PuzzlesAll levels

    Virtual Interface Set with a Relative Path from Top

    UVM 1.2. The top module publishes the virtual interface with a null context and the path `env.agent.*`; the test class is my_test, run with `run_test("my_test")`. The driver's build_phase get() fails with NOVIF. Why?

    Puzzle

    Difficulty: Easy · Puzzle 1 of 6 · Topic: Factory and config_db

    UVM 1.2. The top module publishes the virtual interface with a null context and the path `env.agent.*`; the test class is my_test, run with `run_test("my_test")`. The driver's build_phase get() fails with NOVIF. Why?

    Code

    top.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    module top;
      bus_if vif(clk);
      initial begin
        uvm_config_db#(virtual bus_if)::set(null, "env.agent.*", "vif", vif);
        run_test("my_test");
      end
    endmodule
    
    // in my_driver.build_phase (full name is uvm_test_top.env.agent.drv)
    if (!uvm_config_db#(virtual bus_if)::get(this, "", "vif", vif))
      `uvm_fatal("NOVIF", "virtual interface not set")

    Hint

    With a null context the path is taken from the very top of the hierarchy. What is the full name of the test component?

    Step-by-step solution

    Diagram
    1) With cntxt == null the inst_name is an absolute pattern, matched against the full names of components, which all start with the test's instance name.
    2) The test is always instantiated as `uvm_test_top`, whatever the test class is called. The driver's full name is `uvm_test_top.env.agent.drv`.
    3) `env.agent.*` does not match it (missing the `uvm_test_top.` prefix), so get() returns 0 and the fatal fires.
    4) Fix: `uvm_config_db#(virtual bus_if)::set(null, "uvm_test_top.env.agent.*", "vif", vif)`, or a leading wildcard such as `*.agent.*`.

    Answer

    Answer: The pattern lacks the `uvm_test_top.` prefix; with a null context the path is absolute, so it never matches the driver.

    How this was checked

    Not run here: The UVM library is not installed here, so this cannot be executed; uvm_config_db path globbing and uvm_test_top naming are library behaviour; a stand-in would only restate the claim.. The answer follows the language rules and the solution steps above.

    Why candidates get it wrong

    The instance name `uvm_test_top` is fixed by run_test and has nothing to do with the test class name (`my_test`), so a path written from the class name is just as wrong.

    Interviewer follow-up

    Would `"uvm_test_top.env.agent"` (no `.*`) match the driver? Model answer: no; a pattern without a wildcard matches only the component with exactly that full name (the agent). To reach the agent and every child use `uvm_test_top.env.agent*` or set per child; the driver's get uses `(this, "", ...)` so its own full name is what is matched.

    Related topics

    • Back to Factory and config_db

    • UVM Testbench Puzzles section

    Previous

    217 / 293

    Next: Child Set Later, Parent Set Wins

    Up next

    Up nextChild Set Later, Parent Set Wins

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • Config Object Set as Base, Got as Derived
    • Config Set Too Late for build_phase
    • Factory Instance Override Path: Relative or Full