Hardware interview practice
Scoreboard variable-length bitmap ranges
Verify a bitmap compressor that turns a 32-lane active mask into zero or more maximal inclusive ranges. Check the variable-length output stream, last marker, completion, and stalls.
Reviewed example
Work through one case
Input
accepted mask=32'h0000_00E6; stall the first range response onceExpected output
ranges=[1,2] then [5,7]; last=0 then1; done pulses when [5,7] is acceptedBits 1-2 and 5-7 form two maximal low-to-high runs; backpressure cannot change the held first range.
What to cover
Requirements
- On an accepted idle start, scan low to high and enqueue each maximal run of adjacent set bits.
- Compare and pop one expected range only on range_valid and range_ready; an output with an empty queue is an immediate failure.
- Mark only the final expected range as last and keep range payload stable while stalled.
- For an all-zero mask, require no range transfer and exactly one done pulse.
- For nonzero masks, require done on acceptance of the final marked range and flush all state on reset.
