Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Verify a word-path search peripheral

Hardware interview practice

Verify a word-path search peripheral

MediumReference ModelsSystemVerilog

Write the path oracle and transaction checks for firmware driving a memory-mapped I/O (MMIO) peripheral that finds the first nonrepeating path spelling an uppercase word in an 8x8 board.

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 struct packed { byte unsigned row, col; } coord_t;

function automatic bit first_word_path(
  input byte unsigned board[8][8],
  input int rows, cols,
  input byte unsigned word[$],
  ref coord_t path[$]
);
Reviewed example

Work through one case

Input
board 2x3=[[A,B,C],[D,E,F]]; word="ABE"
Expected output
found=1; first path=[(0,0),(0,1),(1,1)]

Row-major start order selects A, then the required up-right-down-left neighbor order reaches B and E without reusing a cell.

What to cover

Requirements

  1. Validate dimensions, word length, active uppercase bytes, and address arithmetic before START; allow a null path when only status is requested.
  2. Copy inputs at accepted idle START, try start cells in row-major order, and visit neighbors up, right, down, then left; the first full path wins.
  3. Apply the stated invalid-setting precedence, produce a bounded error completion with zero path, and reject configuration writes while busy.
  4. Keep completed status and path stable until the next accepted job or reset; IRQ clear changes only the interrupt, and reset cancels all work.
asic.fyi · Learn silicon end to end.info@asic.fyi