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
      • Which Way Do the Phases Walk the Tree
      • Drain Time After the Last Drop
      • PASSED Banner Printed Before the Error
      • Derived build_phase Without super
      • phase_ready_to_end Never Extends
      • Creating a Component After Build
    • Factory and config_db
    • 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

←UVM Phases and Objections
  1. Topics
  2. DV Interview Puzzles
  3. UVM Testbench Puzzles
  4. UVM Phases and Objections
  5. Derived build_phase Without super
On this page

    VLSI DV Interview PuzzlesAll levels

    Derived build_phase Without super

    UVM 1.2. base_env builds its agent in build_phase. my_env extends it, overrides build_phase to add a scoreboard, and forgets `super.build_phase(phase)`. Where does it fail and why?

    Puzzle

    Difficulty: Easy · Puzzle 4 of 6 · Topic: UVM Phases and Objections

    UVM 1.2. base_env builds its agent in build_phase. my_env extends it, overrides build_phase to add a scoreboard, and forgets `super.build_phase(phase)`. Where does it fail and why?

    Code

    design.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    class base_env extends uvm_env;
      `uvm_component_utils(base_env)
      my_agent agent;
      function new(string name, uvm_component parent); super.new(name, parent); endfunction
      function void build_phase(uvm_phase phase);
        super.build_phase(phase);
        agent = my_agent::type_id::create("agent", this);
      endfunction
    endclass
    
    class my_env extends base_env;
      `uvm_component_utils(my_env)
      my_sb sb;
      function new(string name, uvm_component parent); super.new(name, parent); endfunction
      function void build_phase(uvm_phase phase);
        sb = my_sb::type_id::create("sb", this);   // no super.build_phase(phase)
      endfunction
      function void connect_phase(uvm_phase phase);
        agent.mon.ap.connect(sb.exp_imp);
      endfunction
    endclass

    Hint

    Which build_phase creates `agent`, and is it called at all?

    Step-by-step solution

    Diagram
    1) my_env.build_phase overrides base_env.build_phase completely; without super.build_phase the base's body never runs.
    2) So `agent` is never created and stays null.
    3) Nothing complains during build. The failure is a null-handle dereference at the first use, in my_env.connect_phase (`agent.mon`), at time 0.
    4) Fix: call super.build_phase(phase) first (and in every derived build_phase; it also runs the UVM base build_phase work).

    Answer

    Answer: agent is never created (null); the null dereference shows up in my_env.connect_phase at time 0, not in build.

    How this was checked

    Checked by running the code in Verilator 5; the printed output supports the answer above. Hand-written model of the documented UVM 1.2 behaviour in plain SystemVerilog (Verilator), not the UVM library: a base class that builds in build(); the derived override without super leaves the base's child null.

    Why candidates get it wrong

    The error is reported where `agent` is used (connect_phase, a different phase and function from the cause) and it is a simulator null-object error, not a UVM message, so the log never mentions build_phase or super.

    Interviewer follow-up

    Is it enough to move the `agent` creation into my_env.build_phase instead? Model answer: it would work for this one class, but any other class deriving from base_env would repeat the problem, and skipping super.build_phase also skips uvm_component's own build_phase work (in UVM 1.2 that is where automatic configuration of `uvm_field_*` fields from uvm_config_db is applied), so always call super.

    Related topics

    • Back to UVM Phases and Objections

    • UVM Testbench Puzzles section

    Previous

    214 / 293

    Next: phase_ready_to_end Never Extends

    Up next

    Up nextphase_ready_to_end Never Extends

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • Which Way Do the Phases Walk the Tree
    • Drain Time After the Last Drop
    • Creating a Component After Build