Module 3: Checking Architecture | Intermediate UVM

Multi-Stream Scoreboards

Design scoreboards that correctly check multiple transaction streams, including independent streams, shared correlation, and cross-stream relationships.

Learning objectives

  • Identify when an environment requires multiple scoreboard streams.
  • Distinguish independent stream checking from cross-stream correlation.
  • Choose an appropriate correlation key for each stream.
  • Build a scoreboard that tracks multiple streams without mixing unrelated transactions.
  • Handle streams with different ordering guarantees.
  • Correlate transactions that originate on one interface and complete on another.
  • Diagnose stream-specific and cross-stream failures.
  • Recognize when separate scoreboards are preferable to one centralized scoreboard.

Why multiple streams change scoreboard architecture

A simple scoreboard often starts with one expected stream and one actual stream. Real verification environments frequently have more than one transaction path.

For example, a DUT might contain:

  • a request interface,
  • a response interface,
  • a data stream,
  • a control or command stream,
  • multiple independent ports, or
  • several protocol channels operating concurrently.
                 +----------------+


Request stream ->|                |-> Response stream
|      DUT       |
Data stream ---->|                |-> Data stream
+----------------+
|
+----------> Status stream

The verification environment must decide how these streams relate to one another. That decision determines the scoreboard architecture.

Core idea: Multiple streams do not automatically require one large scoreboard. First determine whether the streams are independent or whether correctness depends on their relationship.

Step 1: Classify the streams

Before writing code, classify each transaction stream according to its relationship with the others.

Pattern A: Independent streams

Each stream has its own expected behavior and can be checked independently.

Stream A expected ---> Scoreboard A


Stream A actual   ---> Scoreboard A

Stream B expected ---> Scoreboard B
Stream B actual   ---> Scoreboard B

There is no reason to combine these streams simply because they belong to the same DUT.

Pattern B: Shared scoreboard, independent matching

Several streams can be handled by one scoreboard component while maintaining separate tracking state.

Expected A ----+
           |


Actual A ------+--> Multi-Stream Scoreboard
|
Expected B ----+
|
Actual B ------+

Each stream has its own matching rules and state.

Pattern C: Cross-stream correlation

A transaction on one stream creates an expectation for another stream.

Request stream
  |
  v


Predictor
|
v
Expected response
|
+----------------------+
|
v
Response stream ----------> Scoreboard

More complex cases may require relationships across multiple streams:

Command A
|
+----> Data B
|
+----> Completion C

Here, checking each stream independently may not prove that the DUT associated the transactions correctly.

Step 2: Give each stream a clear identity

An out-of-order scoreboard from Lesson 25 used a transaction ID as its lookup key. With multiple streams, an ID may no longer be globally unique.

Consider two channels:

Channel A: ID=5


Channel B: ID=5

Storing both in:

expected_by_id[5]

would create a collision.

One solution is to make the stream part of the key:

{stream_id, transaction_id}

Conceptually:

{A, 5} -> expected transaction


{B, 5} -> expected transaction

This is an important extension of Lesson 25: the key must uniquely identify the correlation domain, not merely contain a convenient field.

Step 3: Choose separate or shared tracking state

There are two common implementation strategies.

Separate tables

expected_a_by_id[id]


expected_b_by_id[id]

This is straightforward when the streams have significantly different semantics.

One table with a composite key

expected_by_key[{stream_id, id}]

This is useful when all streams follow a common matching abstraction.

Do not choose the data structure first. Choose the correlation model first, then select the simplest data structure that represents it clearly.

Step 4: Build a multi-stream transaction key

A small key class can make the correlation relationship explicit.

class stream_key extends uvm_object;


int unsigned stream_id;
int unsigned transaction_id;

function new(string name = "stream_key");
super.new(name);
endfunction

endclass

However, there is an important SystemVerilog detail: associative-array indexing with class objects requires careful handling of object identity and key lifetime. For simple environments, a packed or scalar composite key is often easier to reason about.

For example, if the widths are known:

typedef bit [7:0]  stream_id_t;


typedef bit [31:0] transaction_id_t;

