Part of Curriculum: Protocol RTL Design (Module 2: Skid Buffers & Register Slices)
View Full Roadmap →
Level 6 Industry Challenge ★ Advanced #45 50 pts ✓ Solved

Full-Throughput AXI4-Stream Register Slice (Skid Buffer)

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

Design a production-grade 1-stage AXI4-Stream register slice with skid buffering supporting 100% throughput and full timing isolation.

Write a synthesizable Verilog module named top_module matching the ports below exactly.
📐 Circuit Schematic Diagram
s_tvalids_tdata[31:0]m_tvalidm_tdata[31:0]>clkrst_nFULL-THROUGHPUT AXI4PROTOCOL INTERFACE
⚡ Timing & Synthesizability Constraints

Timing Contract: Sustain 100% throughput (1 transfer per clock cycle when both upstream and downstream are ready). Zero data loss or payload corruption during backpressure.

RTL Constraints: Purely registered outputs for timing isolation. Synthesizable Verilog-2001.

Objective: Implement a full-bandwidth AXI-Stream register slice (skid buffer) carrying TVALID, TREADY, TDATA[31:0], TKEEP[3:0], and TLAST. Both forward (TVALID/TDATA) and reverse (TREADY) paths must be registered to break combinational timing paths across clock domains without losing back-to-back transfer capability.

Prerequisites: AXI4-Stream protocol, skid buffer architecture, pipeline timing closure.
PortDirWidthDescription
aclk, aresetninput1Clock and active-low synchronous reset
s_tvalid, s_treadyin/out1Slave stream handshake interface
s_tdata[31:0], s_tkeep[3:0], s_tlastinput32, 4, 1Slave data, byte enables, and end-of-packet flag
m_tvalid, m_treadyout/in1Master stream handshake interface
m_tdata[31:0], m_tkeep[3:0], m_tlastoutput32, 4, 1Master data, byte enables, and end-of-packet flag
Expected Waveform (Golden Timing Contract)
💡 Need Guidance? Progressive Hints (3 Levels)
Hint 1: Conceptual Direction & Hardware Primitives
A basic register slice suffers from bubble cycles because registering s_tready creates a 1-cycle feedback delay.
Hint 2: Implementation Architecture & Approach
A skid buffer solves this by holding 2 data slots: Primary and Skid.
Hint 3: Edge Cases, Timing & Verilog Syntax
When downstream stalls (m_tready=0), the incoming beat on that exact cycle is caught in the skid register, and s_tready is lowered for the following cycle.
🔒 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        aclk,
  input  wire        aresetn,
  input  wire        s_tvalid,
  output reg         s_tready,
  input  wire [31:0] s_tdata,
  input  wire [3:0]  s_tkeep,
  input  wire        s_tlast,
  output reg         m_tvalid,
  input  wire        m_tready,
  output reg  [31:0] m_tdata,
  output reg  [3:0]  m_tkeep,
  output reg         m_tlast
);

  // Skid register storage
  reg [31:0] skid_data;
  reg [3:0]  skid_keep;
  reg        skid_last;
  reg        skid_valid;

  always @(posedge aclk or negedge aresetn) begin
    if (!aresetn) begin
      s_tready   <= 1'b1;
      m_tvalid   <= 1'b0;
      m_tdata    <= 32'h0;
      m_tkeep    <= 4'h0;
      m_tlast    <= 1'b0;
      skid_valid <= 1'b0;
      skid_data  <= 32'h0;
      skid_keep  <= 4'h0;
      skid_last  <= 1'b0;
    end else begin
      if (m_tvalid && !m_tready) begin
        // Downstream stalled: capture into skid buffer if new valid beat arrives
        if (s_tvalid && s_tready) begin
          skid_data  <= s_tdata;
          skid_keep  <= s_tkeep;
          skid_last  <= s_tlast;
          skid_valid <= 1'b1;
          s_tready   <= 1'b0; // Skid full: assert backpressure upstream
        end
      end else begin
        // Downstream ready: drain skid if present, otherwise pass from upstream
        if (skid_valid) begin
          m_tvalid   <= 1'b1;
          m_tdata    <= skid_data;
          m_tkeep    <= skid_keep;
          m_tlast    <= skid_last;
          skid_valid <= 1'b0;
          s_tready   <= 1'b1;
        end else if (s_tvalid && s_tready) begin
          m_tvalid <= 1'b1;
          m_tdata  <= s_tdata;
          m_tkeep  <= s_tkeep;
          m_tlast  <= s_tlast;
          s_tready <= 1'b1;
        end else begin
          m_tvalid <= 1'b0;
          s_tready <= 1'b1;
        end
      end
    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 Full-Throughput AXI4-Stream Register Slice (Skid Buffer), 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 a production-grade 1-stage AXI4-Stream register slice with skid buffering supporting 100% throughput and full timing isolation.

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 full-bandwidth AXI-Stream register slice (skid buffer) carrying TVALID, TREADY, TDATA[31:0], TKEEP[3:0], and TLAST. Both forward (TVALID/TDATA) and reverse (TREADY) paths must be registered to break combinational timing paths across clock domains without losing back-to-back transfer capability.

Prerequisites: AXI4-Stream protocol, skid buffer architecture, pipeline timing closure.

Port List & Interface Timing

The hidden testbench instantiates top_module. Module port names and bit-widths must match the interface contract exactly:

