Treat latency, bandwidth share, starvation, and credit conservation as correctness properties under sustained contention.
Trace the mechanism from failure signature through independent evidence, component ownership, stress, and recovery.
A worked mechanism
A busy class can still contain a starving request.
Measure the age of each eligible request at the service boundary promised by the scheduler.
01
Request A becomes eligible
A waiting since cycle 0
The watchdog starts even if this class has never completed a request.
↓
02
Other work progresses
B granted at 20; C at 40
Unrelated progress does not reset A’s individual service age.
↓
03
Check A at cycle 51
age(A)=51 > bound 50
The example bound is exceeded even though global throughput remains high.
Follow the stated ordering; spacing does not represent elapsed time.
Work it through
Choose the right fairness unit
A WRR scheduler weighted by bytes need not give equal packet counts when packet lengths differ.
Compare the configured service unit with continuously eligible demand and report oldest-request age separately.
Watch for this
Average latency excludes requests that never complete. A completion-only histogram cannot detect their starvation.
Check your reasoning
Keep A pending while other IDs complete, and include a newly active class with no prior grant. Check partial-round accounting as well as long-run ratios.
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 · 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
Weighted service · one column per checkpoint
Signal / state
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
GRANT
—
A
A
B
C
A
A
B
C
A
A
B
C
A
A
B
C
A
A
B
C
A
A
B
C
A COUNT
0
1
2
2
2
3
4
4
4
5
6
6
6
7
8
8
8
9
10
10
10
11
12
12
12
B COUNT
0
0
0
1
1
1
1
2
2
2
2
3
3
3
3
4
4
4
4
5
5
5
5
6
6
C AGE (ns)
0
100
200
300
0
100
200
300
0
100
200
300
0
100
200
300
0
100
200
300
0
100
200
300
0
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. Each active class has exactly one outstanding request; a grant immediately replaces it with the next 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
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.
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
// Teaching contract: requests are granted FIFO within each class.// Register every eligible request, including the first in a new class.
realtime waiting_since[int][$];
functionvoid note_request(int priority);
waiting_since[priority].push_back($realtime);
endfunction
functionvoid note_grant(int priority);
if (waiting_since.exists(priority) && waiting_since[priority].size())
void'(waiting_since[priority].pop_front());
else
uvm_report_error("QOS_GRANT", "Grant without an eligible request");
endfunction
virtualtask run_phase(uvm_phase phase);
forever begin
#100ns;
foreach (waiting_since[p]) beginif (waiting_since[p].size() > 0 &&
($realtime - waiting_since[p][0]) > STARVATION_TIMEOUT)
uvm_report_error("QOS_STARVATION", "Oldest request exceeded its bound");
endendendtask
The 100 ns polling interval reports within one poll after the 2000 ns example bound is exceeded. Aging starts at eligibility, including a class with no previous completion. Reset and cancellation must remove the affected requests; use per-request tags when grants within a class may reorder.
Average 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?
Keep compared classes continuously eligible and use the scheduler's service unit, such as grants, bytes, or cycles. Compare service over complete WRR rounds with the programmed weights and a bound for partial rounds. A 10,000-transaction sample alone proves neither a starvation bound nor byte fairness when transaction sizes differ.
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.