typedef struct packed {
stream_id_t       stream;
transaction_id_t  id;
} correlation_key_t;

packet expected_by_key[correlation_key_t];

This representation makes the key itself part of the verification architecture:

+-------------------+


| correlation key       |
| --------------------- |
| stream = 2            |
| id     = 37           |
| +-------------------+ |


      |
      v


expected transaction

Step 5: Keep stream-specific ordering rules

Multiple streams may have different ordering guarantees.

For example:

Request channel:


in-order

Response channel:
out-of-order by ID

Event channel:
independent asynchronous events

A single global FIFO would be a poor representation of this environment.

Instead, model each stream according to its own semantics:

Request stream  ---> ordered queue


Response stream ---> ID-keyed table

Event stream    ---> event-specific checker

A multi-stream scoreboard is therefore often a coordinator of several checking mechanisms rather than one universal comparison algorithm.

Step 6: Independent streams in one scoreboard

Suppose a DUT has two independent response channels. Each channel uses IDs, but the IDs are local to the channel.

class multi_stream_scoreboard extends uvm_scoreboard;


packet expected_a[int unsigned];
packet expected_b[int unsigned];

function void add_expected_a(packet tr);


if (expected_a.exists(tr.id)) begin
  `uvm_error("SB_A_DUP",
    $sformatf("Duplicate expected ID on stream A: %0d", tr.id))
  return;
end

expected_a[tr.id] = tr;


endfunction

function void add_expected_b(packet tr);


if (expected_b.exists(tr.id)) begin
  `uvm_error("SB_B_DUP",
    $sformatf("Duplicate expected ID on stream B: %0d", tr.id))
  return;
end

expected_b[tr.id] = tr;


endfunction

endclass

The separate tables prevent an ID collision between the streams.

Step 7: Shared state for cross-stream relationships

Now consider a different protocol. A command on stream A causes the DUT to produce a completion on stream B.

Stream A:


COMMAND ID=21
|
v
DUT
|
v
Stream B:
COMPLETION ID=21

The scoreboard must retain information from stream A until the corresponding stream B transaction arrives.

Stream A command
  |
  v


outstanding_by_id[21]
|
| later
v
Stream B completion
|
v
lookup ID 21
|
+---- compare relationship
|
v
delete outstanding ID 21

This is where a centralized scoreboard can provide real value: it has visibility into both sides of a cross-stream relationship.

Step 8: Correlate different transaction types

Cross-stream transactions do not always use the same transaction class.

For example:

command_transaction


id
address
operation

completion_transaction
id
status

The scoreboard may need to retain the command and later validate the completion against it.

command_by_id[command.id] = command;

Then:

command = command_by_id[completion.id];


if (completion.status != expected_status(command))
`uvm_error(...)

This is not simply a field-by-field comparison between identical objects. It is a relationship check between transactions from different streams.

Step 9: Do not force unrelated streams into one predictor

A common architectural mistake is to create one enormous predictor that consumes every interface in the environment and produces one giant expected transaction type.

This can make the predictor difficult to understand and difficult to reuse.

Prefer separate prediction paths when the protocols or algorithms are independent:

Monitor A --> Predictor A --+
                         |


Monitor B --> Predictor B --+--> Scoreboard
|
Monitor C --> Predictor C --+

The scoreboard can then perform the required correlation without owning every piece of prediction logic.

Step 10: Understand event ordering across streams

Multiple streams can produce transactions concurrently. The order in which UVM callback methods execute is not automatically a protocol-level ordering guarantee.

For example, these two events may occur close together:

Stream A: command ID=9


Stream B: completion ID=9

If the scoreboard receives the completion before it has processed the command expectation, it must have an architecture that can handle that situation.

Possible solutions include:

  • ensuring the protocol guarantees the command is observed first,
  • buffering the completion until the related expectation is available, or
  • using a unified event-processing mechanism.

Do not rely on accidental simulator scheduling order to establish a verification relationship.

Step 11: Handle independent and correlated streams differently

A useful design can contain both kinds of checking.

                 +--------------------------+


Stream A ------->| Stream A checker          |
+--------------------------+


             +--------------------------+


Stream B ------->| Stream B checker          |
+--------------------------+

Stream A ------+
|
v
+-------------------+
Stream B ->| Cross-stream      |
| correlation       |
+-------------------+

This keeps independent checks simple while allowing the scoreboard to validate relationships that span interfaces.

Step 12: Diagnose which stream failed

Multi-stream environments can produce confusing failures unless every diagnostic identifies the stream.

`uvm_error("SB_RESPONSE",


$sformatf(
"Stream=%0d ID=%0d response mismatch",
stream_id,
actual.id
)
)

