Skip to guide

Concurrency and performance

QoS, Fairness, and Backpressure

Treat latency, bandwidth share, starvation, and credit conservation as correctness properties under sustained contention.

Watercolor of a verification workstation with waveform traces and a development board.
Trace the mechanism from failure signature through independent evidence, component ownership, stress, and recovery.

Mechanism and evidence

Guided verification lab

Measure service against actual demand.

Scrub the grant history to inspect service share and the age of each waiting class.

STEP THROUGH
STATE & OBSERVATIONWeighted service / 1 of 25

Checkpoint 1 · No grants have been observed yet.

GRANT
A COUNT
0
B COUNT
0
C AGE (ns)
0
Compare all 25 checkpoints
  1. 1 · No grants have been observed yet.

    GRANT
    A COUNT
    0
    B COUNT
    0
    C AGE (ns)
    0
  2. 2 · Inspect grants through 100 ns.

    GRANT
    A
    A COUNT
    1
    B COUNT
    0
    C AGE (ns)
    100
  3. 3 · Inspect grants through 200 ns.

    GRANT
    A
    A COUNT
    2
    B COUNT
    0
    C AGE (ns)
    200
  4. 4 · Inspect grants through 300 ns.

    GRANT
    B
    A COUNT
    2
    B COUNT
    1
    C AGE (ns)
    300
  5. 5 · Inspect grants through 400 ns.

    GRANT
    C
    A COUNT
    2
    B COUNT
    1
    C AGE (ns)
    0
  6. 6 · Inspect grants through 500 ns.

    GRANT
    A
    A COUNT
    3
    B COUNT
    1
    C AGE (ns)
    100
  7. 7 · Inspect grants through 600 ns.

    GRANT
    A
    A COUNT
    4
    B COUNT
    1
    C AGE (ns)
    200
  8. 8 · Inspect grants through 700 ns.

    GRANT
    B
    A COUNT
    4
    B COUNT
    2
    C AGE (ns)
    300
  9. 9 · Inspect grants through 800 ns.

    GRANT
    C
    A COUNT
    4
    B COUNT
    2
    C AGE (ns)
    0
  10. 10 · Inspect grants through 900 ns.

    GRANT
    A
    A COUNT
    5
    B COUNT
    2
    C AGE (ns)
    100
  11. 11 · Inspect grants through 1000 ns.

    GRANT
    A
    A COUNT
    6
    B COUNT
    2
    C AGE (ns)
    200
  12. 12 · Inspect grants through 1100 ns.

    GRANT
    B
    A COUNT
    6
    B COUNT
    3
    C AGE (ns)
    300
  13. 13 · Inspect grants through 1200 ns.

    GRANT
    C
    A COUNT
    6
    B COUNT
    3
    C AGE (ns)
    0
  14. 14 · Inspect grants through 1300 ns.

    GRANT
    A
    A COUNT
    7
    B COUNT
    3
    C AGE (ns)
    100
  15. 15 · Inspect grants through 1400 ns.

    GRANT
    A
    A COUNT
    8
    B COUNT
    3
    C AGE (ns)
    200
  16. 16 · Inspect grants through 1500 ns.

    GRANT
    B
    A COUNT
    8
    B COUNT
    4
    C AGE (ns)
    300
  17. 17 · Inspect grants through 1600 ns.

    GRANT
    C
    A COUNT
    8
    B COUNT
    4
    C AGE (ns)
    0
  18. 18 · Inspect grants through 1700 ns.

    GRANT
    A
    A COUNT
    9
    B COUNT
    4
    C AGE (ns)
    100
  19. 19 · Inspect grants through 1800 ns.

    GRANT
    A
    A COUNT
    10
    B COUNT
    4
    C AGE (ns)
    200
  20. 20 · Inspect grants through 1900 ns.

    GRANT
    B
    A COUNT
    10
    B COUNT
    5
    C AGE (ns)
    300
  21. 21 · Inspect grants through 2000 ns.

    GRANT
    C
    A COUNT
    10
    B COUNT
    5
    C AGE (ns)
    0
  22. 22 · Inspect grants through 2100 ns.

    GRANT
    A
    A COUNT
    11
    B COUNT
    5
    C AGE (ns)
    100
  23. 23 · Inspect grants through 2200 ns.

    GRANT
    A
    A COUNT
    12
    B COUNT
    5
    C AGE (ns)
    200
  24. 24 · Inspect grants through 2300 ns.

    GRANT
    B
    A COUNT
    12
    B COUNT
    6
    C AGE (ns)
    300
  25. 25 · Inspect grants through 2400 ns.

    GRANT
    C
    A COUNT
    12
    B COUNT
    6
    C AGE (ns)
    0
