APB UVM Agent  0.0.1
Public Member Functions | Public Attributes | List of all members
apb_driver Class Reference

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

+ Inheritance diagram for apb_driver:
+ Collaboration diagram for apb_driver:

Public Member Functions

 uvm_component_utils (apb_driver) virtual apb_if APB
 Reference to the APB interface. More...
 
int sel_lookup (logic< 31:0 > address)
 Looks up the address and returns PSEL line that should be activated. More...
 
 new (string name="apb_driver", uvm_component parent=null)
 Conventional UVM component constructor. More...
 
task run_phase (uvm_phase phase)
 Forks off a forever loop in which the driver pulls transactions and drives them on the APB bus. More...
 
void build_phase (uvm_phase phase)
 Merely obtains the driver configuration from the UVM Configuration DB. More...
 

Public Attributes

apb_agent_config m_cfg
 Driver configuration. Normally this aliases with the parent agent configuration. More...
 

Detailed Description

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.

Definition at line 37 of file apb_driver.svh.

Member Function Documentation

◆ build_phase()

void apb_driver::build_phase ( uvm_phase  phase)

Merely obtains the driver configuration from the UVM Configuration DB.

Definition at line 126 of file apb_driver.svh.

References m_cfg.

◆ new()

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

Conventional UVM component constructor.

Definition at line 80 of file apb_driver.svh.

◆ run_phase()

task apb_driver::run_phase ( uvm_phase  phase)

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

Definition at line 84 of file apb_driver.svh.

References apb_seq_item::data, apb_seq_item::delay, apb_seq_item::error, sel_lookup(), and apb_seq_item::we.

◆ sel_lookup()

int apb_driver::sel_lookup ( logic< 31:0 >  address)

Looks up the address and returns PSEL line that should be activated.

If the address is invalid, a non positive integer is returned to indicate an error.

Definition at line 132 of file apb_driver.svh.

References m_cfg, apb_agent_config::no_select_lines, apb_agent_config::range, and apb_agent_config::start_address.

Referenced by run_phase().

◆ uvm_component_utils()

apb_driver::uvm_component_utils ( apb_driver  )

Reference to the APB interface.

The reference is obtained from the driver's configuration instance (and hence somewhat duplicates the information contained therein).

Member Data Documentation

◆ m_cfg

apb_agent_config apb_driver::m_cfg

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

Definition at line 52 of file apb_driver.svh.

Referenced by build_phase(), and sel_lookup().


The documentation for this class was generated from the following file: