apb_driver

class apb_driver extends uvm_driver #(apb_seq_item,
apb_seq_item)

Implements an APB bus master acting as the driver of an APB agent.

The driver receives transactions through a pull port, normally connected to the agent’s sequencer.  The transactions are translated into APB bus transactions.

This driver implementation supports only valid and properly framed bus transactions.

The driver supports multiple bus slaves.  The number of slaves and their address map is controlled through an agent’s configuration obtained from the UVM Configuration DB during the build phase.

@todo A more proper way to configure the driver is through a direct config object assignment, rather than through the UVM Config DB.

Summary
apb_driverImplements an APB bus master acting as the driver of an APB agent.
Variables
apb_ifReference to the APB interface.
m_cfgDriver configuration.
Functions
sel_lookupLooks up the <address> and returns a PSEL line index that should be activated.
newConventional UVM component constructor.
run_phaseForks off a forever loop in which the driver pulls transactions and drives them on the APB bus.
build_phaseMerely obtains the driver configuration from the UVM Configuration DB.

Variables

apb_if

virtual apb_if APB

Reference to the APB interface.  The reference is obtained from the driver’s configuration instance (and hence somewhat duplicates the information contained therein).

m_cfg

apb_agent_config m_cfg

Driver configuration.  Normally this aliases with the parent agent configuration.

Functions

sel_lookup

extern function int sel_lookup(logic[31:0] address)

Looks up the <address> and returns a PSEL line index that should be activated.  If the address is invalid, a non positive integer is returned to indicate an error.

Parameters

addressAn APB address for which to find a slave index (within PSEL).

new

extern function new(string name =  "apb_driver",
uvm_component parent =  null)

Conventional UVM component constructor.

run_phase

extern task run_phase(uvm_phase phase)

Forks off a forever loop in which the driver pulls transactions and drives them on the APB bus.

build_phase

extern function void build_phase(uvm_phase phase)

Merely obtains the driver configuration from the UVM Configuration DB.

class apb_driver extends uvm_driver #(apb_seq_item,
apb_seq_item)
Implements an APB bus master acting as the driver of an APB agent.
virtual apb_if APB
Reference to the APB interface.
apb_agent_config m_cfg
Driver configuration.
extern function int sel_lookup(logic[31:0] address)
Looks up the address and returns a PSEL line index that should be activated.
extern function new(string name =  "apb_driver",
uvm_component parent =  null)
Conventional UVM component constructor.
extern task run_phase(uvm_phase phase)
Forks off a forever loop in which the driver pulls transactions and drives them on the APB bus.
extern function void build_phase(uvm_phase phase)
Merely obtains the driver configuration from the UVM Configuration DB.