Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/RoCE-style selective-repeat checker

Hardware interview practice

RoCE-style selective-repeat checker

HardSystemVerilog & UVMSystemVerilog

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.

Try it in the question bankReason first. Then compare.

Keep this exact question selected while you check your answer and review the full solution.

Practice this question →
Starting point

Question code

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
Reviewed example

Work through one case

Input
expected_psn=10; packets arrive with PSNs 11 then 10.
Expected output
PSN 11 buffers, then delivery publishes PSN 10 followed by PSN 11 and expected_psn becomes 12.

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

What to cover

Requirements

  1. 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.
  2. Store one packet at each in-window PSN; a second packet with the same buffered PSN is a duplicate error and is dropped.
  3. After every insertion, publish and remove consecutive packets beginning at expected_psn, advancing expected_psn modulo 2^24 until a gap is reached.
  4. reset_qp discards all buffered packets, clears errors for the new epoch, and sets the supplied expected PSN.
asic.fyi · Learn silicon end to end.info@asic.fyi