Q131FreeDesign Verification
Expire memory expectations without full scans
Interview prompt
Question
Replace the full pending-memory scan with a deadline-ordered structure while preserving fast per-address matching.

Starting point
Question code
expected_txn by_addr[longint][$];
expected_txn deadlines[$];
function void golden_write(longint addr, int data);
function void dut_write(longint addr, int data);
function void tick();Reviewed example
Trace one case
Input
expect A due cycle 5 and B due cycle 7; match B at cycle 3; process deadlines at cycle 5 then 7Expected output
A expires once at cycle 5; matched B is lazily skipped at cycle 7The deadline queue visits only its expired head objects and the matched marker prevents B from being reported after successful lookup removal.
What to cover
Requirements
- Store the same transaction object in both lookup structures.
- Mark a matched object so deadline processing can skip it lazily.
- Process only expired objects at the deadline queue head.
- Assume expectations enter in nondecreasing cycle order.

