KatInterview

Designing a Self-Checking UVM Environment for a Streaming RTL Block

System DesignModel answer
MediumModel answerSystem Designuvmsystemverilogdesign-verification

Last updated

Explain how to verify a valid/ready RTL block using UVM: environment structure, an out-of-order-safe scoreboard, and coverage-driven closure to sign-off.

Imagine you are asked to verify a digital block in a hardware design verification role. Describe how you would build a SystemVerilog/UVM environment for it, and show that you have worked with such environments in practice rather than just knowing the vocabulary.

Assume the following block (or substitute one you know, as long as you state its interfaces). It accepts transactions made of an ID and a data word on an input interface using a valid/ready handshake. It processes them and produces exactly one result per input on an output interface using the same handshake.

State your assumptions on points such as these before you start:

  • Can results leave in a different order from the inputs (for example, reordered by ID), or is the order preserved?
  • Is there a reference model (in C/C++, say), or must the testbench compute expected values itself?
  • Are there configuration registers to program before traffic begins?
  • Is this block-level only, or must the environment be reusable at subsystem or chip level?

Part 1 - Architecture. Sketch the testbench: its components, their responsibilities, how they connect to each other, and how class-based code reaches the DUT signals. Follow one transaction from the test down to the pins. Cover active versus passive agents, TLM connections, interfaces and the configuration database, phases, the factory, how tests change stimulus without editing the environment, and protocol-level checks.

Part 2 - Monitor and scoreboard. What does a monitor do and why is it kept separate from the driver? How does the scoreboard decide the DUT behaved correctly, including when outputs can be reordered, and how does it notice results that never appear? Discuss predictors or reference models, end-of-test checks, and error messages that make debugging easy.

Part 3 - Coverage and closure. How do you know you are done? Compare code coverage and functional coverage, show how you would write functional coverage for this block, and explain how coverage drives constrained-random stimulus, directed tests and sign-off.

Hints

Hint 1

Trace one item through the path: test/sequence, sequencer, driver, virtual interface, DUT, monitor, analysis port, scoreboard. Each hop should have a clear owner.

Hint 2

Build the checker from what the monitors observe on the pins, never from what the driver meant to send. For out-of-order outputs, think of an associative array keyed by ID (holding a queue per ID if IDs can repeat), plus an end-of-test check that it is empty.

Hint 3

Code coverage tells you what RTL was executed, not what behavior was verified. Derive functional coverage from the verification plan, and treat holes as a prompt to adjust constraints or write a directed test.