Interview Question · Concept
What Fair Arbitration Really Means
The Question
The interviewer asks
Two masters share a bus through a round-robin arbiter. One sends 1-beat packets and the other sends 8-beat packets. Is the bus shared fairly?
You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
Fair in grants, not in bandwidth. Round robin gives each master one packet per turn, so the 8-beat master gets 8 of every 9 beats. If the goal is equal bandwidth, the arbiter must count beats, for example with deficit round robin or weights. Start by asking what "fair" means in the spec: grants, bandwidth, or a bounded latency.
open is open_q, the register that holds the grant.- Cycle 0
Cycle e4: A0.0 is leaving and
openis 1. The arbiter stays on A though B has words. - Cycle 2
Cycle e6: A0.2, the word with
last, sits in the output register. It was taken from the FIFO at edge 6, which clearedopen. - Cycle 4
Cycle e8: B0.0. B got its turn only after A's last word had left its FIFO.
- Cycle 7
Cycle e11: A1.0, a one-word packet, opens and closes in the same word.
Measured in lesson R5.6: the arbiter keeps each turn until the word with last has left. A turn lasts a whole packet, so a long packet takes more beats.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Mid-Level)
A good mid-level answer works out the 1-in-9 share without help. It then suggests counting beats instead of grants.
What Interviewers Listen For (Senior)
A good senior answer first asks what kind of fairness the system needs. It names the trade-off between equal bandwidth and worst-case latency, and says how to verify each one.
Cross-Questions
Where the interviewer goes next. Open a node to practise that follow-up.
WhyWhat IfCompareScale It
- What Fair Arbitration Really Means
-
CompareWeighted Round Robin Versus Deficit Round RobinL3 Senior
Compare weighted round robin with deficit round robin.
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
Weighted round robin gives each master a fixed number of grants per round. It suits equal-size transfers, but long packets still skew the bandwidth. Deficit round robin gives each master a budget of beats per turn and carries any unused budget to the next turn. So bandwidth follows the weights even with mixed packet sizes, at the cost of a counter per master.
Self-Check
Tick each key point you covered in your answer.
Half-Truth
"Give the short-packet master 8 grants per round and the problem is solved."
Only while the packet sizes stay exactly 1 and 8. With variable sizes the shares drift; counting beats tracks the real bandwidth.
Source Measured: the twin on this question, Icarus Verilog 12
-
WhyThe Worst-Case Wait Under Round RobinL2 Mid-LevelL3 Senior
Why does round robin give a latency bound, and what sets it?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
A waiting master is served before any other master gets a second turn. So it waits at most one turn for each of the other N - 1 masters. The bound in cycles is the sum of their longest transfers. That is why long bursts hurt everyone's worst-case latency, and why buses limit burst length.
Self-Check
Tick each key point you covered in your answer.
Half-Truth
"With N masters the worst wait is N cycles."
Only if every grant lasts one cycle. With bursts, each turn lasts as long as that master's transfer.
Source Lesson P1.9, Arbitration, fairness and atomic access (round robin bounds every requester's wait; fixed priority is fair only for the top requester)
-
What IfLimiting Burst Length for LatencyL3 Senior
Asked if they mention long bursts
What if one master sends 256-beat bursts and another needs an answer within 50 cycles?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
Round robin cannot meet that, because one turn of the long master already lasts 256 cycles. Split long bursts into shorter ones at the master or the interconnect, or give the urgent master priority with a rate limit. Splitting costs some efficiency, because each burst pays its own address overhead.
Self-Check
Tick each key point you covered in your answer.
Missed Corner
"Give the urgent master higher priority; that fixes it."
Priority helps only between transfers. If a 256-beat burst has already started and cannot be cut, the urgent master still waits.
Source Lesson P1.4 review claims (bursts and transactions)
-
Scale ItVerifying Fairness on an InterconnectL3 SeniorL4 Staff
How would you verify that an interconnect arbiter meets its fairness and latency goals?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
Turn each goal into a measurable check. For starvation, assert that every request is granted within a bound. For bandwidth, measure each master's share over a window under saturating traffic. For latency, record the worst wait per master. Then cover the hard patterns: all masters busy, one master idle then sudden, and mixed burst sizes.
Self-Check
Tick each key point you covered in your answer.
Half-Truth
"Random traffic will show any fairness problem."
Random traffic rarely saturates every master at once, which is where fairness matters. Directed saturating patterns are needed.
Source Lesson R8.4 review claims (targeted tests that try to break the design)
Wrong Altitude
A staff-level answer that only says "write an assertion".
The goal also needs bandwidth windows, latency statistics and traffic patterns, owned by someone and tracked in the plan.
What People Get Wrong
Common wrong answers and why they fail. Run It shows the wrong belief failing on a real simulator.
Misconception
"Round robin is fair, so each master gets half the bus."
Half of the grants, yes. Bandwidth follows packet length, as the twin measures: the short-packet master gets 11% of the beats.
Run It
Plain round robin, one packet per turn, with 1-beat and 8-beat packets.
round robin per packet: A beats=100 B beats=800, A share=11% FAIL: round robin is fair in grants, not in bandwidth; the long packets took most of the busSee the Fix
module tb;
logic clk = 0;
always #5 clk = ~clk;
// A's packets are 1 beat long, B's are 8; both always have one waiting. owner 0 is A, 1 is B.
int beats_a = 0, beats_b = 0, owner = 1, left = 0;
function automatic int len(int who); return who ? 8 : 1; endfunction
int deficit_a = 0, deficit_b = 0;
localparam int Q = 8; // the quantum: beats each requester earns per turn
always @(posedge clk) begin
if (left == 0) begin // packet boundary: deficit round robin
if ((owner ? deficit_b : deficit_a) < len(owner)) begin
owner = 1 - owner;
if (owner) deficit_b += Q; else deficit_a += Q;
end
if (owner) deficit_b -= len(owner); else deficit_a -= len(owner);
left = len(owner);
end
if (owner) beats_b++; else beats_a++;
left--;
end
initial begin
#9005;
$display("deficit round robin: A beats=%0d B beats=%0d, A share=%0d%%", beats_a, beats_b, 100 * beats_a / (beats_a + beats_b));
if (beats_a - beats_b <= Q && beats_b - beats_a <= Q) $display("PASS: counting beats, not grants, gave both requesters the same bandwidth within one quantum");
$finish;
end
endmodule
Prints: deficit round robin: A beats=452 B beats=448, A share=50% PASS: counting beats, not grants, gave both requesters the same bandwidth within one quantum
Delivery
Starts designing weighted arbitration before asking what the spec means by fair.
Some systems need equal latency, others equal bandwidth or a guaranteed share. The design follows that answer.
Buzzword Without Mechanism
"Fairness means no starvation."
No starvation is the minimum. A master can be served once a minute and still not starve, while missing its bandwidth target.