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

  • 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
    • Scoreboard Architecture: Expected vs Actual
    • Reference Models: Predictors, DPI-C and Built-in Comparators
      • Predictor and Reference-Model Design
      • DPI-C Reference Models
      • Built-in Comparators and the Class-Comparator Trap
    • Coverage & Closure
  • UVM Register Abstraction Layer (RAL)22
  • Advanced UVM in Practice13
  • Debug & Regression10
  • Coding Practice47
  • Verification in Industry Practice10
  • Senior Prep: Architecture, Leadership and Interviews32
Loading lesson

‹Checking & Coverage in UVM
  1. Topics
  2. UVM Verification
  3. Checking & Coverage in UVM
  4. Reference Models: Predictors, DPI-C and Built-in Comparators

Part 8 · Checking & Coverage · Intermediate

Reference Models: Predictors, DPI-C and Built-in Comparators

The model that says what the DUT should have done: a predictor as its own component, C models called through DPI-C, and UVM's built-in comparators and their traps.

  • 3topics
  • 3lessons
On this page

    A scoreboard is only as good as its prediction. In the first DMA bench the prediction is one line inside the scoreboard, word ^ key, and that is fine until the day the architects hand you a C model, or a second team wants to feed a built-in comparator, or you need a deliberately wrong prediction to prove the checker can fail. Each of those means editing the scoreboard. This topic moves the prediction into its own component, calls a C model from it, and then looks hard at the comparators UVM ships, one of which passes eight wrong predictions without a word.

    What you will be able to do

    • Build a predictor that turns observed register traffic and input words into expected items, with the model in one virtual function that a factory override can replace.

    • Decide between a transaction-level and a cycle-accurate model, and model the register rules the DUT really applies.

    • Call a C reference model through DPI-C: the import, the type mapping, open arrays and chandles, and the compile flow on Verilator and on commercial simulators.

    • Use `uvm_in_order_comparator` with a comparison policy, explain why `uvm_in_order_class_comparator` needs do_compare, and know when a hand-written scoreboard is the better tool.

    Where the model sits

    Flowchart: monitors feed dma_predictor, which can call dma_model.c through DPI-C and sends expected items to a built-in comparator. The stream-out monitor sends actual items to the same comparator.
    The checking path of dma_env_check. The predictor owns the model; a derived predictor can hand predict() to a C function; a built-in comparator pairs expected and actual items.

    The lessons, in order

    Lesson

    What it covers

    Predictor and Reference-Model Design

    dma_predictor and dma_env_check: why the model is its own component, what versus when, register state, ambiguous specs, and keeping the model independent of the RTL.

    DPI-C Reference Models

    dma_model.c and dma_dpi_test: imports and type mapping, open arrays and chandles, the extern "C" link error, compile flows, and a C model that hangs the simulation.

    Built-in Comparators and the Class-Comparator Trap

    uvm_in_order_comparator with a policy class, the class comparator that matched eight wrong predictions, the algorithmic comparator, and when built-ins lose to a scoreboard.

    Read Scoreboard Architecture first if you have not: these lessons assume the expected-versus-actual model and change only where the expected side comes from and who compares.

    Related topics

    • Up: Checking & Coverage

    • Previous: Scoreboard Architecture

    • Next: Coverage & Closure

    PreviousNext: Predictor and Reference-Model Design

    Up next

    Up nextPredictor and Reference-Model Design

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Scoreboard Architecture: Expected vs Actual
    • Coverage & Closure