DescriptionQ519
Q519DVASIC interview problem
Triage an end-of-frame run bug
TechniquesRun lengthBoundary regressionTie-breakingAssertions
DifficultyMedium
TopicReference Models
LanguageSystemVerilog
Requirements5 checkpoints
01
Problem
Write a small oracle for a longest-healthy-run design that may underreport a run reaching the final active lane. Make the end-of-frame commit and earliest-tie rule explicit.
Example input and output
Use this case to check your interpretationInput
frame1 count=6 bits=[1,1,0,1,1,1]; frame2 count=7 bits=[1,1,0,1,1,1,0]Output
both predict longest length=3,start=3Explanation
The first winning run closes only at end of frame and the paired case closes on an in-frame zero, exposing a missing final commit.
02
Requirements (5)
- Commit the current run both when a zero is encountered and once more after the final active bit.
- Keep the lowest start index when two runs have equal maximum length.
- Return length=0 and start=0 when no healthy lane exists, and reject lane_count greater than 64.
- Explain the minimal paired test: one frame ends on the winning one-bit and the other closes the same run with a trailing in-frame zero.
- Assert bounded completion and identify useful cases such as ties, zero/one/full lengths, all-zero/all-one data, and the final active-bit value.
