Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Verify a dominant-opcode window analyzer

Hardware interview practice

Verify a dominant-opcode window analyzer

MediumReference ModelsSystemVerilog

Write an exhaustive oracle for the longest opcode window convertible to one of eight classes with at most k replacements, breaking ties by lowest start and then lowest opcode.

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
opcodes=[1,2,1,1,3]; k=1
Expected output
best_length=4; start=0; target_opcode=1

Window [1,2,1,1] becomes all opcode 1 with one replacement; extending through opcode 3 would require two.

What to cover

Requirements

  1. Enumerate every window and all eight target opcodes in an independent oracle; empty input returns zero result fields.
  2. Apply the comparison order length, then start, then opcode, and flag k greater than count as a bad request.
  3. Explain dominant, balanced, alternating, long-run, exact-k, multiple-start, and multiple-opcode cases as targeted stimulus.
  4. Return the complete result record for a later ID-keyed scoreboard; response ordering and reset epochs are follow-up architecture.
  5. Identify feasibility, length, start, opcode, entropy, and tie type as separate diagnostic or coverage dimensions.
Continue practicing

Related questions

Reference ModelsVerify a minimum energy-window engine→Reference ModelsMatch out-of-order packets by ID→Reference ModelsTriage an end-of-frame run bug→
asic.fyi · Learn silicon end to end.info@asic.fyi