APB VIP Integration Guide

1. Instantiate the interface

apb_if always contains APB4 signals (PPROT, PSTRB) so that a single compiled image can run in APB3 or APB4 mode.

Example:

localparam int ADDR_W = 16;
localparam int DATA_W = 32;
localparam int NSEL   = 1;

logic PCLK, PRESETn;
apb_if #(ADDR_W, DATA_W, NSEL) apb (.*);

2. Connect virtual interface

uvm_config_db#(virtual apb_if #(ADDR_W, DATA_W, NSEL))::set(null, "*", "vif", apb);

3. Create master/slave agents

Use apb_env_cfg + apb_agent_cfg:

See the example implementation in kvips/apb/examples/uvm_back2back/tb/tb_pkg.sv.

4. Select APB3 vs APB4 (runtime)

Notes:

5. Scoreboard and validation

The example connects:

Disable scoreboard via:

6. Transaction recording (optional)

Enable transaction recording via:

7. Debug switches

Common plusargs in the example TB:

Assertions: