A reference model publishes each transaction’s expected result; a monitor publishes what the DUT returned. The DUT reorders responses, so comparing the Nth expected item with the Nth actual one reports correct traffic as mismatches.
Each xaction carries an id, the key both sides share, and data, the value checked. Write sb’s callbacks, and whatever state they need.
Requirements
write_expected(t) and write_actual(t) arrive in any order, interleaved with each other and with other ids. Each waits for its id to show up on the other side.id: matching data increments match_count, differing data increments mismatch_count. Either way the pair is resolved.id can recur. A resolved occurrence is consumed, so a later one starts fresh, and an unresolved one is never overwritten: if id=7 arrives twice on one side before the first is resolved, both are still owed a match.pending_count() returns how many transactions, on either side, are still waiting for their other half.One working answer: brokenbench's own fix for this exercise. Try a few runs first.
What changes, against the code you started with:
docker run --pull always --rm -p 127.0.0.1:8787:8787 ghcr.io/adibis/brokenbench-runnerLooking for a runner on this computer…
The first start downloads about 250 MB; after that it starts in seconds and only downloads again when there's an update. Your code goes to the runner on your computer, not to chipdv.io.