Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

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

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Course
  • Reading Paths
  • Concept Map
  • How to Read the Diagrams
  • Part 0: What Is a Protocol?10
  • Part 1: Timing and Clocking11
  • Part 2: Encoding and Framing12
  • Part 3: Handshakes13
  • Part 4: Flow Control17
  • Part 5: Transactions19
  • Part 6: Concurrency and Performance17
  • Part 7: Ordering13
  • Part 8: Sharing and Arbitration12
    • Shared Media and Topologies
    • Arbitration Policies
    • Fairness and Starvation
    • Priority Inversion
    • Arbitration Granularity
    • Distributed Arbitration
    • Quality of Service
    • Virtual Channels
    • Routing
    • Multicast and Broadcast
    • Protocols Compared: Sharing and Arbitration
    • Drills: Sharing and Arbitration
  • Part 9: Deadlock and Liveness13
  • Part 10: Reliability and Recovery20
  • Part 11: Bring-Up and Link Management10
  • Part 12: Power8
  • Part 13: Shared State and Coherence9
  • Part 14: Security and Isolation7
  • Part 15: Specifying and Verifying11
  • Part 16: Protocols Dissected17
  • Part 17: Capstones5
  • Part 18: Interview Preparation6
Loading lesson

‹Part 8: Sharing and Arbitration
  1. Topics
  2. First Principles of Hardware Protocols
  3. Part 8: Sharing and Arbitration
  4. Arbitration Granularity

Part 8 · Sharing and Arbitration · Working (W)

Arbitration Granularity

How often an arbiter may change its decision: every beat, every burst or every locked sequence. Coarser grants are simpler and more efficient; finer grants cut waiting. The trade-off, with numbers and a simulation.

