Bus Interfaces
AXI-Lite Read-Only Slave 4 Regs
AXI4-Lite slave with 4 read-only registers and ignored write channels.
About this block
Simulate it in the Verilog IDE
AXI-Lite Read-Only Slave 4 Regs is a Verilog reference block in the Bus Interfaces catalog. AXI, APB, Wishbone, and other on-chip bus interface adapters. Marked Hard: a larger reference. Simulate the packaged testbench before you change the RTL.
This IP core implements a simple, AXI4-Lite compliant slave interface that supports read-only access to four 32-bit registers. It is designed for scenarios where a master needs to read configuration or status registers that should not be modified by the master. All write transactions are accepted but ignored, ensuring no deadlocks occur on the write channels.
### Key Features
- AXI4-Lite Compliant: Fully compatible with standard AXI4-Lite masters.
- Read-Only: Write transactions are accepted but ignored (data is discarded).
- 4 Registers: Supports four 32-bit registers mapped to a base address.
- No Deadlocks: Write channels (
AW,W,B) are handled with constantREADYassertions to prevent master stalls. - Registered Outputs:
RDATA,RVALID, andRRESPare registered for improved timing closure. - Simple Address Decoding: Combinatorial logic decodes addresses with a 4-byte stride.
- Choose Open in IDE. RTL Studio loads the packaged workspace for AXI-Lite Read-Only Slave 4 Regs.
- Read the Verilog module in the editor. The catalog line for this block: AXI4-Lite slave with 4 read-only registers and ignored write channels.
- Run the packaged testbench with the in-browser Verilator simulator, then open the VCD in the waveform viewer.
- Run Yosys in the same IDE for a generic netlist. Sky130 liberty mapping is a separate Pro library option.
RTL Studio is the Verilog simulator and IDE around this block: Slang lint, Verilator, VCD waveforms, and Yosys, in the browser. Simulation guide · Yosys guide.
Ports
| Port Name | Direction | Width | Description |
|---|---|---|---|
ACLK | Input | 1 | Clock input |
ARESETN | Input | 1 | Active-low reset |
AWPROT | Input | 4 | Write protection bits |
AWADDR | Input | 32 | Write address |
AWVALID | Input | 1 | Write address valid |
AWREADY | Output | 1 | Write address ready |
ARPROT | Input | 4 | Read protection bits |
ARADDR | Input | 32 | Read address |
ARVALID | Input | 1 | Read address valid |
ARREADY | Output | 1 | Read address ready |
RDATA | Output | 32 | Read data |
RRESP | Output | 2 | Read response |
Architecture
The module consists of an address decoder and registered output logic.
- Address Decoding: The upper bits of
ARADDR(excluding the last 2 bits for byte alignment) are decoded to select one of the four internal registers. - Read Response: Upon receiving a valid
ARtransaction, the slave immediately assertsARREADY. The corresponding register value is placed onRDATA, andRVALIDis asserted in the next clock cycle. - Write Handling: All write channels (
AW,W,B) are handled with constantREADYassertions.BVALIDis asserted immediately withBRESPset toOKAY. The write data is discarded.
Verification
The testbench (tb_axi_lite_read_only_slave_4.v) performs five test cases:
| Test Case | Description | Expected Result |
|---|---|---|
| TC1 | Read Register 0 | RDATA == 0xDEADBEEF |
| TC2 | Read Register 1 | RDATA == 0xCAFEBABE |
| TC3 | Read Register 2 | RDATA == 0x12345678 |
| TC4 | Read Register 3 | RDATA == 0x87654321 |
| TC5 | Write Ignored | AWREADY, WREADY, BVALID asserted; BRESP == OKAY |
More in Bus Interfaces
- 2-Bit Read/Write Command Decode
- 4-Slot Address Chip-Select Decoder
- 8-Bit Address Range Hit
- 8-Bit Hold-on-Stall Register
- 8-Bit Valid/Ready Register Slice
- 8-Bit Write Merge with Byte Mask
- AHB-Lite Simple Master
- AHB-Lite Single-Beat Master
- AHB-Lite Slave Interface
- APB3 Master (Single-Transaction Pipeline)
- APB3 Master with Burst Support and Backpressure Handling
- APB3 Slave Register Interface
- AXI-Lite 4-Register Bank
- AXI-Lite Write-Only Slave 4 Regs
- AXI-Stream 1-to-2 Demux
- AXI-Stream Broadcast 1-to-2