RTL Problems / Level 3 · Arbitration & Interconnect
What You Will Learn
By solving Round-Robin Arbiter — Request Arbitration, you will acquire core industry skills:
- Synthesizable hardware modeling in standard Verilog-2001 / SystemVerilog.
- Correct handling of interface port contracts, edge-triggered clocks, and active-low/high resets.
- Simulation waveform interpretation and debugging using timing diagrams (VCD traces).
- Architectural avoidance of timing violations, glitching hazards, and synthesis warnings.
Problem Statement & Requirements
Implement a 4-client round-robin arbiter. When multiple clients assert req[3:0], grant rotates fairly to prevent client starvation.
Hardware design teams at leading semiconductor firms evaluate these exact port contracts, race-condition assertions, and corner cases during technical design reviews and ASIC engineer interviews.
Prerequisites: Fixed priority arbiters, one-hot priority masking.
Port List & Interface Timing
The hidden testbench instantiates top_module. Module port names and bit-widths must match the interface contract exactly:
| Name | Dir | Width | Description |
|---|---|---|---|
clk | input | 1 | Master clock |
areset_n | input | 1 | Active-low asynchronous reset |
req | input | 4 | 4-bit request vector from clients |
grant | output | 4 | 4-bit one-hot grant vector |
Timing Constraints & Synthesizable RTL Rules
Timing Contract: Grant updates on `posedge clk`. Exactly one active grant output `grant[3:0]` is asserted when at least one request is active.
Synthesis Constraints: Priority rotates circularly to the client immediately following the client that was just granted.
Architectural Deep Dive & Implementation Walkthrough
Common RTL Designer Pitfalls
['Granting multiple clients simultaneously when requests overlap.', 'Advancing priority when no client is requesting, breaking fair cycle order.']
Silicon & Hardware Engineering Notes
In wide arbiters (8 to 64 ports), round-robin logic is synthesized using dual priority-encoder chains ($req \& \sim mask$ and $req$) to eliminate $O(N)$ sequential case branches.
Starter RTL Code
module top_module(
input clk,
input areset_n,
input [3:0] req,
output reg [3:0] grant
);
// 4-client round-robin arbiter
endmodule
Verified Reference Solution
🔒 Reveal Verified Reference RTL Solution
module top_module(
input clk,
input areset_n,
input [3:0] req,
output reg [3:0] grant
);
reg [1:0] last_grant;
function [3:0] get_grant;
input [1:0] last;
input [3:0] r;
reg [3:0] g;
begin
g = 4'b0000;
case (last)
2'd0: begin
if (r[1]) g = 4'b0010;
else if (r[2]) g = 4'b0100;
else if (r[3]) g = 4'b1000;
else if (r[0]) g = 4'b0001;
end
2'd1: begin
if (r[2]) g = 4'b0100;
else if (r[3]) g = 4'b1000;
else if (r[0]) g = 4'b0001;
else if (r[1]) g = 4'b0010;
end
2'd2: begin
if (r[3]) g = 4'b1000;
else if (r[0]) g = 4'b0001;
else if (r[1]) g = 4'b0010;
else if (r[2]) g = 4'b0100;
end
default: begin // 2'd3
if (r[0]) g = 4'b0001;
else if (r[1]) g = 4'b0010;
else if (r[2]) g = 4'b0100;
else if (r[3]) g = 4'b1000;
end
endcase
get_grant = g;
end
endfunction
always @(posedge clk or negedge areset_n) begin
if (!areset_n) begin
grant <= 4'b0000;
last_grant <= 2'd3;
end else begin
grant <= get_grant(last_grant, req);
if (get_grant(last_grant, req) != 4'b0000) begin
case (get_grant(last_grant, req))
4'b0001: last_grant <= 2'd0;
4'b0010: last_grant <= 2'd1;
4'b0100: last_grant <= 2'd2;
4'b1000: last_grant <= 2'd3;
endcase
end
end
end
endmodule
Related RTL Problems in Level 3
- Synchronous RAM — Memory Read/Write — Design a 16-word by 8-bit synchronous RAM (16x8) with synchronous write and synchronous read.
- Single-Port RAM with Write Enable — Memory Control — Implement a 32-word x 8-bit single-port synchronous RAM with read-first (read-during-write) behavior.
- Synchronous FIFO — FIFO Architecture — Design an 8-entry by 8-bit synchronous First-In First-Out (FIFO) buffer with write enable (wr_en), read enable (rd_en), full, and empty flags.
Connected EcrioniX Learning Resources
Accelerate your VLSI engineering knowledge with these curated learning materials:
Progress through step-by-step verified modules from fundamentals to advanced silicon design.
Benchmark your hardware knowledge across 10 semiconductor domains and receive study roadmaps.
Explore foundational circuit theory, waveform timing, and physical hardware implementation.
Frequently Asked Questions
What does Round-Robin Arbiter — Request Arbitration require?
Implement a 4-client round-robin arbiter. When multiple clients assert req[3:0], grant rotates fairly to prevent client starvation. Implement it as Verilog module top_module matching the listed ports.
Is this design combinational or sequential?
Tags: memory, fifo, protocols, apb, uart, hard, fair-arbitration. If a clock signal is present in the port table, implement it as sequential logic; otherwise, use continuous assignments or combinational blocks.
How is my solution graded?
A hidden SystemVerilog testbench simulates your module in the cloud judge. You pass when all directed corner cases match the golden model and the VCD timing waveform matches the contract.
How does this challenge help with semiconductor interviews?
Technical interviewers at NVIDIA, Qualcomm, Apple, and Intel routinely ask candidates to code, debug, and explain the timing waveforms of Round-Robin Arbiter — Request Arbitration to assess real-world synthesizability and race-condition awareness.