Skip to the selected question
ASIC.FYI

ASIC Question Bank

1,000+ hardware interview questions
DescriptionQ531
Page ↗
Q531DVASIC interview problem

Compare transactions with useful messages

TechniquesUVMComparisonDiagnostics
DifficultyEasy
TopicVerification Utilities
LanguageSystemVerilog
Requirements3 checkpoints
01

Problem

Compare expected and actual transactions. Return an empty string when they match, otherwise return a human-readable list of mismatched fields.

Example input and output

Use this case to check your interpretation
Input
expected=(id=7,addr=0x10,data=16'hA5XZ); actual=(id=8,addr=0x14,data=16'hA5X1)
Output
message reports mismatches for id, addr, and data
Explanation

The comparator accumulates all three field mismatches and uses case inequality so a four-state data difference is not hidden.

02

Requirements (3)

  • Report every mismatch, not just the first.
  • Use case inequality to expose X or Z differences.
  • Include expected and actual values.