Useful diagnostic context includes:

  • stream or channel name,
  • transaction ID,
  • correlation key,
  • expected and actual values,
  • number of outstanding transactions for that stream,
  • related transaction from another stream, and
  • reset or transaction epoch when relevant.

A message such as Response mismatch is much less useful than:

Stream=RX


ID=37
Expected status=OK
Actual status=ERROR
Outstanding RX transactions=4
Related command address=0x1040

Common mistakes

1. Using one global FIFO for all streams

This destroys stream identity and can cause unrelated transactions to be compared. Preserve stream boundaries unless the protocol explicitly defines a global ordering.

2. Assuming IDs are globally unique

IDs are frequently scoped to a channel, source, or protocol context. Include that context in the correlation key when necessary.

3. Using separate scoreboards when cross-stream checking is required

Independent scoreboards cannot prove relationships they never see together. If a completion must correspond to a command, some component must retain and correlate both.

4. Putting all prediction logic into the scoreboard

A scoreboard that calculates every expected result becomes difficult to reuse and difficult to debug. Keep algorithmic prediction in the predictor/reference-model path.

5. Assuming callback order equals protocol order

Concurrent streams require explicit synchronization or buffering when the correctness relationship depends on event ordering.

6. Clearing all streams on every local error

One bad transaction should not automatically destroy unrelated outstanding state. Preserve enough state to diagnose subsequent failures unless the environment explicitly enters a recovery state.

7. Ignoring reset boundaries

A reset can invalidate outstanding transactions on one or several streams. Decide which state belongs to the old transaction epoch and which belongs to the new one.

Debugging a multi-stream failure

When a multi-stream scoreboard reports a failure, first determine whether it is a local stream problem or a correlation problem.

Failure


|
+--> One stream only?
|       |
|       +--> Check that stream's monitor/predictor/checker
|
+--> Multiple streams affected?
|       |
|       +--> Check shared state, reset, or common prediction
|
+--> Correlation key wrong?
|       |
|       +--> Check stream/channel/ID construction
|
+--> Related transaction missing?
|
+--> Check acceptance, buffering, and synchronization

A particularly useful debug technique is to reconstruct the transaction history per stream before looking at the combined scoreboard state.

Stream A:


A0  A1  A2  A3

Stream B:
B0  B1  B2

Correlation:
A0 -> B1
A1 -> B0
A2 -> B2

This often exposes an incorrect key or an incorrect assumption about which events belong together.

Separate scoreboards or one multi-stream scoreboard?

Situation Preferred approach
Streams are completely independent Separate scoreboards are often clearer
Streams share common matching infrastructure A shared scoreboard may be appropriate
Transactions must be correlated across streams Use a common correlation/checking component
Streams have very different protocols Keep protocol-specific checkers separate and coordinate only where necessary
Several streams share one transaction identity domain Use an explicit composite correlation key

There is no rule that says a UVM environment should contain exactly one scoreboard. The best architecture is the one that represents the verification relationships clearly.

Practical architecture example

Consider a DUT with a command interface and two response channels:

                    +----------------+


Command monitor --->|                |
|      DUT       |---> Response A monitor
Data monitor ------>|                |
|                |---> Response B monitor
+----------------+

Suppose:

  • commands generate expectations,
  • response A is in-order,
  • response B is out-of-order by ID, and
  • response A and response B must both correspond to the original command.

A reasonable architecture is:

Command monitor
  |
  v


