DescriptionQ816
Q816DVASIC interview problem
Verify a shared-memory spiral readout
TechniquesFirmwareUVMSpiral traversal
DifficultyMedium
TopicReference Models
LanguageSystemVerilog
Requirements4 checkpoints
01
Problem
Write the spiral oracle and transaction checks for firmware driving a peripheral that freezes a rectangular static RAM (SRAM) tile at START and copies it into a guarded destination.
Function headerSystemVerilog
function automatic void spiral_reference(
input int unsigned image[][],
input int unsigned rows,
input int unsigned cols,
ref int unsigned expected[$]
);Example input and output
Use this case to check your interpretationInput
frozen 2x3 source=[[1,2,3],[4,5,6]] with guard words around a six-word destinationOutput
destination writes=[1,2,3,6,5,4]; exactly six writes; both guards unchangedExplanation
The accepted START snapshot is traversed clockwise and no DMA write escapes the validated destination interval.
02
Requirements (4)
- Validate dimensions, alignment, accessible ranges, non-overlap, and address arithmetic before register access; perform the required cache and barrier sequence.
- Predict from the source image copied at accepted START and compare exactly rows times columns destination writes.
- Stop after the first bus fault, reject busy START without changing state, and prevent any write or completion after reset.
- Check persistent completion interrupt behavior, timeout across tick wrap, and unchanged guard words around the destination.
