easy 10 pts Solved

AXI4-Lite Read Channel FSM

The read-side twin of this catalog's AXI4-Lite write FSM: accept an address, then hold the data response until the master accepts it.

Verilog problems / Protocols & Interfaces

What you must build

The read-side twin of this catalog's AXI4-Lite write FSM: accept an address, then hold the data response until the master accepts it.

Engineers use “AXI4-Lite Read Channel FSM” as a building block in protocols & interfaces. Interviewers ask for the same ports and the same corner cases this judge covers. Completing it in the browser is the same skill as writing synthesizable RTL at work, minus the EDA license.

Concept: Just like the write address channel, arready must pulse for exactly one cycle to accept the read address, then drop to 0 while rvalid holds the response — the same "forgot to deassert the ready signal when entering the response phase" bug that plagues the write channel shows up here too, letting the master think it can issue a second read address before the first read's data has even been returned.

Port contract

The judge instantiates exactly these ports. Extra ports or a different module name fail to elaborate.

NameDirWidthDescription
clkinput1Clock
rstinput1Sync active-high reset
arvalidinput1Read address valid
arreadyoutput1Read address ready
rvalidoutput1Read data valid
rreadyinput1Master ready to accept data
rdataoutput8Read data

How to approach this kata

This is a medium kata: you will need sequential logic or a small FSM. Decide what is registered versus combinational before you type. Reset polarity and clock edge must match the spec; the judge will fail you on the first mismatched cycle.

Hidden tests instantiate top_module, drive the ports, and compare every sample against a golden model. They do not grade coding style. They do grade X/Z, off-by-one counters, and ignoring enables. Sign in only when you want the run saved on the leaderboard — the specification below is public.

Starter shape

Copy this skeleton into the editor (or press Reset starter). Fill the body; do not rename the module.

module top_module(
  input  clk,
  input  rst,
  input  arvalid,
  output reg arready,
  output reg rvalid,
  input  rready,
  output reg [7:0] rdata
);

  // Your code here — IDLE: accept arvalid for 1 cycle (arready=1), latch rdata, move to RESP.
  // RESP: deassert arready, assert rvalid until rready, then back to IDLE.

Why this shows up in interviews

AXI4-Lite Read Channel FSM sits under Protocols & Interfaces (sequential, protocol, amba, fsm). Concept: Just like the write address channel, arready must pulse for exactly one cycle to accept the read address, then drop to 0 while rvalid holds the response — the same "forgot to deassert the ready signal when entering the response phase" bug that plagues the write channel shows up here too, letting the master think it can issue a second read address before the first read's data has even been returned.

A passing solution is synthesizable intent: no delays in the DUT, no initial blocks inside top_module, and no reference to testbench tasks. Use blocking assignments only in combinational always blocks; use non-blocking for registers clocked by clk.

Related problems

  • CRC-8 Generator (poly 0x07) — Compute an 8-bit CRC over a byte using the classic 0x07 polynomial (CRC-8-CCITT) — the same bit-serial algorithm behind this catalog's CRC-4, scaled up to a full byte.
  • SPI Mode Selector (CPOL/CPHA) — Decode SPI's 4 clocking modes from CPOL and CPHA into the two facts a controller actually needs: what the clock idles at, and which edge samples data.
  • APB Slave Register Interface — A minimal AMBA APB slave: 4 registers, zero wait states — and the two-phase setup/access handshake that decides exactly when a write is allowed to land.
  • AXI4-Lite Write Channel FSM — Accept an address+data write beat, then hold the response channel until the master acknowledges — the handshake FSM behind every AXI4-Lite peripheral.

FAQ

What does this problem require?

What does the AXI4-Lite Read Channel FSM problem ask for? The read-side twin of this catalog's AXI4-Lite write FSM: accept an address, then hold the data response until the master accepts it. Implement it as Verilog module top_module with the listed ports.

Combinational or sequential?

Is AXI4-Lite Read Channel FSM combinational or sequential? Tags: sequential, protocol, amba, fsm. Follow the clock/reset ports if they appear in the table; if there is no clock, use continuous assignment or combinational always @(*).

How does the auto-grader work?

How is AXI4-Lite Read Channel FSM graded? A hidden SystemVerilog/Verilog testbench in the EcrioniX judge simulates your module in the browser. You pass when every directed vector matches, including the waveform contract shown on this page.

Write a module named top_module matching the ports below exactly.
Expected waveform
Your solution
Judge output
// Output appears after you run tests.