Skip to the selected question
ASIC.FYI

ASIC Question Bank

1,000+ hardware interview questions
DescriptionQ542
Page ↗
Q542DVBroadcomASIC interview problem

RoCE-style selective-repeat checker

TechniquesDVSystemVerilogUVMRoCE-stylechecker
DifficultyHard
TopicSystemVerilog & UVM
LanguageSystemVerilog
Requirements4 checkpoints
01

Problem

One queue pair receives 24-bit packet sequence numbers through an eight-packet reorder window. Write a UVM reference model for packet acceptance and in-order delivery.

Function headerSystemVerilog
function void reset_qp(bit [23:0] expected_psn);
function void write_pkt(bit [23:0] psn, byte unsigned payload[]);
uvm_analysis_port #(roce_pkt) delivered_ap;
// modulo-2^24 forward distance

Example input and output

Use this case to check your interpretation
Input
expected_psn=10; packets arrive with PSNs 11 then 10.
Output
PSN 11 buffers, then delivery publishes PSN 10 followed by PSN 11 and expected_psn becomes 12.
Explanation

Inserting the missing window head allows the drain loop to publish the newly consecutive two-packet prefix.

02

Requirements (4)

  • Compute forward distance d=(psn-expected_psn) modulo 2^24; d in 0..7 is inside the receive window, while every other value is old or too far and is reported then dropped.
  • Store one packet at each in-window PSN; a second packet with the same buffered PSN is a duplicate error and is dropped.
  • After every insertion, publish and remove consecutive packets beginning at expected_psn, advancing expected_psn modulo 2^24 until a gap is reached.
  • reset_qp discards all buffered packets, clears errors for the new epoch, and sets the supplied expected PSN.