Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Verify a rotated-table minimum finder

Hardware interview practice

Verify a rotated-table minimum finder

MediumConstraintsSystemVerilog

Implement legal-by-construction stimulus, a linear oracle, a one-request scoreboard, and exact-latency assertions for a rotated sorted-table minimum finder.

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
sorted table=[1,3,5,8,11], randomized rotation=2
Expected output
One valid result: rotated=[5,8,11,1,3], minimum_index=3

A left rotation by two preserves cyclic order and places the original minimum at index three. Other rotation amounts remain valid stimulus.

What to cover

Requirements

  1. Generate a strictly increasing base array, choose rotation independently, and copy the rotated values into the request; include count one, unrotated, rotation one, and rotation count minus one.
  2. Predict the minimum with a linear scan, independent of the DUT's likely binary search, and select the lowest physical index deterministically.
  3. Counts outside 1 through 16 return bad_count with zeroed results one cycle after acceptance; duplicates or unsorted data are out of contract and must not be overchecked.
  4. For legal count, assert response exactly 2 + ceil(log2(count)) cycles after acceptance, keep req_ready low until response handshake, and hold the response under stall.
  5. Reset cancels pending work; identify count, rotation, minimum index, value extrema, stalls, latency, reset phase, and invalid-count classes as follow-up coverage.
asic.fyi · Learn silicon end to end.info@asic.fyi