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
    • Sequences and Sequencers
      • try_next_item Loop That Never Lets Time Pass
      • When finish_item Returns
      • lock Versus grab Ordering
      • Inline Constraint That Constrains Nothing
      • Virtual Sequence Started With null
      • Default Sequence Ends at Time Zero
    • 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

←Sequences and Sequencers
  1. Topics
  2. DV Interview Puzzles
  3. UVM Testbench Puzzles
  4. Sequences and Sequencers
  5. Virtual Sequence Started With null
On this page

    VLSI DV Interview PuzzlesAll levels

    Virtual Sequence Started With null

    UVM 1.2. A virtual sequence uses `p_sequencer` to reach the sub-sequencers. The test starts it with `vseq.start(null)`, because 'a virtual sequence has no sequencer of its own'. What happens?

    Puzzle

    Difficulty: Easy · Puzzle 5 of 6 · Topic: Sequences and Sequencers

    UVM 1.2. A virtual sequence uses `p_sequencer` to reach the sub-sequencers. The test starts it with `vseq.start(null)`, because 'a virtual sequence has no sequencer of its own'. What happens?

    Code

    design.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    class top_vseq extends uvm_sequence;
      `uvm_object_utils(top_vseq)
      `uvm_declare_p_sequencer(top_vsqr)
      function new(string name = "top_vseq"); super.new(name); endfunction
      task body();
        sub_seq s = sub_seq::type_id::create("s");
        s.start(p_sequencer.a_sqr);
      endtask
    endclass
    
    // in the test run_phase
    top_vseq vseq = top_vseq::type_id::create("vseq");
    vseq.start(null);

    Hint

    Where does p_sequencer get its value?

    Step-by-step solution

    Diagram
    1) p_sequencer is set from m_sequencer when the sequence is started. With start(null) there is no sequencer, so p_sequencer remains null.
    2) The $cast generated by `uvm_declare_p_sequencer` succeeds with a null source, so there is no UVM message at start.
    3) body() then dereferences `p_sequencer.a_sqr`: a null-handle error at that line.
    4) Fix: instantiate a virtual sequencer (`top_vsqr`) in the env, give it handles to the real sequencers, and start the sequence on it: `vseq.start(env.vsqr)`.

    Answer

    Answer: p_sequencer stays null; body() dies on a null dereference at `p_sequencer.a_sqr`. Start the vseq on a virtual sequencer.

    How this was checked

    Not run here: The UVM library is not installed here, so this cannot be executed; p_sequencer is declared by the `uvm_declare_p_sequencer macro and set by uvm_sequence_base::start.. The answer follows the language rules and the solution steps above.

    Why candidates get it wrong

    start(null) is legal and produces no warning; it works only if the body never touches p_sequencer or m_sequencer. And starting on a sequencer of the wrong type is a different failure: `uvm_declare_p_sequencer` then raises a UVM_FATAL (DCLPSQ) at start.

    Interviewer follow-up

    Is a virtual sequencer required for virtual sequences? Model answer: no; a virtual sequence can also hold plain handles to the real sequencers and be started with start(null), but then the handles must be assigned by hand and there is no p_sequencer; the virtual sequencer is the conventional way to give every virtual sequence the same, typed access.

    Related topics

    • Back to Sequences and Sequencers

    • UVM Testbench Puzzles section

    Previous

    227 / 293

    Next: Default Sequence Ends at Time Zero

    Up next

    Up nextDefault Sequence Ends at Time Zero

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • try_next_item Loop That Never Lets Time Pass
    • When finish_item Returns
    • lock Versus grab Ordering