Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Verify a shared-memory spiral readout

Hardware interview practice

Verify a shared-memory spiral readout

MediumReference ModelsSystemVerilog

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.

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

function automatic void spiral_reference(
  input int unsigned image[][],
  input int unsigned rows,
  input int unsigned cols,
  ref int unsigned expected[$]
);
Reviewed example

Work through one case

Input
frozen 2x3 source=[[1,2,3],[4,5,6]] with guard words around a six-word destination
Expected output
destination writes=[1,2,3,6,5,4]; exactly six writes; both guards unchanged

The accepted START snapshot is traversed clockwise and no DMA write escapes the validated destination interval.

What to cover

Requirements

  1. Validate dimensions, alignment, accessible ranges, non-overlap, and address arithmetic before register access; perform the required cache and barrier sequence.
  2. Predict from the source image copied at accepted START and compare exactly rows times columns destination writes.
  3. Stop after the first bus fault, reject busy START without changing state, and prevent any write or completion after reset.
  4. Check persistent completion interrupt behavior, timeout across tick wrap, and unchanged guard words around the destination.
asic.fyi · Learn silicon end to end.info@asic.fyi