SystemVerilog · Medium · SystemVerilog

Queue-Based Expected-Value Checker

Use a queue to align expected outputs with a variable-latency DUT.

Task

Push expected values when inputs are accepted. Pop and compare the oldest expected value whenever out_valid is asserted.

Examples

Constraints

What this problem is testing

The interviewer is usually testing language semantics as much as syntax: driver intent, scheduling, type behavior, interface directionality, and whether the construct communicates hardware intent clearly.

Interview habit: before coding, state reset behavior, the state that must be stored, and the conditions that update each output.

Verification plan

Common mistakes

Interview follow-up questions

Concepts to review

testbench, queue, scoreboard

Open Queue-Based Expected-Value Checker in the HDLForge interactive editor.

Related problems

Explore the SystemVerilog Practice & Interview Preparation hub.

Continue practising