DescriptionQ363
Q363DVASIC interview problem
Cross-check a byte reverser
TechniquesMetamorphic testActive prefixBoundary coverageTimeout
DifficultyMedium
TopicReference Models
LanguageSystemVerilog
Requirements5 checkpoints
01
Problem
Write the reference checks for a byte-window design that reverses an active prefix and clears every inactive output slot. Use both a direct prediction and the identity reverse(reverse(prefix)) = prefix.
Example input and output
Use this case to check your interpretationInput
count=3; input slots=[A,B,C,DD,DD,DD,DD,DD,DD,DD,DD,DD,DD,DD,DD,DD]; feed the first result through againOutput
first output=[C,B,A,0,0,0,0,0,0,0,0,0,0,0,0,0]; second active prefix=[A,B,C]Explanation
The direct oracle checks reversal and zeroed inactive lanes, while reverse-twice independently recovers the original active prefix.
02
Requirements (5)
- For counts from 0 through 16, compare every active byte with input[count - 1 - i] and require the complete inactive suffix to be zero.
- Define the second-pass check for feeding a legal first result back with the same count; compare its active prefix with the original and require a zero suffix.
- For count greater than 16, require request_error and an all-zero output.
- Assert that an accepted request completes within the stated bound and that no new start is issued while busy.
- Explain how zero, one, odd, even, full, invalid, repeated, palindromic, and dirty-suffix cases exercise the two checks.