12345678910111213141516171819202122232425GRANTAABCAABCAABCAABCAABCAABCA COUNT01222344456667888910101011121212B COUNT0001111222233334444555566C AGE (ns)0100200300010020030001002003000100200300010020030001002003000
Inspect the contract

No grants have been observed yet.

A share
A wait
0 ns
B share
B wait
0 ns
C share
C wait
0 ns

Every active class begins with pending demand. Service percentages are undefined until the first grant.

Evidence to inspect

Inspect the grant timestamp, current demand, and waiting age for each class.

Checkpoint 1 / 25
Inspect the checker Selected checkpoint pseudocode
Conceptual checker / selected checkpoint
age = now - last_grant_or_arrival;
if (pending_demand && age > 2000)
  report_starvation();
Example contract & limitations

Example contract. Each grant serves one equal-size request every 100 ns. A demanding class immediately replenishes its request. The illustrative age bound is 2,000 ns, with a violation only when age > 2,000 ns. Shares describe this finite fixture. Checkpoints show selected state changes, not equally spaced simulation cycles.

Read the complete walkthrough

Weighted service

  1. No grants have been observed yet.. Every active class begins with pending demand. Service percentages are undefined until the first grant. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  2. Inspect grants through 100 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  3. Inspect grants through 200 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  4. Inspect grants through 300 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  5. Inspect grants through 400 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  6. Inspect grants through 500 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  7. Inspect grants through 600 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  8. Inspect grants through 700 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  9. Inspect grants through 800 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  10. Inspect grants through 900 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  11. Inspect grants through 1000 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  12. Inspect grants through 1100 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  13. Inspect grants through 1200 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  14. Inspect grants through 1300 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  15. Inspect grants through 1400 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  16. Inspect grants through 1500 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  17. Inspect grants through 1600 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  18. Inspect grants through 1700 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  19. Inspect grants through 1800 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  20. Inspect grants through 1900 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  21. Inspect grants through 2000 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  22. Inspect grants through 2100 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  23. Inspect grants through 2200 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  24. Inspect grants through 2300 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  25. Inspect grants through 2400 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.

Starve class C

  1. No grants have been observed yet.. Every active class begins with pending demand. Service percentages are undefined until the first grant. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  2. Inspect grants through 100 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  3. Inspect grants through 200 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  4. Inspect grants through 300 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  5. Inspect grants through 400 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  6. Inspect grants through 500 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  7. Inspect grants through 600 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  8. Inspect grants through 700 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  9. Inspect grants through 800 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  10. Inspect grants through 900 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  11. Inspect grants through 1000 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  12. Inspect grants through 1100 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  13. Inspect grants through 1200 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  14. Inspect grants through 1300 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  15. Inspect grants through 1400 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  16. Inspect grants through 1500 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  17. Inspect grants through 1600 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  18. Inspect grants through 1700 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  19. Inspect grants through 1800 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  20. Inspect grants through 1900 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  21. Inspect grants through 2000 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  22. Inspect grants through 2100 ns.. Class C has pending work but its request-to-grant age exceeds the example bound. Aggregate throughput cannot excuse this missing service. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  23. Inspect grants through 2200 ns.. Class C has pending work but its request-to-grant age exceeds the example bound. Aggregate throughput cannot excuse this missing service. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  24. Inspect grants through 2300 ns.. Class C has pending work but its request-to-grant age exceeds the example bound. Aggregate throughput cannot excuse this missing service. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  25. Inspect grants through 2400 ns.. Class C has pending work but its request-to-grant age exceeds the example bound. Aggregate throughput cannot excuse this missing service. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.

Class C is idle

  1. No grants have been observed yet.. Every active class begins with pending demand. Service percentages are undefined until the first grant. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  2. Inspect grants through 100 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  3. Inspect grants through 200 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  4. Inspect grants through 300 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  5. Inspect grants through 400 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  6. Inspect grants through 500 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  7. Inspect grants through 600 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  8. Inspect grants through 700 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  9. Inspect grants through 800 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  10. Inspect grants through 900 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  11. Inspect grants through 1000 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  12. Inspect grants through 1100 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  13. Inspect grants through 1200 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  14. Inspect grants through 1300 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  15. Inspect grants through 1400 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  16. Inspect grants through 1500 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  17. Inspect grants through 1600 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  18. Inspect grants through 1700 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  19. Inspect grants through 1800 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  20. Inspect grants through 1900 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  21. Inspect grants through 2000 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  22. Inspect grants through 2100 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  23. Inspect grants through 2200 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  24. Inspect grants through 2300 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
  25. Inspect grants through 2400 ns.. Compute shares from the selected prefix. Waiting age resets on a grant, and an idle class has no starvation obligation. Evidence: Inspect the grant timestamp, current demand, and waiting age for each class.