PortDirWidthDescription
aclk, aresetninput1Clock and active-low synchronous reset
s_tvalid, s_treadyin/out1Slave stream handshake interface
s_tdata[31:0], s_tkeep[3:0], s_tlastinput32, 4, 1Slave data, byte enables, and end-of-packet flag
m_tvalid, m_treadyout/in1Master stream handshake interface
m_tdata[31:0], m_tkeep[3:0], m_tlastoutput32, 4, 1Master data, byte enables, and end-of-packet flag

Timing Constraints & Synthesizable RTL Rules

⚡ Synthesizable Implementation Guidelines

Timing Contract: Sustain 100% throughput (1 transfer per clock cycle when both upstream and downstream are ready). Zero data loss or payload corruption during backpressure.

Synthesis Constraints: Purely registered outputs for timing isolation. Synthesizable Verilog-2001.

Architectural Deep Dive & Implementation Walkthrough

Why Chips Need Skid Buffers

In high-speed physical design (1 GHz+), long routing wires between distant IP blocks cannot meet setup time if combinational control signals (like READY backpressure) traverse multiple hierarchical boundaries.

The Register Slice Dilemma

If you register forward signals (VALID/DATA) but pass READY combinationally, the reverse timing path remains broken. If you naively register READY, the upstream transmitter cannot know the downstream stalled until 1 cycle later, dropping a packet or halving bandwidth to 50%.

The Skid Buffer introduces a secondary holding register that catches the extra in-flight beat during the 1-cycle round-trip latency of the registered s_tready signal, enabling 100% throughput and complete timing closure.

Common RTL Designer Pitfalls

⚠️ Common Mistakes to Avoid

Failing to transfer the skid buffer payload to m_tdata immediately when m_tready goes high, leading to out-of-order data or pipeline stalls.

Silicon & Hardware Engineering Notes

🛠️ ASIC vs FPGA Hardware Considerations

Standard industry AXI-Stream infrastructure IPs (such as Xilinx AXI4-Stream Register Slice or Arm CoreLink) use skid buffers at almost every major clock domain or floorplan SLR boundary.

Starter RTL Code

module top_module (
  input  wire        aclk,
  input  wire        aresetn,
  input  wire        s_tvalid,
  output reg         s_tready,
  input  wire [31:0] s_tdata,
  input  wire [3:0]  s_tkeep,
  input  wire        s_tlast,
  output reg         m_tvalid,
  input  wire        m_tready,
  output reg  [31:0] m_tdata,
  output reg  [3:0]  m_tkeep,
  output reg         m_tlast
);

  // Implement a 2-entry skid buffer (Primary and Secondary/Skid registers):
  // Breaks timing paths on both forward (VALID/DATA) and backward (READY) directions.
  // Must sustain 1 transfer per clock cycle when m_tready = 1.

Verified Reference Solution

🔒 Reveal Verified Reference RTL Solution
module top_module (
  input  wire        aclk,
  input  wire        aresetn,
  input  wire        s_tvalid,
  output reg         s_tready,
  input  wire [31:0] s_tdata,
  input  wire [3:0]  s_tkeep,
  input  wire        s_tlast,
  output reg         m_tvalid,
  input  wire        m_tready,
  output reg  [31:0] m_tdata,
  output reg  [3:0]  m_tkeep,
  output reg         m_tlast
);

  // Skid register storage
  reg [31:0] skid_data;
  reg [3:0]  skid_keep;
  reg        skid_last;
  reg        skid_valid;

  always @(posedge aclk or negedge aresetn) begin
    if (!aresetn) begin
      s_tready   <= 1'b1;
      m_tvalid   <= 1'b0;
      m_tdata    <= 32'h0;
      m_tkeep    <= 4'h0;
      m_tlast    <= 1'b0;
      skid_valid <= 1'b0;
      skid_data  <= 32'h0;
      skid_keep  <= 4'h0;
      skid_last  <= 1'b0;
    end else begin
      if (m_tvalid && !m_tready) begin
        // Downstream stalled: capture into skid buffer if new valid beat arrives
        if (s_tvalid && s_tready) begin
          skid_data  <= s_tdata;
          skid_keep  <= s_tkeep;
          skid_last  <= s_tlast;
          skid_valid <= 1'b1;
          s_tready   <= 1'b0; // Skid full: assert backpressure upstream
        end
      end else begin
        // Downstream ready: drain skid if present, otherwise pass from upstream
        if (skid_valid) begin
          m_tvalid   <= 1'b1;
          m_tdata    <= skid_data;
          m_tkeep    <= skid_keep;
          m_tlast    <= skid_last;
          skid_valid <= 1'b0;
          s_tready   <= 1'b1;
        end else if (s_tvalid && s_tready) begin
          m_tvalid <= 1'b1;
          m_tdata  <= s_tdata;
          m_tkeep  <= s_tkeep;
          m_tlast  <= s_tlast;
          s_tready <= 1'b1;
        end else begin
          m_tvalid <= 1'b0;
          s_tready <= 1'b1;
        end
      end
    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 Full-Throughput AXI4-Stream Register Slice (Skid Buffer) require?

Design a production-grade 1-stage AXI4-Stream register slice with skid buffering supporting 100% throughput and full timing isolation. Implement it as Verilog module top_module matching the listed ports.

Is this design combinational or sequential?

Tags: advanced-rtl, axi-protocol, 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 Full-Throughput AXI4-Stream Register Slice (Skid Buffer) to assess real-world synthesizability and race-condition awareness.