RTL Problems / Level 6 · Advanced RTL & Protocol Design
What You Will Learn
By solving Decoupled AXI4 Write Master Transaction Controller, 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 AXI4 write master controller handling independent, decoupled address and data channel handshakes with write response tracking.
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: AXI4 write channel architecture (AW, W, B), decoupled handshakes, transaction state machines.
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 | Clock and active-low synchronous reset |
start_write | input | 1 | Trigger 1-beat write transaction |
wr_addr[31:0], wr_data[31:0] | input | 32 | Address and payload input from core |
write_complete, write_err | output | 1 | Status pulse on B handshake; err if BRESP != 2'b00 |
AWVALID, AWREADY, AWADDR[31:0] | out/in/out | 1, 1, 32 | AXI Write Address channel |
WVALID, WREADY, WDATA[31:0], WLAST | out/in/out/out | 1, 1, 32, 1 | AXI Write Data channel |
BVALID, BREADY, BRESP[1:0] | in/out/in | 1, 1, 2 | AXI Write Response channel |
Timing Constraints & Synthesizable RTL Rules
Timing Contract: Clocked on posedge ACLK, active-low reset ARESETn. AW and W handshakes can occur in any order. B channel handshake occurs only after both AW and final W beat complete.
Synthesis Constraints: Do not assume AW and W occur in the same cycle. Fully synthesizable Verilog-2001.
Architectural Deep Dive & Implementation Walkthrough
Decoupled AXI Write Channel Architecture
Unlike simple buses where address and data are locked together in a single phase, AXI4 splits writes into three distinct channels:
- Write Address Channel (AW): Specifies write target address, burst length, and cache attributes.
- Write Data Channel (W): Carries the data payload beats and byte enables (
WSTRB), terminating withWLAST. - Write Response Channel (B): Transmits the final completion status from slave to master (
OKAY,EXOKAY,SLVERR,DECERR).
A crucial rule of AXI is that AW and W channels are fully independent. The data can arrive before, during, or after the address phase. Attempting to tie them together causes inter-channel deadlocks in complex interconnect matrices.
Common RTL Designer Pitfalls
Assuming AWREADY and WREADY arrive in the same clock cycle, or asserting BREADY before all data beats have been acknowledged.
Silicon & Hardware Engineering Notes
High-performance AXI write masters track outstanding transaction IDs (AWID) to support multi-transaction pipelining.
Starter RTL Code
module top_module (
input wire ACLK,
input wire ARESETn,
input wire start_write,
input wire [31:0] wr_addr,
input wire [31:0] wr_data,
output reg write_complete,
output reg write_err,
output reg AWVALID,
input wire AWREADY,
output reg [31:0] AWADDR,
output reg WVALID,
input wire WREADY,
output reg [31:0] WDATA,
output reg WLAST,
input wire BVALID,
output reg BREADY,
input wire [1:0] BRESP
Verified Reference Solution
🔒 Reveal Verified Reference RTL Solution
module top_module (
input wire ACLK,
input wire ARESETn,
input wire start_write,
input wire [31:0] wr_addr,
input wire [31:0] wr_data,
output reg write_complete,
output reg write_err,
output reg AWVALID,
input wire AWREADY,
output reg [31:0] AWADDR,
output reg WVALID,
input wire WREADY,
output reg [31:0] WDATA,
output reg WLAST,
input wire BVALID,
output reg BREADY,
input wire [1:0] BRESP
);
reg aw_done, w_done;
always @(posedge ACLK or negedge ARESETn) begin
if (!ARESETn) begin
write_complete <= 1'b0;
write_err <= 1'b0;
AWVALID <= 1'b0;
AWADDR <= 32'h0;
WVALID <= 1'b0;
WDATA <= 32'h0;
WLAST <= 1'b0;
BREADY <= 1'b0;
aw_done <= 1'b0;
w_done <= 1'b0;
end else begin
write_complete <= 1'b0;
write_err <= 1'b0;
if (start_write && !AWVALID && !WVALID && !aw_done && !w_done && !BREADY) begin
AWVALID <= 1'b1;
AWADDR <= wr_addr;
WVALID <= 1'b1;
WDATA <= wr_data;
WLAST <= 1'b1;
aw_done <= 1'b0;
w_done <= 1'b0;
end
// Independent AW handshake
if (AWVALID && AWREADY) begin
AWVALID <= 1'b0;
aw_done <= 1'b1;
end
// Independent W handshake
if (WVALID && WREADY) begin
WVALID <= 1'b0;
WLAST <= 1'b0;
w_done <= 1'b1;
end
// When both AW and W have completed, enable B channel
if ((aw_done || (AWVALID && AWREADY)) && (w_done || (WVALID && WREADY))) begin
BREADY <= 1'b1;
end
// B channel handshake
if (BREADY && BVALID) begin
BREADY <= 1'b0;
aw_done <= 1'b0;
w_done <= 1'b0;
write_complete <= 1'b1;
write_err <= (BRESP != 2'b00);
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 Decoupled AXI4 Write Master Transaction Controller require?
Design an AXI4 write master controller handling independent, decoupled address and data channel handshakes with write response tracking. 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 Decoupled AXI4 Write Master Transaction Controller to assess real-world synthesizability and race-condition awareness.