KatInterview

Testing Plan: Hardware Queue, Rotating Arbiter, Ready/Valid Link

System DesignModel answer
HardModel answerSystem Designdesign-verificationsystemverilogscoreboard

Last updated

Plan the verification of three small digital blocks (a FIFO, a round-robin arbiter and a valid/ready link) covering testbench structure, random stimulus, assertions and coverage.

You are given the spec of a small digital block and asked to explain how you would prove it correct before tape-out. Describe the verification environment (stimulus, monitors, a checking model), how you would randomize inputs under constraints, which corner cases you would hit on purpose, which SystemVerilog assertions (SVA) you would write, and what functional coverage you would collect.

Three blocks are on the table. All share one clock clk and an active-low reset rst_n. Sizes are parameters: DEPTH and WIDTH for the FIFO, N for the arbiter. Pseudo-code or SystemVerilog is fine; the reasoning matters more than syntax.

Questions you should settle (or state assumptions for) before starting

  • Is a push into a full FIFO, or a pop from an empty one, ignored, flagged as an error, or forbidden stimulus?
  • Does read data appear in the pop cycle (first-word fall-through) or one cycle later?
  • Is the arbiter's grant combinational or registered? Must a requester hold its request until granted?

Part 1: Synchronous FIFO

Inputs are push, din[WIDTH-1:0] and pop. Outputs are dout[WIDTH-1:0], full and empty. Cover the reference model and scoreboard, the stimulus constraints, the corner cases, the assertions and the coverage. Stimulus should reach full and empty often, not just the middle occupancies.

Part 2: Round-robin arbiter

Requesters drive req[N-1:0] and the arbiter returns gnt[N-1:0] using rotating priority. State the properties that make an arbiter correct (safety, work conservation, fairness), then describe the checking approach, stimulus, assertions and coverage. Compare a cycle-accurate model with property-only checking.

Part 3: Valid/ready handshake

A sender drives valid and data, and a receiver drives ready. A transfer occurs in every cycle where both are high. State the protocol rules, the assertions for each side, a scoreboard for a block that uses this interface, the back-pressure stimulus and the coverage.

Hints

Hint 1

Separate what is checked every cycle (assertions on local rules such as flags, one-hot grants and stable data) from what is checked end to end (a scoreboard comparing the ordered stream of accepted items with the predicted stream).

Hint 2

Do not rely on uniform random stimulus to reach corners. Bias the push/pop and valid/ready probabilities in phases (fill-heavy, drain-heavy, balanced, stalled), then use coverage crosses to prove that the corners were really hit.

Hint 3

Every assertion and model must handle reset (`disable iff (!rst_n)`, with the model flushed on reset). Fairness properties need an assumption, namely that a request is held until it is granted, otherwise they cannot be stated or proven.