RTL Problems / Level 6 · Advanced RTL & Protocol Design
What You Will Learn
By solving Chiplet Flit-to-Stream Elastic Protocol Bridge, 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
Design an elastic streaming protocol bridge with 4-entry FIFO buffering, cut-through routing, and lossless backpressure.
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: Elastic buffers, streaming FIFO architecture, valid-ready handshaking, cut-through forwarding.
Port List & Interface Timing
The hidden testbench instantiates top_module. Module port names and bit-widths must match the interface contract exactly:
| Port | Dir | Width | Description |
|---|---|---|---|
clk, rst_n | input | 1 | Clock and active-low synchronous reset |
s_valid, s_ready | in/out | 1 | Ingress stream handshake |
s_data[63:0], s_last | input | 64, 1 | Ingress 64-bit payload and end-of-packet flag |
m_valid, m_ready | out/in | 1 | Egress stream handshake |
m_data[63:0], m_last | output | 64, 1 | Egress 64-bit payload and end-of-packet flag |
buffer_occupancy[2:0] | output | 3 | Number of valid flits currently held in bridge FIFO |
Timing Constraints & Synthesizable RTL Rules
Timing Contract: Clocked on posedge clk, active-low rst_n. Ingress data beat consumed on posedge clk when s_valid && s_ready. Egress beat consumed when m_valid && m_ready.
Synthesis Constraints: Strict FIFO ordering. Zero flit drop or corruption under backpressure.
Architectural Deep Dive & Implementation Walkthrough
Elastic Buffering in Multi-Die Systems
In multi-chiplet packaging, on-die protocols (AXI-Stream, AMBA CHI) operate at different bus widths and clock rates than off-die D2D physical layers. Streaming Protocol Bridges isolate these interfaces using elastic FIFO buffers.
Key Operational Guarantees
- Cut-Through Latency: Data is available for reading as soon as it is buffered.
- Backpressure Absorption: If downstream temporarily deasserts
m_ready, the bridge absorbs up to 4 flits before raising backpressure upstream (s_ready = 0). - Framing Preservation: The end-of-packet boundary (
TLAST/ flit trailer) remains aligned with the payload.
Common RTL Designer Pitfalls
Failing to allow simultaneous push and pop when buffer_occupancy is 4, which artificially reduces throughput.
Silicon & Hardware Engineering Notes
Silicon-proven protocol bridges use dual-port register arrays with clock gating for power conservation when empty.
Starter RTL Code
module top_module (
input wire clk,
input wire rst_n,
input wire s_valid,
output wire s_ready,
input wire [63:0] s_data,
input wire s_last,
output wire m_valid,
input wire m_ready,
output wire [63:0] m_data,
output wire m_last,
output reg [2:0] buffer_occupancy
);
// Implement a 4-deep elastic streaming bridge:
// 1. Buffer storage for 4 x (64-bit data + 1-bit last).
// 2. s_ready = (buffer_occupancy < 3'd4).
// 3. m_valid = (buffer_occupancy > 3'd0).
Verified Reference Solution
🔒 Reveal Verified Reference RTL Solution
module top_module (
input wire clk,
input wire rst_n,
input wire s_valid,
output wire s_ready,
input wire [63:0] s_data,
input wire s_last,
output wire m_valid,
input wire m_ready,
output wire [63:0] m_data,
output wire m_last,
output reg [2:0] buffer_occupancy
);
reg [64:0] mem [0:3];
reg [1:0] wr_ptr, rd_ptr;
assign s_ready = (buffer_occupancy < 3'd4);
assign m_valid = (buffer_occupancy > 3'd0);
wire [64:0] rd_entry = mem[rd_ptr];
assign m_data = rd_entry[63:0];
assign m_last = rd_entry[64];
wire push = s_valid && s_ready;
wire pop = m_valid && m_ready;
always @(posedge clk or negedge rst_n) begin
if (!rst_n) begin
wr_ptr <= 2'd0;
rd_ptr <= 2'd0;
buffer_occupancy <= 3'd0;
end else begin
if (push) begin
mem[wr_ptr] <= {s_last, s_data};
wr_ptr <= wr_ptr + 2'd1;
end
if (pop) begin
rd_ptr <= rd_ptr + 2'd1;
end
case ({push, pop})
2'b10: buffer_occupancy <= buffer_occupancy + 3'd1;
2'b01: buffer_occupancy <= buffer_occupancy - 3'd1;
default: ; // 2'b00 or 2'b11 -> unchanged
endcase
end
end
endmodule
Related RTL Problems in Level 6
- Manchester Encoder — Combine a data bit with the clock to produce a Manchester-encoded line signal — the self-clocking encoding used in classic Ethernet and RFID.
- Manchester Decoder — Recover the original data bit from a Manchester-encoded line signal — the exact inverse of the Manchester Encoder problem.
- Quadrature Rotary Encoder Decoder — Decode the two-phase A/B signal from a real rotary knob or mouse wheel into a direction and position count — sample B on every rising edge of A.
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 Chiplet Flit-to-Stream Elastic Protocol Bridge require?
Design an elastic streaming protocol bridge with 4-entry FIFO buffering, cut-through routing, and lossless backpressure. Implement it as Verilog module top_module matching the listed ports.
Is this design combinational or sequential?
Tags: advanced-rtl, protocol-bridges, systemverilog, asic, fpga. 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 Chiplet Flit-to-Stream Elastic Protocol Bridge to assess real-world synthesizability and race-condition awareness.