DescriptionQ339
Q339DVASIC interview problem
Verify a word-path search peripheral
TechniquesFirmwareUVMBacktracking
DifficultyMedium
TopicReference Models
LanguageSystemVerilog
Requirements4 checkpoints
01
Problem
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.
Type declarationSystemVerilog
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[$]
);Example input and output
Use this case to check your interpretationInput
board 2x3=[[A,B,C],[D,E,F]]; word="ABE"Output
found=1; first path=[(0,0),(0,1),(1,1)]Explanation
Row-major start order selects A, then the required up-right-down-left neighbor order reaches B and E without reusing a cell.
02
Requirements (4)
- Validate dimensions, word length, active uppercase bytes, and address arithmetic before START; allow a null path when only status is requested.
- 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.
- Apply the stated invalid-setting precedence, produce a bounded error completion with zero path, and reject configuration writes while busy.
- Keep completed status and path stable until the next accepted job or reset; IRQ clear changes only the interrupt, and reset cancels all work.
