Mechanism and evidence
Measure service against actual demand.
Scrub the grant history to inspect service share and the age of each waiting class.
Checkpoint 1 · No grants have been observed yet.
- GRANT
- —
- A COUNT
- 0
- B COUNT
- 0
- C AGE (ns)
- 0
Compare all 25 checkpoints
1 · No grants have been observed yet.
- GRANT
- —
- A COUNT
- 0
- B COUNT
- 0
- C AGE (ns)
- 0
2 · Inspect grants through 100 ns.
- GRANT
- A
- A COUNT
- 1
- B COUNT
- 0
- C AGE (ns)
- 100
3 · Inspect grants through 200 ns.
- GRANT
- A
- A COUNT
- 2
- B COUNT
- 0
- C AGE (ns)
- 200
4 · Inspect grants through 300 ns.
- GRANT
- B
- A COUNT
- 2
- B COUNT
- 1
- C AGE (ns)
- 300
5 · Inspect grants through 400 ns.
- GRANT
- C
- A COUNT
- 2
- B COUNT
- 1
- C AGE (ns)
- 0
6 · Inspect grants through 500 ns.
- GRANT
- A
- A COUNT
- 3
- B COUNT
- 1
- C AGE (ns)
- 100
7 · Inspect grants through 600 ns.
- GRANT
- A
- A COUNT
- 4
- B COUNT
- 1
- C AGE (ns)
- 200
8 · Inspect grants through 700 ns.
- GRANT
- B
- A COUNT
- 4
- B COUNT
- 2
- C AGE (ns)
- 300
9 · Inspect grants through 800 ns.
- GRANT
- C
- A COUNT
- 4
- B COUNT
- 2
- C AGE (ns)
- 0
10 · Inspect grants through 900 ns.
- GRANT
- A
- A COUNT
- 5
- B COUNT
- 2
- C AGE (ns)
- 100
11 · Inspect grants through 1000 ns.
- GRANT
- A
- A COUNT
- 6
- B COUNT
- 2
- C AGE (ns)
- 200
12 · Inspect grants through 1100 ns.
- GRANT
- B
- A COUNT
- 6
- B COUNT
- 3
- C AGE (ns)
- 300
13 · Inspect grants through 1200 ns.
- GRANT
- C
- A COUNT
- 6
- B COUNT
- 3
- C AGE (ns)
- 0
14 · Inspect grants through 1300 ns.
- GRANT
- A
- A COUNT
- 7
- B COUNT
- 3
- C AGE (ns)
- 100
15 · Inspect grants through 1400 ns.
- GRANT
- A
- A COUNT
- 8
- B COUNT
- 3
- C AGE (ns)
- 200
16 · Inspect grants through 1500 ns.
- GRANT
- B
- A COUNT
- 8
- B COUNT
- 4
- C AGE (ns)
- 300
17 · Inspect grants through 1600 ns.
- GRANT
- C
- A COUNT
- 8
- B COUNT
- 4
- C AGE (ns)
- 0
18 · Inspect grants through 1700 ns.
- GRANT
- A
- A COUNT
- 9
- B COUNT
- 4
- C AGE (ns)
- 100
19 · Inspect grants through 1800 ns.
- GRANT
- A
- A COUNT
- 10
- B COUNT
- 4
- C AGE (ns)
- 200
20 · Inspect grants through 1900 ns.
- GRANT
- B
- A COUNT
- 10
- B COUNT
- 5
- C AGE (ns)
- 300
21 · Inspect grants through 2000 ns.
- GRANT
- C
- A COUNT
- 10
- B COUNT
- 5
- C AGE (ns)
- 0
22 · Inspect grants through 2100 ns.
- GRANT
- A
- A COUNT
- 11
- B COUNT
- 5
- C AGE (ns)
- 100
23 · Inspect grants through 2200 ns.
- GRANT
- A
- A COUNT
- 12
- B COUNT
- 5
- C AGE (ns)
- 200
24 · Inspect grants through 2300 ns.
- GRANT
- B
- A COUNT
- 12
- B COUNT
- 6
- C AGE (ns)
- 300
25 · Inspect grants through 2400 ns.
- GRANT
- C
- A COUNT
- 12
- B COUNT
- 6
- C AGE (ns)
- 0
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.
Inspect the grant timestamp, current demand, and waiting age for each class.
Inspect the checker Selected checkpoint pseudocode
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
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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
);
endfunctionThe 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.
Understand the failure+
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.
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.
- Weighted sequences -> Arbiter and buffers
- Arbiter and buffers -> Timestamp monitor
- Timestamp monitor -> Performance subscriber
- Timestamp monitor -> Starvation watchdog
- Arbiter and buffers -> Credit model
- 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.
- Non-intrusive and implementation-independent.
- Provides a global view of latency, bandwidth share, and tail behavior.
- 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.
- Detects credit leaks that slowly reduce throughput.
- Can localize a performance failure to a conservation error.
- Tightly coupled to RTL implementation details.
- Sensitive to arbiter and buffering changes.
Explain it in an interview+
Interview answer, built from the mechanism
- Use pressure-cooker stimulus: saturate the arbiter with several high-priority streams plus at least one low-priority stream.
- Record request, grant, and completion timestamps. Build latency distributions, tail percentiles, throughput, and grant-share metrics per priority.
- Fail a class that exceeds its latency or starvation bound, and fail a high-priority class that misses its specified bandwidth share.
- 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 | Responsibility | Required change |
|---|---|---|
| Agent config | Traffic shaping | Add Weight and Priority knobs for sequences. |
| Monitor | Timestamps | Record req_time, gnt_time, and data_done_time. |
| Subscriber | Statistics | Collect minimum, maximum, average, histogram, and tail latency by priority. |
| Watchdog | Starvation | Check only priority classes with pending demand against their timeout. |
| Credit model | Conservation | Track issued, consumed, and returned credits over long runs. |
Build the checker+
Implementation patterns
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
);
endfunctionThe 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.
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
endtaskThe source checks every 100 ns with a 2000 ns timeout. The pending-demand guard prevents an idle traffic class from being mislabeled as starved.
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
endfunctionAverage latency is useful context, but signoff also needs tail, maximum, bandwidth share, starvation, and credit-conservation results.
Stress the design+
Stress recipe
- Saturate the fabric with several high-priority streams and one continuously pending low-priority stream.
- Run at least the source example of 10,000 transactions for a WRR grant-ratio check.
- Measure request-to-grant and request-to-completion latency, bandwidth share, p99, maximum, and starvation duration by priority.
- Drop READY on the final beat and other state-transition boundaries.
- 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.

