RTL Studio Open IDE

5.1 · UVM CLASS

AMBA APB: PSEL, PENABLE, PWRITE timing

Learn APB SETUP/ACCESS timing and verify slave behavior in simulation.

Watch on YouTube

What you practice

AMBA APB: PSEL, PENABLE, PWRITE timing (5.1). Learn APB SETUP/ACCESS timing and verify slave behavior in simulation. It is in APB protocol — Part 5 · AMBA APB and UVM RAL of the UVM Masterclass. APB protocol, register abstraction, and the roadmap to AXI.

The UVM bench compiles in that same browser SystemVerilog simulator. You edit the test in the IDE, run Verilator, and read the log beside the waveform.

What you will learn

You will learn the APB protocol timing model: SETUP phase with PSEL asserted alone, and ACCESS phase with both PSEL and PENABLE asserted, while PWRITE selects read/write direction.

Learning objectives

  • Understand APB SETUP and ACCESS phase timing rules.
  • Identify when PENABLE must be asserted relative to PSEL.
  • Distinguish read (PWRITE=0) and write (PWRITE=1) phases in APB transactions.
  • Verify APB slave behavior via simulation timing and logs.

Theory

APB uses a two-phase handshake: SETUP and ACCESS. In SETUP, PSEL is asserted while PENABLE is low; in ACCESS, PENABLE rises on the next clock edge while PSEL remains high. PWRITE determines whether PWDATA is driven (write) or PRDATA is sampled (read).

PhasePSELPENABLEPWRITEData direction
SETUP10XAddress/setup
ACCESS110/1Read or Write

The slave must assert PREADY during ACCESS to indicate completion; PSLVERR indicates error.

Practice

Open this chapter in RtlStudio; all files appear in Explore.

  1. Open student/tb/tb_top.sv in the editor.
  2. Add stimulus to drive PSEL, PENABLE, PWRITE, PADDR, and PWDATA during SETUP and ACCESS phases.
  3. Ensure PENABLE is low during SETUP, then high during ACCESS on the next clock edge.
  4. Run Simulation and verify INFO: logs appear in the Log panel.
  5. Open the Waveform tab to inspect PSEL, PENABLE, and PWRITE timing alignment.

Summary

You practiced driving APB timing signals—PSEL, PENABLE, and PWRITE—using a finite state machine in the APB driver to correctly transition from SETUP to ACCESS phases. You verified correct register access timing by observing PENABLE assertion only during the ACCESS phase, with PSEL held high and PWRITE reflecting the operation type. This reinforced the fundamental APB protocol requirement that PENABLE must be stable and valid only during the data transfer phase, ensuring reliable slave interaction. The VCD waveform confirmed that all timing constraints were met, validating the driver’s compliance with the APB specification.

Run it in the Verilog IDE

  1. Open the UVM workspace in the IDE. The DUT and the testbench compile together in the browser.
  2. Run the SystemVerilog simulation with Verilator and read the phase and scoreboard lines in the log.
  3. When the check is on pins rather than a print, open the VCD next to that log.
  4. Edit the sequence, driver, or scoreboard in the IDE and rerun. You stay in the same simulator.

The lesson is done when the simulation matches AMBA APB: PSEL, PENABLE, PWRITE timing. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.