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
    • Testbench Debug Puzzles: Why Did the Test Hang?
    • Deadlock Scenario Puzzles: Objection and Phase Stalls
    • Scoreboard Puzzles: Mismatch or Ordering Bug?
      • Out-of-Order Responses Miscompared as Corruption
      • Missing First Transaction After Reset
      • Duplicate Transactions from Handle Reuse
      • Mismatch Cascade After One Lost Item
      • End-of-Test Draining Missing
      • Duplicate Expected Entries from Predictor Retry Path
    • Real Interview Rounds: End-to-End Debug Walkthrough
    • Scenario & Debug Puzzles: Tricky Q&A
  • UVM Testbench Puzzles25
  • Clock, Reset & CDC Puzzles25
  • Bus and Interface Protocol Puzzles25
  • Interview Prep: Puzzle Rounds7
  • DV Puzzle Cheatsheet
Loading lesson

←Scoreboard Puzzles: Mismatch or Ordering Bug?
  1. Topics
  2. DV Interview Puzzles
  3. Scenario & Debug Puzzles
  4. Scoreboard Puzzles: Mismatch or Ordering Bug?
  5. Duplicate Transactions from Handle Reuse
On this page

    VLSI DV Interview PuzzlesAll levels

    Duplicate Transactions from Handle Reuse

    Scoreboard sees duplicate packets with changing fields, and old entries mutate in logs. Find why data appears to rewrite history.

    Puzzle

    Difficulty: Easy · Puzzle 3 of 6 · Topic: Scoreboard Puzzles: Mismatch or Ordering Bug?

    Scoreboard sees duplicate packets with changing fields, and old entries mutate in logs. Find why data appears to rewrite history.

    Code

    design.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    class rsp_monitor extends uvm_component;
      uvm_analysis_port #(txn) ap;
      txn t;
      virtual task run_phase(uvm_phase phase);
        t = txn::type_id::create("t");
        forever begin
          sample_bus_into(t);
          ap.write(t); // same handle every time
        end
      endtask
    endclass

    Hint

    Analysis ports pass object handles, not value copies.

    Step-by-step solution

    Diagram
    1) Print object handles/ids in scoreboard to confirm same pointer repeats.
    2) Observe later sampling mutates previously queued entries.
    3) Clone transaction before ap.write or allocate a new object each sample.
    4) In scoreboard, optionally clone on receipt for defensive isolation.
    5) Add checker that flags repeated handle reuse across writes.

    Answer

    Answer: Bug: monitor publishes the same transaction handle repeatedly; subscribers see mutated duplicates. Fix: clone/new transaction per write boundary.

    How this was checked

    Checked by running the code in Verilator 5; the printed output supports the answer above. Plain-SV model of handle reuse: one object pushed three times shows the last value three times, a new object per sample keeps history.

    Why candidates get it wrong

    Compare logic can look broken even though ingestion semantics are wrong.

    Interviewer follow-up

    Which side should own defensive cloning: producer, consumer, or both? Model answer: The producer should always publish a fresh object (it owns object identity). The consumer clones only when it stores or mutates the item beyond the write() call; doing both everywhere costs allocation for no benefit.

    Say it out loud

    First I check whether the duplicates are real DUT traffic or a testbench artifact, by comparing handle values in the log. The root cause is that the monitor publishes the same transaction handle repeatedly, so subscribers see mutated duplicates. The compare logic only looks broken. I confirm it by printing the handle on each write, and the fix is to create or clone a new transaction at every write boundary.

    Related topics

    • The Monitor: Watch the Pins, Publish a Fresh Transaction

    • Analysis Broadcast: One write(), Many Listeners

    • Back to Scoreboard Puzzles: Mismatch or Ordering Bug?

    • Scenario & Debug Puzzles section

    Previous

    200 / 293

    Next: Mismatch Cascade After One Lost Item

    Up next

    Up nextMismatch Cascade After One Lost Item

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • Out-of-Order Responses Miscompared as Corruption
    • End-of-Test Draining Missing
    • Duplicate Expected Entries from Predictor Retry Path