Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Close signed pivot-index coverage

Hardware interview practice

Close signed pivot-index coverage

MediumFunctional CoverageSystemVerilog

Write a signed reference function and semantic coverage model for a balance-point design that returns the earliest index whose strict-left sum equals its strict-right sum.

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
signed values=[1,7,3,6,5,6]
Expected output
pivot_found=1; pivot_index=3

At index 3 the strict-left sum is 11 and the strict-right sum is 11; scanning upward makes this the earliest match.

What to cover

Requirements

  1. Accumulate total and left sums in signed 16-bit-or-wider storage and exclude the candidate element from both sides.
  2. Return the first match; count zero is legal with no pivot, and a one-element array has pivot zero.
  3. For count greater than 16, require request_error, pivot_found=0, and pivot_index=0.
  4. Define coverage sampling at a completed, matched transaction rather than at request issue.
  5. Cover no, unique, and multiple solutions crossed with first/interior/last position, data-sign class, and count 0/1/16.
Continue practicing

Related questions

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