DescriptionQ1059
Q1059DVASIC interview problem
Verify a dominant-opcode window analyzer
TechniquesDVWindow searchHistogramTie-breakingOut-of-order
DifficultyMedium
TopicReference Models
LanguageSystemVerilog
Requirements5 checkpoints
01
Problem
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.
Example input and output
Use this case to check your interpretationInput
opcodes=[1,2,1,1,3]; k=1Output
best_length=4; start=0; target_opcode=1Explanation
Window [1,2,1,1] becomes all opcode 1 with one replacement; extending through opcode 3 would require two.
02
Requirements (5)
- Enumerate every window and all eight target opcodes in an independent oracle; empty input returns zero result fields.
- Apply the comparison order length, then start, then opcode, and flag k greater than count as a bad request.
- Explain dominant, balanced, alternating, long-run, exact-k, multiple-start, and multiple-opcode cases as targeted stimulus.
- Return the complete result record for a later ID-keyed scoreboard; response ordering and reset epochs are follow-up architecture.
- Identify feasibility, length, start, opcode, entropy, and tie type as separate diagnostic or coverage dimensions.