Related implementation: Track per-priority latency
realtime total_latency[int];
int      trans_count[int];
realtime last_access_time[int];

realtime MAX_LATENCY_THRESHOLD = 500ns;
realtime STARVATION_TIMEOUT     = 2000ns;

virtual function void write(mac_item t);
  realtime latency = t.complete_time - t.accept_time;
  int p = t.priority;

  total_latency[p] += latency;
  trans_count[p]++;
  last_access_time[p] = $realtime;

  if (latency > MAX_LATENCY_THRESHOLD)
    uvm_report_warning("QOS_TAIL", "Latency exceeded 500 ns");

  uvm_report_info(
    "PERF_STATS",
    $sformatf("Prio=%0d Avg=%0t Count=%0d",
              p, total_latency[p] / trans_count[p], trans_count[p]),
    UVM_HIGH
  );
endfunction

The source formula is latency = complete_time - accept_time, and the running average is total_latency[p] / trans_count[p]. The example threshold is 500 ns.

Weighted service, checkpoint 1: No grants have been observed yet.. Inspect the contract.
Understand the failure
Contention as correctnessMeasure share, latency, starvation, and conserved credits together.

A weighted arbiter can meet aggregate bandwidth while still starving one class, leaking credits, or violating a bounded-latency promise.

The percentages and oldest-request ages below illustrate a separate observation window. The 12-cycle strip that follows shows its own grant and waiting-age sequence.

Realtimetarget 50% · observed 48%oldest 42 cyclesComputetarget 30% · observed 31%oldest 87 cyclesBackgroundtarget 20% · observed 21%oldest 143 cycles
12-cycle grant and age traceAggregate share can pass while one request approaches its starvation deadline.
grantRTCPRTBGRTCPRTCPRTBGRTCP
BG age012grant01234grant01
pending BG requestmust grant before age 6
Issued credits64Free19In flight45Starvation bound< 2,000 ns

demand pending → eventual grant within class bound · free + in_flight = issued credits

From pressure to proof

Traffic weights configure the load, timestamped grants create evidence, and independent starvation and credit checks explain performance failures.

Weighted sequences
Generate priority-tagged streams with controlled offered load.
Arbiter and buffers
Apply priority, fairness, credit, and backpressure policy.
Timestamp monitor
Records request, grant, and completion boundaries.
Performance subscriber
Builds latency distributions, p99, bandwidth, and grant share.
Starvation watchdog
Checks pending demand against the 2000 ns example timeout.
Credit model
Detects lost credits and throughput decay.
  1. Weighted sequences -> Arbiter and buffers
  2. Arbiter and buffers -> Timestamp monitor
  3. Timestamp monitor -> Performance subscriber
  4. Timestamp monitor -> Starvation watchdog
  5. Arbiter and buffers -> Credit model
  6. Performance subscriber + Starvation watchdog + Credit model -> QoS verdict

Why it matters

  • A chip can move every bit correctly and still be unusable because its performance policy is broken.
  • For example, a GPU stream can starve CPU memory traffic even though every individual transaction is protocol-correct.
  • QoS verification must prove that each priority class receives its specified bandwidth and latency behavior under congestion.

What is difficult

  • Long-tail starvation may appear only once in a very large sample, such as a request waiting 10,000 cycles for a grant.
  • Weighted Round Robin and related arbiters are intentionally difficult to predict cycle by cycle under random stimulus.
  • Fairness requires statistical or bounded evidence, not a few successful transfers.
  • A credit leak can degrade throughput slowly enough that short tests pass.
  • A watchdog must distinguish an actively starved class from one with no pending demand.

Failure signatures

  • A low-priority request waits beyond its allowed starvation bound.
  • A high-priority stream misses its required bandwidth percentage.
  • Grant ratios do not converge toward programmed WRR weights.
  • A low-priority request blocks a high-priority request through a shared buffer or single-entry queue.
  • READY deassertion on the final beat causes duplication, loss, or state corruption.
  • Flow-control credits leak and total throughput decays over a long run.
Compare approaches

Two viable approaches—and their cost

Statistical performance subscriber

Collect latency and bandwidth distributions from accepted and completed transactions.

Strengths
  • Non-intrusive and implementation-independent.
  • Provides a global view of latency, bandwidth share, and tail behavior.
