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

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Puzzle Bank
  • SystemVerilog Language Puzzles25
  • Difficulty Guide
  • Full Topic Map
  • Interview-Day Tips
  • OOP & Testbench Puzzles25
  • Concurrency & Timing Puzzles25
  • Randomization & Constraint Puzzles25
  • SVA Assertion Puzzles25
  • Functional Coverage Puzzles25
  • Logic & Aptitude Puzzles25
    • Classic Brain Teasers
    • Probability Puzzles
    • Digital Logic Puzzles
    • Debugging Riddles
      • Scoreboard Sees Previous-Cycle Data
      • Reset Release Causes Occasional X State
      • always_comb with NBA and Missing Else
      • UVM Analysis Port Handle Reuse
      • join_any Timeout Ghost Thread
      • Randomization Always Fails: Hidden Unsat
    • Logic & Aptitude Puzzles: Tricky Q&A
  • Scenario & Debug Puzzles25
  • Interview Prep: Puzzle Rounds5
  • DV Puzzle Cheatsheet
Loading lesson

‹Debugging Riddles
  1. Topics
  2. DV Interview Puzzles
  3. Logic & Aptitude Puzzles
  4. Debugging Riddles
  5. UVM Analysis Port Handle Reuse

VLSI DV Interview Puzzles · All levels

UVM Analysis Port Handle Reuse

Scoreboard queue entries appear to change after insertion. Locate the monitor bug.

On this page

    Puzzle

    Difficulty: Hard · Puzzle 4 of 6 · Topic: Debugging Riddles

    Scoreboard queue entries appear to change after insertion. Locate the monitor bug.

    Code

    design.sv
    1
    2
    3
    4
    5
    6
    7
    task run_phase(uvm_phase phase);
      tr t = tr::type_id::create("t");
      forever begin
        collect_fields(t);
        ap.write(t);
      end
    endtask

    Hint

    Analysis ports pass object handles, not deep copies.

    Step-by-step solution

    Diagram
    1) Same object t is reused every iteration.
    2) Subscribers store handle to t; later collect_fields overwrites same object.
    3) Scoreboard then sees previously queued entries mutate, appearing as random corruption.
    4) Fix: create new object each transaction or clone before write (ap.write(t.clone())).
    5) Also ensure do_copy/do_clone perform deep copy for dynamic fields.

    Answer

    Answer: The monitor reuses one transaction handle; clone/new per sample before ap.write.

    Why candidates get it wrong

    Assuming `write()` implies by-value transfer.

    Interviewer follow-up

    Which fields require explicit deep-copy logic in `do_copy`?

    Related topics

    • Back to Debugging Riddles

    • Logic & Aptitude Puzzles section

    Previous

    176 / 210

    Next: join_any Timeout Ghost Thread

    Up next

    Up nextjoin_any Timeout Ghost Thread

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Scoreboard Sees Previous-Cycle Data
    • Reset Release Causes Occasional X State
    • Randomization Always Fails: Hidden Unsat