Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Verify a four-lane PCIe deskew buffer

Hardware interview practice

Verify a four-lane PCIe deskew buffer

HardReference ModelsSystemVerilog

Four lanes carry numbered symbols. A lane may lag the leader by at most seven symbol-times. Build a reference model and test plan for aligned output, overflow detection, backpressure, reset, and recovery.

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

Work through one case

Input
Symbol 42 arrives in lane slots [100,103,107,101]; later symbol 99 arrives with slots [200,208,203,201]
Expected output
Symbol 42 emits once after slot 107 because skew=7. Symbol 99 causes deskew_error because skew=8; no group 99 emits, queues flush, and output stays blocked until a common recovery marker.

Skew is measured in per-lane symbol-transfer opportunities, not raw simulator time or byte count, and the recovery contract prevents stale pre-error symbols from leaking out.

What to cover

Requirements

  1. Define one symbol-time as one opportunity for a lane to transfer a valid symbol. For a particular symbol k, skew is max(arrival_slot[k,lane]) minus min(arrival_slot[k,lane]) across the four lanes.
  2. Preserve order within each lane and emit group k only when symbol k is at the head of all four lane queues; skew 0..7 must produce one lossless aligned group.
  3. When observed skew reaches 8, assert deskew_error, emit no corrupted group, flush partial lane queues, and enter recovery.
  4. Leave recovery only after reset/retrain or an explicit alignment marker observed on every lane; then restart from the following common symbol. Test gaps, backpressure, leader changes, skew boundaries, reset mid-packet, error, and recovery.
Continue practicing

Related questions

Reference ModelsMatch transactions in strict order→Reference ModelsMatch out-of-order packets by ID→Reference ModelsScoreboard a maximum-interval accelerator→
asic.fyi · Learn silicon end to end.info@asic.fyi