Costs
  • Needs explicit thresholds or post-processing to turn statistics into pass-fail decisions.
  • A finite sample cannot prove every possible starvation trace.

Credit-based tracking

Mirror the DUT's internal flow-control credit accounting in the testbench.

Strengths
  • Detects credit leaks that slowly reduce throughput.
  • Can localize a performance failure to a conservation error.
Costs
  • Tightly coupled to RTL implementation details.
  • Sensitive to arbiter and buffering changes.
Explain it in an interview

Interview answer, built from the mechanism

  1. Use pressure-cooker stimulus: saturate the arbiter with several high-priority streams plus at least one low-priority stream.
  2. Record request, grant, and completion timestamps. Build latency distributions, tail percentiles, throughput, and grant-share metrics per priority.
  3. Fail a class that exceeds its latency or starvation bound, and fail a high-priority class that misses its specified bandwidth share.
  4. Run long regressions and track credit conservation and aggregate throughput so slow credit leaks cannot hide behind short functional tests.
Assign responsibilities

Component responsibility contract

Component responsibilities and required verification changes for QoS, Fairness, and Backpressure
ComponentResponsibilityRequired change
Agent configTraffic shapingAdd Weight and Priority knobs for sequences.
MonitorTimestampsRecord req_time, gnt_time, and data_done_time.
SubscriberStatisticsCollect minimum, maximum, average, histogram, and tail latency by priority.
WatchdogStarvationCheck only priority classes with pending demand against their timeout.
Credit modelConservationTrack issued, consumed, and returned credits over long runs.
Build the checker

Implementation patterns

Track per-priority latencysystemverilog
realtime total_latency[int];
int      trans_count[int];
realtime last_access_time[int];

realtime MAX_LATENCY_THRESHOLD = 500ns;
realtime STARVATION_TIMEOUT     = 2000ns;

virtual function void write(mac_item t);
  realtime latency = t.complete_time - t.accept_time;
  int p = t.priority;

  total_latency[p] += latency;
  trans_count[p]++;
  last_access_time[p] = $realtime;

  if (latency > MAX_LATENCY_THRESHOLD)
    uvm_report_warning("QOS_TAIL", "Latency exceeded 500 ns");

  uvm_report_info(
    "PERF_STATS",
    $sformatf("Prio=%0d Avg=%0t Count=%0d",
              p, total_latency[p] / trans_count[p], trans_count[p]),
    UVM_HIGH
  );
endfunction

The source formula is latency = complete_time - accept_time, and the running average is total_latency[p] / trans_count[p]. The example threshold is 500 ns.

Check starvation periodicallysystemverilog
virtual task run_phase(uvm_phase phase);
  forever begin
    #100ns;
    foreach (last_access_time[p]) begin
      if (pending_count[p] > 0 &&
          ($realtime - last_access_time[p]) > STARVATION_TIMEOUT)
        uvm_report_error(
          "QOS_STARVATION",
          $sformatf("Priority %0d waited more than %0t",
                    p, STARVATION_TIMEOUT)
        );
    end
  end
endtask

The source checks every 100 ns with a 2000 ns timeout. The pending-demand guard prevents an idle traffic class from being mislabeled as starved.

Report final averagessystemverilog
virtual function void report_phase(uvm_phase phase);
  foreach (trans_count[p]) begin
    uvm_report_info(
      "QOS_REPORT",
      $sformatf("Prio %0d: %0d packets, Avg latency %0t",
                p, trans_count[p],
                total_latency[p] / trans_count[p]),
      UVM_LOW
    );
  end
endfunction

Average latency is useful context, but signoff also needs tail, maximum, bandwidth share, starvation, and credit-conservation results.

Stress the design

Stress recipe

  1. Saturate the fabric with several high-priority streams and one continuously pending low-priority stream.
  2. Run at least the source example of 10,000 transactions for a WRR grant-ratio check.
  3. Measure request-to-grant and request-to-completion latency, bandwidth share, p99, maximum, and starvation duration by priority.
  4. Drop READY on the final beat and other state-transition boundaries.
  5. Run long enough to reveal a slow credit leak and compare total throughput over successive windows.

Follow-up questions

How do you verify Weighted Round Robin?

Run a large window, such as 10,000 transactions, count grants by class, and compare the observed grant ratios with the programmed weights using a justified statistical tolerance.

How do you expose backpressure bugs?

Use a Ready-Toggle sequence that deasserts READY at difficult boundaries, especially the final beat of a burst, then prove state and payload remain stable until the transfer completes.

What common QoS bug should you look for?

Priority inversion, where a low-priority request blocks high-priority work through a shared buffer, dependency, or single-entry queue.

Engineering qualifications