Part of Curriculum: Advanced SoC and Chiplet RTL (Module 7: Elastic Streaming Protocol Bridge)
View Full Roadmap →
Level 6 Industry Challenge ★ Advanced #51 50 pts ✓ Solved

Chiplet Flit-to-Stream Elastic Protocol Bridge

Advanced RTL & Protocol Design · advanced-rtl, protocol-bridges, systemverilog, asic, fpga

Design an elastic streaming protocol bridge with 4-entry FIFO buffering, cut-through routing, and lossless backpressure.

Write a synthesizable Verilog module named top_module matching the ports below exactly.
📐 Circuit Schematic Diagram
s_valids_data[63:0]m_validm_data[63:0]buffer_occupancy[2:0]>clkrst_nCHIPLET FLIT-TO-STREDIGITAL HARDWARE BLOCK
⚡ Timing & Synthesizability Constraints

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.

RTL Constraints: Strict FIFO ordering. Zero flit drop or corruption under backpressure.

Objective: Implement a protocol bridge interfacing a 64-bit ingress stream to a 64-bit egress stream. Incorporate a 4-deep elastic FIFO buffer. Forward flits with zero dropped beats, assert upstream ready only when buffer space is available, and cleanly transfer packet framing signals.

Prerequisites: Elastic buffers, streaming FIFO architecture, valid-ready handshaking, cut-through forwarding.
PortDirWidthDescription
clk, rst_ninput1Clock and active-low synchronous reset
s_valid, s_readyin/out1Ingress stream handshake
s_data[63:0], s_lastinput64, 1Ingress 64-bit payload and end-of-packet flag
m_valid, m_readyout/in1Egress stream handshake
m_data[63:0], m_lastoutput64, 1Egress 64-bit payload and end-of-packet flag
buffer_occupancy[2:0]output3Number of valid flits currently held in bridge FIFO
Expected Waveform (Golden Timing Contract)
💡 Need Guidance? Progressive Hints (3 Levels)
Hint 1: Conceptual Direction & Hardware Primitives
Use an array of registers reg [64:0] mem [0:3] packing data and last.
Hint 2: Implementation Architecture & Approach
Track circular write and read pointers: wr_ptr and rd_ptr.
Hint 3: Edge Cases, Timing & Verilog Syntax
Calculate buffer_occupancy: increment on push, decrement on pop, hold on both.
🔒 Reveal Verified Reference RTL Solution (Click to expand)
⚠️ Self-Discovery Warning: Try solving and simulating first! Viewing the verified reference implementation will bypass the real debugging experience.
Verified Synthesizable RTL
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
Verilog-2001 / SV Saved
Font: |
// Click Run Tests (or press Ctrl+Enter) to compile your RTL and simulate against hidden testbenches.
Simulation Timing Diagram (VCD Waveform)
100%
No simulation waveform yet. Run tests to simulate and generate VCD traces.
No compilation run yet. Syntax warnings and elaboration messages will appear here.
No simulation output yet. Raw stdout from vvp will appear here.

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.

Objective: Implement a protocol bridge interfacing a 64-bit ingress stream to a 64-bit egress stream. Incorporate a 4-deep elastic FIFO buffer. Forward flits with zero dropped beats, assert upstream ready only when buffer space is available, and cleanly transfer packet framing signals.

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:

PortDirWidthDescription
clk, rst_ninput1Clock and active-low synchronous reset
s_valid, s_readyin/out1Ingress stream handshake
s_data[63:0], s_lastinput64, 1Ingress 64-bit payload and end-of-packet flag
m_valid, m_readyout/in1Egress stream handshake
m_data[63:0], m_lastoutput64, 1Egress 64-bit payload and end-of-packet flag
buffer_occupancy[2:0]output3Number of valid flits currently held in bridge FIFO

Timing Constraints & Synthesizable RTL Rules

⚡ Synthesizable Implementation Guidelines

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

⚠️ Common Mistakes to Avoid

Failing to allow simultaneous push and pop when buffer_occupancy is 4, which artificially reduces throughput.

Silicon & Hardware Engineering Notes

🛠️ ASIC vs FPGA Hardware Considerations

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.

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.