DescriptionQ398
Q398DVASIC interview problem
Verify a programmed minimum trace window
TechniquesFirmwareUVMSliding window
DifficultyHard
TopicReference Models
LanguageSystemVerilog
Requirements4 checkpoints
01
Problem
Write the minimum-window oracle and transaction checks for hardware programmed with committed required-byte counts, using earliest-start tie-breaking.
Type declarationSystemVerilog
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;
endinterfaceExample input and output
Use this case to check your interpretationInput
required counts={A:2,B:2}; accepted trace=[A,B,C,A,B,B,A]Output
found=1; shortest first window=[3,6] inclusiveExplanation
Window indices 3..6 contain A twice and B twice in four bytes; no earlier four-byte window satisfies both counts.
02
Requirements (4)
- 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.
- START copies the committed data and consumes exactly LEN accepted bytes with stable stalled payload and markers.
- Search all windows independently, return earliest shortest inclusive bounds, and distinguish a normal no-match from a zeroed error response.
- Zero unused slots, release before COMMIT, preserve active data after rejection, and enforce command/marker priorities, deadlines, busy rejection, silent abort, and reset cancellation.