On this page

    Note

    Level: Working (W) · Answers: Who gets the wire?

    Before this: Arbitration Policies, Bursts

    A round-robin arbiter shares a link between a DMA engine and a processor. The arbiter is perfectly fair: it alternates between them. Yet the processor's single-word reads still wait more than 60 cycles at times. The arbiter alternates between bursts, and the DMA engine's bursts are 64 beats long. Fairness in grants is not fairness in cycles.

    How often should an arbiter be allowed to switch, and what does each choice cost?

    The obvious answer, and why it breaks

    The obvious arbiter grants a whole transaction: once a requester wins, it keeps the resource until its burst is done. That keeps a burst's beats together, so the target and the protocol stay simple. But every other requester now waits for the longest burst anyone might send, however fair the arbiter is. The unit of arbitration sets the minimum wait.

    The idea: granularity

    Granularity

    The arbiter may switch

    Wait for others

    Cost

    Per locked sequence

    Only when a lock is released

    Whole sequence of transactions

    Worst latency; risk of priority inversion (lesson 8.4)

    Per burst (per transaction)

    Between transactions

    Up to the longest burst

    Simple: beats of one burst stay together

    Per beat (per flit)

    Every beat

    About one beat per competitor

    Every beat must carry its owner (an ID), receivers must reassemble (lesson 6.7)

    Finer granularity only helps if the protocol allows it: switching mid-burst means interleaving, which the receiver must support. That is why read data can often be arbitrated per beat (receivers track IDs) while write data in AXI4 cannot (lesson 6.7).

    Build it: per burst against per beat

    Requester A sends 8-beat bursts back to back; requester B asks once, for a single beat. Two arbiters run side by side: one switches only between A's bursts, the other may switch every beat.

    tb.sv
    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
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    // Arbitration granularity. Requester A sends 8-beat bursts back to back; requester
    // B needs single beats now and then. Two arbiters run side by side:
    //   per burst: once A starts a burst it keeps the link until the burst ends
    //   per beat:  the arbiter may switch every beat (round-robin between A and B)
    // The checker records how long B waits for its first beat under each policy.
    module tb;
      logic clk = 0;
      always #5 clk = ~clk;
      initial begin $dumpfile("wave.vcd"); $dumpvars(0, tb); end
    
      int cyc = 0;
      always @(posedge clk) cyc <= cyc + 1;
      wire a_req = (cyc >= 1);                    // from cycle 1, A always has a burst ready
      wire b_req = (cyc == 3);                    // B asks in cycle 3 for one beat
    
      // Per-burst arbiter: A's burst runs 8 beats; between bursts B wins if it is waiting
      logic       b_pend_x = 0, gnt_b_x;
      logic [2:0] beat_x = 0;
      logic       in_burst_x = 0;
      assign gnt_b_x = !in_burst_x && b_pend_x;
      wire        gnt_a_x = a_req && !gnt_b_x;
      always @(posedge clk) begin
        if (b_req) b_pend_x <= 1; else if (gnt_b_x) b_pend_x <= 0;
        if (gnt_a_x) begin beat_x <= beat_x + 1; in_burst_x <= (beat_x != 7); end
      end
    
      // Per-beat arbiter: alternates whenever both want the link
      logic b_pend_y = 0, last_b_y = 0;
      wire  gnt_b_y = b_pend_y && !last_b_y;
      wire  gnt_a_y = a_req && !gnt_b_y;
      always @(posedge clk) begin
        if (b_req) b_pend_y <= 1; else if (gnt_b_y) b_pend_y <= 0;
        last_b_y <= gnt_b_y;
      end
    
      int asked = 3, got_x = -1, got_y = -1;
      always @(posedge clk) begin
        if (gnt_b_x && got_x < 0) got_x = cyc;
        if (gnt_b_y && got_y < 0) got_y = cyc;
      end
      initial begin
        #200;
        if (got_y == 4 && got_x == 9) $display("PASS: B waits %0d cycle with per-beat arbitration, %0d cycles with per-burst", got_y - asked, got_x - asked);
        else $display("FAIL: got_y %0d got_x %0d", got_y, got_x);
        $finish;
      end
    endmodule

    The per-burst arbiter's only extra state is in_burst_x: while A is inside a burst, B cannot win.

    Watch it run

    How to read it, slot by slot:

    • Slots 0 to 7, per burst: A holds the link for its 8-beat burst (gnt_a_x).

    • Slot 2: B asks (b_req).

    • Slot 3, per beat: the per-beat arbiter grants B at once (gnt_b_y), then returns to A: B waited one cycle.

    • Slot 8, per burst: only when A's burst has ended does the per-burst arbiter grant B (gnt_b_x): B waited six cycles, and would wait up to a full burst in the worst case.

    Worked numbers

    Illustrative: a processor's single-beat read competes with a DMA engine's bursts on a link that moves one beat per cycle.

    Diagram
    DMA burst length:                  16 beats       64 beats
    Per-burst arbitration, worst wait:  16 cycles      64 cycles
    Per-beat arbitration, worst wait:    1 cycle        1 cycle
    DMA throughput loss per processor read: 1 beat either way

    The throughput cost to the DMA engine is the same (one beat per processor read); only the processor's wait changes. That is why a common compromise is per-burst arbitration with a cap on burst length for shared links: it keeps bursts together and bounds the wait.

    How real protocols chose

    Protocol

    Granularity

    AXI

    Per transaction on address channels; read data may be interleaved per beat between IDs; write data per transaction (no interleaving in AXI4).

    PCI Express

    Per packet: a packet is never split, so the maximum payload size bounds how long one packet holds a link.

    Network-on-chip routers

    Per packet with wormhole switching (a packet holds a channel until its tail passes), or per flit across virtual channels (lesson 8.8).

    What breaks

    The opening system (illustrative): the DMA engine's 64-beat bursts made the processor's worst-case read wait exceed its budget, although the arbiter was round-robin. The fix was to cap DMA bursts at 16 beats on that link, which cut the worst wait by four and cost the DMA engine nothing measurable.

    Why this matters

    Senior lens. A fairness bound counted in grants means nothing until it is multiplied by how long a grant can hold the resource. For each shared link, state the granularity, the maximum hold (burst length, packet size, lock length), and the resulting worst wait for latency-sensitive requesters. Cap burst and packet sizes where that wait matters.

    Interview

    Asked: "Should the arbiter switch mid-burst?"

    Weak answer: No, bursts must stay together.

    Strong answer: It's a trade. Switching per beat cuts other requesters' wait to about one beat, but only works if the protocol lets beats interleave, so each beat carries an ID and the receiver reassembles. Switching per burst keeps beats together and the receiver simple, but others wait up to the longest burst. A common compromise is per-burst arbitration with a capped burst length on shared links, which bounds the wait without interleaving.

    Follow-ups: (1) Why can AXI interleave read data but not write data? (2) What sets the worst wait under per-burst arbitration?

    Check yourself Round-robin among 3 requesters, per-burst, each burst up to 32 beats. What is the worst wait for one requester, in cycles?

    Two other requesters' bursts: up to 64 cycles.

    Check yourself In the waveform, why does per-beat arbitration grant B so quickly?

    It may switch on any beat, so as soon as B asks, the next beat can be B's.

    Key takeaways

    • Arbitration granularity (per beat, per burst, per lock) sets the minimum wait for competitors.

    • Finer granularity needs interleaving support; coarser granularity needs bounded burst or packet sizes.

    • Worst wait = grants to others × longest hold; cap holds on shared links.

    Keep going

    Next: Lesson 8.6, Distributed Arbitration. Arbitration without an arbiter: settling contention on the wire itself.

    Related topics

    • Part 8 overview: Sharing and Arbitration

    Previous

    121 / 234

    Next: Distributed Arbitration

    Up next

    Up nextDistributed Arbitration

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Shared Media and Topologies
    • Arbitration Policies
    • Fairness and Starvation
    clkb_reqgnt_a_xgnt_b_xgnt_a_ygnt_b_y
    Simulation output: B asks for one beat in slot 2. Per beat, it is granted in slot 3; per burst, it waits until A's 8-beat burst ends, in slot 8.