Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Verify a programmed minimum trace window

Hardware interview practice

Verify a programmed minimum trace window

HardReference ModelsSystemVerilog

Write the minimum-window oracle and transaction checks for hardware programmed with committed required-byte counts, using earliest-start tie-breaking.

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

typedef enum {
  WATCH_OK, WATCH_BAD_ARG, WATCH_CAP, WATCH_MMIO, WATCH_TIMEOUT
} watch_status_t;
watch_status_t watch_program(
  const uint8_t required[], size_t count, uint32_t timeout
);

interface watch_if(input logic clk);
  logic rst_n, tr_valid, tr_ready, tr_first, tr_last;
  logic [7:0] tr_symbol;
  logic rsp_valid, rsp_ready, found, rsp_error;
  logic [2:0] err;
  logic [7:0] first, last;
endinterface
Reviewed example

Work through one case

Input
required counts={A:2,B:2}; accepted trace=[A,B,C,A,B,B,A]
Expected output
found=1; shortest first window=[3,6] inclusive

Window indices 3..6 contain A twice and B twice in four bytes; no earlier four-byte window satisfies both counts.

What to cover

Requirements

  1. Firmware accepts 1 through 32 required bytes, forms at most 16 sorted count entries in fixed storage, returns distinct argument, capacity, MMIO, and timeout statuses, and performs no writes on capacity failure.
  2. START copies the committed data and consumes exactly LEN accepted bytes with stable stalled payload and markers.
  3. Search all windows independently, return earliest shortest inclusive bounds, and distinguish a normal no-match from a zeroed error response.
  4. Zero unused slots, release before COMMIT, preserve active data after rejection, and enforce command/marker priorities, deadlines, busy rejection, silent abort, and reset cancellation.
Continue practicing

Related questions

Reference ModelsModel a recent-ID replay stream→Reference ModelsDebug a signed sliding-window peak→Reference ModelsVerify a minimum energy-window engine→
asic.fyi · Learn silicon end to end.info@asic.fyi