Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Course
  • Reading Paths
  • Concept Map
  • Meet DCRouter
  • Glossary
  • Part 0: What Verification Is8
  • Part 1: What Can Go Wrong11
  • Part 2: Specifications as Checkable Rules8
  • Part 3: Observability and Controllability7
  • Part 4: Stimulus11
    • Directed Tests
    • Why Random Works
    • Constrained Random
    • Distributions and Bias
    • The Long Tail
    • Scenarios and Layered Stimulus
    • Error Injection
    • Timing and Back-Pressure
    • Seeds and Regressions
    • Hunting the Zoo with Random
    • Drills: Stimulus
  • Part 5: Checking11
  • Part 6: Coverage10
  • Part 7: Formal and Simulation10
  • Part 8: Verification Levels and Reuse8
  • Part 9: Planning and Risk9
  • Part 10: Emulation and Prototyping8
  • Part 11: Post-Silicon Validation8
  • Part 12: Bug Economics8
  • Part 13: Debug7
  • Part 14: Sign-Off7
  • Part 15: Verification in Context8
  • Part 16: Case Studies5
  • Part 17: Capstones5
  • Part 18: Interview Preparation6
Loading lesson

‹Part 4: Stimulus
  1. Topics
  2. First Principles of Verification Strategy
  3. Part 4: Stimulus
  4. Scenarios and Layered Stimulus

Part 4 · Stimulus · Senior (S)

Scenarios and Layered Stimulus

Independent random packets rarely form the patterns real systems produce: bursts, hot spots, idle periods, configuration changes mid-traffic. Layered stimulus builds them from small pieces: packets, flows, traffic patterns across ports, and scenarios over time. The four layers for DCRouter, and which Bug Zoo bugs need which layer.

On this page

    Note

    Level: Senior (S) · Answers: How do we drive the design into the states that matter?

    Before this: The Long Tail

    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 answer, and why it breaks

    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.

    The idea: four layers

    A scenario sequences traffic patterns over time; a pattern assigns flows to inputs; a flow strings packets together; a packet is randomised under constraints.

    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

    Which bugs need which layer

    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.

    Design rules for layered stimulus

    • 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).

    How real teams build it

    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

    What breaks

    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.

    Why this matters

    Senior lens. Ask what structure real traffic has at each time scale, and give the stimulus the same layers. Most interesting system bugs need a pattern or a scenario, not just an unusual packet: contention, bursts, quiet periods, reconfiguration. A packet generator alone is breadth without structure.

    Interview

    Asked: "Why layer stimulus?"

    Weak answer: It's how UVM does it.

    Strong answer: Because real traffic has structure at several time scales, and many bugs need that structure: contention needs a hot spot, starvation needs long flows, low-power bugs need quiet periods across every port, configuration bugs need a change followed by the right traffic. Layers (packet, flow, traffic pattern, scenario) let each level randomise its own choices and compose the level below, so new tests are new compositions rather than new generators, and each layer can be covered.

    Follow-ups: (1) Which DCRouter bug needs a hot-spot pattern? (2) How would you cover scenarios?

    Check yourself Which layer would you add to make BUG_24 routine instead of a coincidence?

    A flow that sends packets back to back, with no idle cycles, on one input to changing destinations.

    Check yourself Why does reaching BUG_5's state not guarantee catching it?

    A hot spot makes starvation happen, but every packet still arrives intact; a fairness check (Part 5) is needed to detect it.

    Key takeaways

    • 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.

    Keep going

    Next: Lesson 4.7, Error Injection. Driving faulty input on purpose.

    Related topics

    • Part 4 overview: Stimulus

    • UVM course: Sequences

    Previous

    45 / 160

    Next: Error Injection

    Up next

    Up nextError Injection

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Directed Tests
    • Why Random Works
    • Constrained Random