Hardware interview practice
Scoreboard a maximum-interval accelerator
Verify a bounded accelerator that accepts up to 16 signed samples and returns the greatest-sum contiguous interval. Build the reference prediction and in-order scoreboard around the request and response handshakes.
Reviewed example
Work through one case
Input
accepted signed samples=[-2,3,4,-1]; response is stalled for two cyclesExpected output
result_valid=1; max_sum=7; start=1; end=2; payload remains stable during stallExhaustive nonempty intervals select [3,4]; the queued prediction is consumed only when the response handshake occurs.
What to cover
Requirements
- Snapshot inputs only when req_valid and req_ready are both high, and evaluate every nonempty interval using signed arithmetic at least 16 bits wide.
- Break equal-sum ties by the lowest start index and then the lowest end index; count zero predicts result_valid low and zero result fields.
- Queue one expectation per accepted request and compare exactly once per accepted response.
- Require rsp_valid and its payload to remain stable while the response is stalled.
- Flush canceled expectations on reset and reject any orphan response before the first post-reset request.
