
AXI vs Wishbone vs APB for Custom FPGA Peripherals
Compare AXI4-Lite, Wishbone B4 and APB for a custom FPGA register block on cost, handshake, bursts and tool support, with a decision table and slave code.
Tag
17 posts

Compare AXI4-Lite, Wishbone B4 and APB for a custom FPGA register block on cost, handshake, bursts and tool support, with a decision table and slave code.

Learn how AXI4 splits transfers into five channels, how VALID and READY handshakes move each beat, and how burst length, size and type set the addresses.

Build an I2C master in Verilog that writes one byte to a 7-bit address with quarter-bit timing, open-drain lines and ACK checking, tested against a slave model.

Write an 8N1 UART transmitter and receiver in Verilog with mid-bit sampling and a loopback testbench that sends 0x55 and 0xA3 and checks the bytes.

Write a mode 0 SPI slave in Verilog that samples SCK, CS and MOSI with the FPGA clock, shifts bytes in and out and is tested with a simulated SPI master.

Run verilator --lint-only -Wall on every Verilog file, fix the common warnings, waive the rest in a .vlt file with a reason and make lint a Makefile target.

Write cocotb 1.9 tests in Python for a Verilog counter: drive a Clock, await RisingEdge and ReadOnly, assert outputs and run on Icarus Verilog from a Makefile.

Record simulation waveforms with $dumpfile and $dumpvars, choose which scopes to dump, switch dumping on and off, and read the VCD file Icarus Verilog writes.

Write a Verilog testbench with initial blocks that drives inputs, prints with $display and $monitor, checks outputs with !== and ends with PASS or FAIL.

Compile a Verilog counter with Icarus Verilog 12, run it with vvp, dump a VCD file and read the waveform in GTKWave, from one empty directory.

Build a Moore finite state machine in Verilog with a state register, next-state logic and outputs, using defaults that avoid latches in synthesis.

Learn when to use = and <= in Verilog, how the simulator schedules each, and what goes wrong when you mix them in clocked or combinational blocks.