RTL Problems / Level 6 · Advanced RTL & Protocol Design
What You Will Learn
By solving AXI4 Handshake Engine with Protocol Hold Rules & Backpressure, 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 an AXI valid-ready handshake engine enforcing the AMBA AXI handshake stability rules under severe downstream 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: AMBA AXI4 valid/ready handshake principles, pipelining, combinational loops avoidance.
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 |
|---|---|---|---|
ACLK, ARESETn | input | 1 | Global clock and active-low synchronous reset |
s_valid, s_data[31:0] | input | 1, 32 | Upstream producer handshake and data |
s_ready | output | 1 | Upstream ready indicating buffer readiness |
m_valid, m_data[31:0] | output | 1, 32 | Downstream consumer handshake and data |
m_ready | input | 1 | Downstream consumer ready backpressure signal |
stall_detected | output | 1 | Status flag asserted during backpressure stalls |
Timing Constraints & Synthesizable RTL Rules
Timing Contract: Clocked on posedge ACLK, active-low reset ARESETn. When s_valid is asserted, s_data must not change until s_valid && s_ready occurs.
Synthesis Constraints: No combinational path from m_ready to s_valid. Synthesizable Verilog-2001.
Architectural Deep Dive & Implementation Walkthrough
The AMBA AXI Valid-Ready Handshake Contract
In all 5 AXI channels (AR, R, AW, W, B) as well as AXI4-Stream, data movement is governed by the two-way VALID / READY handshake contract:
- The Transfer Point: Data is consumed strictly when
VALID = 1andREADY = 1at a positive clock edge. - The Stability Requirement: Once a master asserts
VALID, it must maintainVALID = 1and keep the payload unchanged untilREADY = 1is observed. - Deadlock Prevention: The specification forbids
VALIDfrom waiting forREADYcombinationally. A master cannot check if a slave is ready before deciding whether to assertVALID.
Common RTL Designer Pitfalls
Allowing payload signals to mutate while VALID is high and READY is low, or creating a combinational loop from READY to VALID.
Silicon & Hardware Engineering Notes
Cascading simple valid-ready stages introduces a half-bandwidth bubble (1 beat every 2 cycles). Eliminating this requires a skid buffer (Problem 45).
Starter RTL Code
module top_module (
input wire ACLK,
input wire ARESETn,
input wire s_valid,
output wire s_ready,
input wire [31:0] s_data,
output reg m_valid,
input wire m_ready,
output reg [31:0] m_data,
output wire stall_detected
);
// Implement an elastic valid-ready buffer stage:
// 1. Data beat transfers when (VALID && READY) on posedge ACLK.
// 2. Once m_valid is asserted, m_data and m_valid MUST remain stable until m_ready = 1.
// 3. stall_detected = m_valid && !m_ready.
endmodule
Verified Reference Solution
🔒 Reveal Verified Reference RTL Solution
module top_module (
input wire ACLK,
input wire ARESETn,
input wire s_valid,
output wire s_ready,
input wire [31:0] s_data,
output reg m_valid,
input wire m_ready,
output reg [31:0] m_data,
output wire stall_detected
);
assign stall_detected = m_valid && !m_ready;
assign s_ready = !m_valid || m_ready;
always @(posedge ACLK or negedge ARESETn) begin
if (!ARESETn) begin
m_valid <= 1'b0;
m_data <= 32'h0;
end else begin
if (s_ready) begin
m_valid <= s_valid;
if (s_valid) begin
m_data <= s_data;
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.
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 AXI4 Handshake Engine with Protocol Hold Rules & Backpressure require?
Implement an AXI valid-ready handshake engine enforcing the AMBA AXI handshake stability rules under severe downstream backpressure. 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 AXI4 Handshake Engine with Protocol Hold Rules & Backpressure to assess real-world synthesizability and race-condition awareness.