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

  • Start Here4
  • UVM Foundations14
  • UVM Phases & Simulation Lifecycle26
  • Factory & Configuration15
  • Transaction-Level Modeling (TLM)13
  • UVM Sequences & Stimulus21
  • UVM Agents & Protocol VIP21
  • Environment & Test Classes11
  • Checking & Coverage in UVM21
  • UVM Register Abstraction Layer (RAL)22
  • Advanced UVM in Practice13
  • Debug & Regression10
  • Coding Practice47
    • How to Use This Course
    • Whiteboard Delivery Framework
    • Scoreboard Coding
      • Ordered FIFO Compare
      • Out-of-Order Reorder Buffer
      • Multi-Stream Merge
      • Predictor & Reference Model
      • Scoreboard Tricky Q&A
    • Monitor & Driver Coding
    • Sequences Coding
    • TLM & Analysis
    • RAL & Adapters
    • Factory & config_db
    • Phases & Objections
    • Env & Test Architecture
    • Debug Broken Testbench
    • Mock Interview Sets
    • Senior UVM Coding Cheat Sheet
  • Verification in Industry Practice10
  • Senior Prep: Architecture, Leadership and Interviews32
Loading lesson

←Scoreboard Coding
  1. Topics
  2. UVM Verification
  3. Coding Practice
  4. Scoreboard Coding
  5. Ordered FIFO Compare
On this page

    UVM Coding PracticeSenior

    Ordered FIFO Compare

    In-order expected queue, compare on match, mismatch reporting.

    Interview prompt

    Sketch a scoreboard with expected and actual FIFOs for an in-order APB peripheral response stream.

    Diagram
    WHITEBOARD CHAIN
    
    1. DECLARE    interfaces / types / ports you need
    2. SKELETON   class extends + utils macro + key methods
    3. MECHANISM  fill one critical method while narrating
    4. PITFALL    name one bug juniors make on this pattern
    5. TEST       how you would smoke-test the component

    Reference sketch (≤40 lines)

    design.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    class apb_sb extends uvm_scoreboard;
      `uvm_component_utils(apb_sb)
      uvm_analysis_imp_exp #(apb_txn, apb_sb) exp_imp;
      uvm_analysis_imp_act #(apb_txn, apb_sb) act_imp;
      apb_txn exp_q[$], act_q[$];
    
      function void write_exp(apb_txn t); exp_q.push_back(t); endfunction
      function void write_act(apb_txn t);
        act_q.push_back(t);
        if (exp_q.size() && act_q.size())
          compare_pair(exp_q[0], act_q[0]);
      endfunction
      function void compare_pair(apb_txn e, apb_txn a);
        if (!e.compare(a)) `uvm_error("SB", "mismatch")
        else begin exp_q.delete(0); act_q.delete(0); end
      endfunction
    endclass

    Buggy snippet — critique verbally

    design.sv
    function void write_act(apb_txn t);
      compare_pair(exp_q[0], t); // always compare — exp_q may be empty
    endfunction

    Smoke test (5 minutes)

    • One directed read/write sequence.

    • Inject single wrong data — expect one UVM_ERROR.

    • Check queues drain to zero after match.

    Code lab drill

    After reading, try Code lab exercise uvm-l8-int-scoreboard-fifo — topic reference: /topics/uvm/coding-practice/scoreboard/ordered-fifo-compare

    Common pitfalls

    • Compare when exp_q empty — index error or bogus match.

    • No txn.compare() — field-wise typos missed.

    • Not deleting matched entries — duplicate compares.

    Previous

    184 / 280

    Next: The UVM Debug Toolkit

    Up next

    Up nextThe UVM Debug Toolkit

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • Out-of-Order Reorder Buffer
    • Multi-Stream Merge
    • Predictor & Reference Model