Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Verify a tagged grid-path counter

Hardware interview practice

Verify a tagged grid-path counter

MediumReference ModelsSystemVerilog

Verify an accelerator with up to four tagged, outstanding requests that counts right-or-down paths through a rectangular grid and may return responses out of order.

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

interface paths_if(input logic clk);
  logic rst_n, req_valid, req_ready;
  logic [3:0] req_id;
  logic [4:0] rows, cols;
  logic rsp_valid, rsp_ready;
  logic [3:0] rsp_id;
  logic rsp_error;
  logic [63:0] path_count;
endinterface
Reviewed example

Work through one case

Input
accept id2 grid=2x3 and id7 grid=3x3; responses return id7 then id2
Expected output
id7 path_count=6 PASS; id2 path_count=3 PASS

The 64-bit dynamic-programming oracle is keyed by request ID, so reversed response order remains legal.

What to cover

Requirements

  1. For dimensions 1 through 16, predict in 64 bits with one on the top and left edges and upper-plus-left in every interior cell.
  2. Track at most four unique outstanding req_id values and compare each response by ID rather than acceptance order.
  3. Unknown, repeated, or stale responses fail; invalid dimensions return an error and zero path count.
  4. Bound response latency, hold stalled responses stable, cancel all outstanding work on reset, and delay old-ID reuse long enough to expose late replies.
Continue practicing

Related questions

Reference ModelsMatch out-of-order packets by ID→Reference ModelsVerify signed maximum-product ranges→Reference ModelsVerify a minimum energy-window engine→
asic.fyi · Learn silicon end to end.info@asic.fyi