Skip to content

Write a scoreboard that matches two transaction streams by id, not by arrival order

write-from-scratch / scoreboard / analysis-portUVM · runs take about 2 minutes

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

  1. 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.
  2. Once both sides have reported an id: matching data increments match_count, differing data increments mismatch_count. Either way the pair is resolved.
  3. An 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.
  4. pending_count() returns how many transactions, on either side, are still waiting for their other half.

Source on GitHub

scoreboard_correlate_by_id.sv