Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Triage an end-of-frame run bug

Hardware interview practice

Triage an end-of-frame run bug

MediumReference ModelsSystemVerilog

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.

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 →
Reviewed example

Work through one case

Input
frame1 count=6 bits=[1,1,0,1,1,1]; frame2 count=7 bits=[1,1,0,1,1,1,0]
Expected output
both predict longest length=3,start=3

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.

What to cover

Requirements

  1. Commit the current run both when a zero is encountered and once more after the final active bit.
  2. Keep the lowest start index when two runs have equal maximum length.
  3. Return length=0 and start=0 when no healthy lane exists, and reject lane_count greater than 64.
  4. 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.
  5. 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.
Continue practicing

Related questions

Reference ModelsDebug a signed sliding-window peak→Reference ModelsVerify a minimum energy-window engine→Reference ModelsVerify a longest rising-trend accelerator→
asic.fyi · Learn silicon end to end.info@asic.fyi