Predictor
|
+--------------------------+
|                          |
v                          v
Expected A                   Expected B
|                          |
v                          v
Ordered checker             ID-keyed checker
|                          |
+------------+-------------+
|
v
Cross-stream checks

The important point is that each stream uses the checking mechanism appropriate to its ordering semantics while the shared correlation state verifies relationships between them.

Try it yourself

Design a scoreboard for a DUT with two response streams, A and B.

  1. Both streams use transaction IDs that are local to the stream.
  2. Stream A responses are guaranteed in order.
  3. Stream B responses may complete out of order.
  4. Every response must correspond to an accepted command.
  5. The same numeric ID may appear simultaneously on streams A and B.

Decide:

  1. What expected state must be stored?
  2. Which streams need FIFO-style matching?
  3. Which stream needs ID-based matching?
  4. What should the correlation key contain?
  5. Which failures should be reported independently?
  6. Which checks require information from both streams?

Challenge: cross-stream correlation

Extend the design so that one command produces both:

Response A:


ID
status

Response B:
ID
data

The scoreboard must verify that:

  • both responses correspond to the same accepted command,
  • each response contains the correct ID,
  • the status is correct,
  • the returned data is correct, and
  • responses may arrive in either order.

Inject the following failures one at a time:

  • response A missing,
  • response B missing,
  • wrong ID on response A,
  • wrong ID on response B,
  • correct IDs but incorrect data,
  • duplicate response, and
  • reset while one response is still outstanding.

The goal is not merely to detect an error. The goal is to identify which relationship or stream failed.

Self-check

  1. Do multiple streams always require one scoreboard?
    No. Independent streams are often clearer with separate scoreboards or checkers.
  2. When is a centralized scoreboard useful?
    When correctness depends on relationships between transactions from different streams or when common correlation state is required.
  3. Why might two streams with ID=5 need different tracking entries?
    Because the ID may only be unique within each stream. The stream identity may need to be part of the correlation key.
  4. Can two streams use different matching algorithms?
    Yes. One stream may be checked in order while another uses ID-based out-of-order matching.
  5. Why should prediction usually remain outside the scoreboard?
    Keeping prediction separate makes the reference model and predictor reusable and keeps the scoreboard focused on comparison and correlation.
  6. Why can callback arrival order be dangerous?
    Concurrent UVM processes do not automatically establish a protocol-level relationship between transactions. Required synchronization must be explicit.
  7. What is the main question to ask before combining streams?
    Whether correctness requires those streams to be correlated or whether they can be checked independently.

Key takeaways

  • Multi-stream checking starts by identifying the relationships between streams.
  • Independent streams can often be checked independently; cross-stream behavior requires shared correlation state.
  • Stream identity may need to be part of the correlation key when IDs are locally scoped.
  • Different streams can legitimately use different ordering and matching strategies.
  • A centralized scoreboard should coordinate checking, not absorb every prediction algorithm.
  • Do not rely on incidental UVM callback or simulator scheduling order for protocol-level relationships.
  • Reset must define how outstanding state is handled across every affected stream.
  • Good diagnostics identify the stream, correlation key, related transaction, and failure type.

Where this fits in the learning path

Lesson 21  Scoreboard Design Patterns
 |
 v


Lesson 22  Reference Models
|
v
Lesson 23  Predictors
|
v
Lesson 24  In-Order Scoreboards
|
v
Lesson 25  Out-of-Order Scoreboards
|
v
Lesson 26  Multi-Stream Scoreboards
|
+----> Lesson 27  Error Handling Strategies
|
+----> Lesson 28  Timeout Detection
|
+----> Lesson 29  End-of-Test Scoreboard Draining
|
+----> Lesson 30  Debug-Friendly Diagnostics

Lesson 24 introduced positional checking. Lesson 25 introduced correlation-based checking for out-of-order completion. Lesson 26 combines those ideas across multiple transaction domains: some streams may be independent, some may require ID-based matching, and some may need explicit cross-stream correlation.

The next lesson, Lesson 27: Error Handling Strategies, builds on this architecture by addressing what the environment should do when one of these checks fails—how to classify errors, preserve useful state, control reporting, and keep a regression useful after the first failure.