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
    • Analysis, Scoreboards and RAL
      • Waiting Inside write()
      • Two Analysis Imps, One write()
      • Auto-Predict, No Predictor, and a Second Master
      • Desired, Mirrored and update()
      • Backdoor Read of a Clear-on-Read Register
      • Register Reads Return Zero With a Good Waveform
    • UVM Testbench Puzzles: Tricky Q&A
  • Clock, Reset & CDC Puzzles25
  • Bus and Interface Protocol Puzzles25
  • Interview Prep: Puzzle Rounds7
  • DV Puzzle Cheatsheet
Loading lesson

←Analysis, Scoreboards and RAL
  1. Topics
  2. DV Interview Puzzles
  3. UVM Testbench Puzzles
  4. Analysis, Scoreboards and RAL
  5. Two Analysis Imps, One write()
On this page

    VLSI DV Interview PuzzlesAll levels

    Two Analysis Imps, One write()

    UVM 1.2. A scoreboard has an expected-stream imp and an actual-stream imp, both `uvm_analysis_imp #(bus_item, my_sb)`. It has one `write` function which pushes to the expected queue. Actual transactions are also being pushed into the expected queue. What is wrong and what is the standard fix?

    Puzzle

    Difficulty: Medium · Puzzle 2 of 6 · Topic: Analysis, Scoreboards and RAL

    UVM 1.2. A scoreboard has an expected-stream imp and an actual-stream imp, both `uvm_analysis_imp #(bus_item, my_sb)`. It has one `write` function which pushes to the expected queue. Actual transactions are also being pushed into the expected queue. What is wrong and what is the standard fix?

    Code

    design.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    class my_sb extends uvm_scoreboard;
      `uvm_component_utils(my_sb)
      uvm_analysis_imp #(bus_item, my_sb) exp_imp;
      uvm_analysis_imp #(bus_item, my_sb) act_imp;
      bus_item exp_q[$];
      function new(string name, uvm_component parent); super.new(name, parent); endfunction
      function void build_phase(uvm_phase phase);
        super.build_phase(phase);
        exp_imp = new("exp_imp", this);
        act_imp = new("act_imp", this);
      endfunction
      function void write(bus_item t);
        exp_q.push_back(t);
      endfunction
    endclass

    Hint

    Both imps forward to the same method of the same class. How can a component receive two streams?

    Step-by-step solution

    Diagram
    1) An analysis imp calls `write()` of its parent class. Both imps are the same class, so both call the same write(); the scoreboard can not tell the streams apart.
    2) Fix: declare per-stream imp classes with the macro `uvm_analysis_imp_decl(_exp)` and `uvm_analysis_imp_decl(_act)` (outside the class, at file or package scope, before use). They create `uvm_analysis_imp_exp` and `uvm_analysis_imp_act`, which call `write_exp()` and `write_act()`.
    3) Then declare `uvm_analysis_imp_exp #(bus_item, my_sb) exp_imp;` and `uvm_analysis_imp_act #(bus_item, my_sb) act_imp;` and implement `write_exp` and `write_act` separately. Alternative: two `uvm_tlm_analysis_fifo`s read in run_phase.

    Answer

    Answer: Both imps call the single write(): the two streams are mixed. Use `uvm_analysis_imp_decl(_exp)` / `(_act)` and implement write_exp / write_act (or use two analysis FIFOs).

    How this was checked

    Not run here: The UVM library is not installed here, so this cannot be executed; uvm_analysis_imp_decl is a UVM macro that generates classes.. The answer follows the language rules and the solution steps above.

    Why candidates get it wrong

    It compiles and connects without any message, and the symptom (expected queue full of actual data, comparator mismatches or passes against itself) points at the DUT, not at the scoreboard wiring.

    Interviewer follow-up

    Where can the decl macros be placed and what happens if they are inside the class? Model answer: they define new classes, so they must be at file or package scope before the scoreboard class (and a given suffix can be declared only once per compilation scope); inside the class body it is a compile error.

    Related topics

    • Back to Analysis, Scoreboards and RAL

    • UVM Testbench Puzzles section

    Previous

    230 / 293

    Next: Auto-Predict, No Predictor, and a Second Master

    Up next

    Up nextAuto-Predict, No Predictor, and a Second Master

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • Desired, Mirrored and update()
    • Backdoor Read of a Clear-on-Read Register
    • Register Reads Return Zero With a Good Waveform