Self-checking testbench for an APB register block
Write a small APB slave with four registers, then a SystemVerilog testbench with tasks for read and write that checks every register automatically.
What this proves to recruiters
- You know a real on-chip bus protocol.
- You write reusable testbench tasks.
- You check results automatically.
Skills you will use
- SystemVerilog
- APB protocol
- Testbench tasks
- Self-checking
What you need
Nothing to buy: this project only needs a computer and the free software below.
Free software
- EDA Playground (free account)
- Icarus Verilog for the RTL
Steps
- Read the APB section of the free Arm AMBA specification: setup phase, then access phase.
- Write the slave with four 32-bit registers and PREADY tied high.
- Write tasks apb_write(addr, data) and apb_read(addr, data) in the testbench.
- Keep a model of what each register should hold and compare on every read.
- Test invalid addresses and back-to-back transfers.
- Print a clear PASS or FAIL summary at the end.
Make it stand out
- Add wait states (PREADY low) and check the testbench still works.
- Add PSLVERR for invalid addresses.
Put it on your resume
Built a self-checking SystemVerilog testbench with reusable APB read/write tasks for a register block.
Replace each [x] with a number you measured. Real numbers make a line believable.
Keep going
This project fits stage 2, “SystemVerilog for verification”, of the Design verification roadmap. See also how freshers get into design verification trainee jobs.