Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Enforce a rolling bandwidth limit

Hardware interview practice

Enforce a rolling bandwidth limit

MediumReference ModelsPYTHON

Implement a checker allowing at most five accepted packets in any rolling ten-cycle window.

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
accepted packet cycles=[0,1,2,3,4]; attempt at cycle 9; attempt at cycle 10
Expected output
cycle 9 packet rejected as sixth in the rolling window; cycle 10 packet accepted after cycle 0 expires

Before checking cycle 10, events at or before 0 leave the ten-cycle window; the rejected cycle-9 event never pollutes legal state.

What to cover

Requirements

  1. Accept monotonically nondecreasing cycle numbers.
  2. Before checking a new packet at cycle c, remove events at or before c - 10.
  3. Reject a sixth in-window packet without adding the illegal event to legal model state.
  4. Use cycle counts rather than simulator time units.
Continue practicing

Related questions

Reference ModelsModel a recent-ID replay stream→Reference ModelsDebug a signed sliding-window peak→Reference ModelsVerify a minimum energy-window engine→
asic.fyi · Learn silicon end to end.info@asic.fyi