Verification #10 · 2026-10-03 · Queues · Easy · about 10 min

The flush that leaves some behind

scoreboard keeps the transactions the DUT still owes in pending, oldest first. When the DUT aborts a stream, the testbench calls flush(id):

  • Every entry in pending with that id is removed, wherever it is in the queue.
  • The other entries stay, in the same order, with the same data.
  • flush returns the number of entries it removed (0 if there were none).

Run queues eight transactions and flushes stream 2. Some of stream 2 is still there afterwards. Fix scoreboard.sv.

Write and run your answer in the browser. The hidden tests check it, and it’s free.