A random generator that picks each DCRouter packet independently almost never sends all four inputs to output 0 for a hundred packets in a row, never goes quiet long enough for the router to sleep in the middle of a burst, and never changes the priority setting while traffic is flowing. Real systems do all three every day: a memory controller is a hot spot, software idles between jobs, drivers reconfigure on the fly. Independent random packets are realistic one at a time and unrealistic together.
How do you build realistic traffic out of random pieces?
The obvious approach is to make one generator smarter: add knobs for hot spots, bursts and idle gaps until it can produce anything. A single generator with every knob becomes impossible to reason about, and each test needs a different combination of knob settings. Real traffic has structure at several time scales: within a packet, across a few packets, across ports, and across the whole test. Stimulus should have the same structure.
Layer | Random choices | DCRouter examples |
|---|---|---|
Packet | Fields under constraints | Destination, priority, length, fault |
Flow | How packets on one input relate | Back-to-back to one destination; alternating destinations; a run of length-15 packets |
Traffic pattern | How inputs relate | Uniform; hot spot (all inputs to one output); permutation (each input to a different output); one input alone |
Scenario | How the test evolves | Configure, burst, quiet gap, sleep, wake from one port, change prio_en mid-traffic, error burst, register audit |
Bug Zoo bug | Needs | Why |
|---|---|---|
BUG_24 (back-to-back packets reuse the old destination) | Flow: packets back to back, with no gap, to changing outputs | Idle gaps between packets make it rarer; a directed writer's "realistic" runs to one output remove it (lesson 4.1) |
BUG_6, BUG_7 (priority ignored or misapplied) | Traffic pattern: hot spot | Priority only matters when high- and low-priority inputs contend for one output at once (and needs an arbitration check, Part 5) |
BUG_11 (simultaneous tails miscounted) | Traffic pattern: permutation with equal lengths | Packets on several outputs end together |
BUG_20 (sleeps with an output locked) | Scenario: a mid-packet pause with all else idle | Needs quiet across every port at once |
BUG_21 (port 3 cannot wake it) | Scenario: sleep, then one input alone | A wake from a single, specific port |
BUG_7 (priority applied when disabled) | Scenario: change prio_en, then contend | A configuration change followed by the right traffic (and a check that can see it) |
Lesson 4.10's random hunt uses a light version of all four layers: random packets, random active-input sets per round, random timing profiles, and quiet gaps between rounds. That is why it catches BUG_20 and BUG_21, which independent random packets rarely reach.
Each layer randomises only its own decisions and delegates the rest downward.
Layers are reusable: the same flows serve many patterns; the same patterns serve many scenarios.
Tests are mostly scenario choices: a new test is a new composition, not a new generator.
Every layer gets coverage: patterns and scenarios that were never generated are holes too (Part 6).
Practice | Purpose |
|---|---|
Sequences of sequences (UVM virtual sequences) | Scenarios coordinate traffic across several interfaces |
A library of traffic patterns | Hot spots, permutations and bursts reused across blocks |
Scenario-level coverage | Shows which phases and transitions were exercised |
A team (illustrative) ran millions of independent random transactions on an interconnect and saw no starvation, then found it in system simulation within an hour: one master issued a long burst to the same memory while others polled it. The pattern needed was a hot spot with one long flow. Independent transactions almost never formed it.
A flow that sends packets back to back, with no idle cycles, on one input to changing destinations.
A hot spot makes starvation happen, but every packet still arrives intact; a fairness check (Part 5) is needed to detect it.
Independent random packets are realistic one at a time and unrealistic together.
Layer stimulus: packets, flows, traffic patterns, scenarios, each random in its own decisions.
Many system bugs need a pattern or scenario (contention, bursts, quiet, reconfiguration), not just an unusual packet.