AXI muckbucket
Public Member Functions | Public Attributes | List of all members
axi_driver Class Reference

Logic to act as an AXI master for all 5 channels. More...

Inheritance diagram for axi_driver:
Inheritance graph
[legend]
Collaboration diagram for axi_driver:
Collaboration graph
[legend]

Public Member Functions

 uvm_component_utils (axi_driver) axi_if_abstract vif
 
 new (string name="axi_driver", uvm_component parent=null)
 Constructor. More...
 
void build_phase (uvm_phase phase)
 Creates the virtual interface. More...
 
void connect_phase (uvm_phase phase)
 Nothing to connect so doesn't actually do anything except call parent connect phase. More...
 
task run_phase (uvm_phase phase)
 Launches channel driver threads and then acts as a dispatcher. More...
 
task write_address ()
 Write Address channel thread. More...
 
task write_data ()
 Write Data channel thread. More...
 
task write_response ()
 Write Response channel thread. More...
 
task read_address ()
 Read Address channel thread. More...
 
task read_data ()
 monitors Read Data channel and sends out TLM pkt More...
 

Public Attributes

axi_agent_config m_config
 
memory m_memory
 
mailbox< axi_seq_itemwriteaddress_mbx = new(0)
 
mailbox< axi_seq_itemwritedata_mbx = new(0)
 
mailbox< axi_seq_itemwriteresponse_mbx = new(0)
 
mailbox< axi_seq_itemreadaddress_mbx = new(0)
 
mailbox< axi_seq_itemreaddata_mbx = new(0)
 

Detailed Description

Logic to act as an AXI master for all 5 channels.

Definition at line 31 of file axi_driver.svh.

Member Function Documentation

void axi_driver::build_phase ( uvm_phase  phase)

Creates the virtual interface.

Definition at line 67 of file axi_driver.svh.

void axi_driver::connect_phase ( uvm_phase  phase)

Nothing to connect so doesn't actually do anything except call parent connect phase.

Definition at line 76 of file axi_driver.svh.

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

Constructor.

Doesn't actually do anything except call parent constructor

Definition at line 62 of file axi_driver.svh.

task axi_driver::read_address ( )

Read Address channel thread.

  1. Deassert arvalid
  2. Wait for TLM item in mailbox
  3. Initialize variables
  4. Write out
  5. if ready and valid, wait X clocks where x>=0, then check for any more queued items
  6. if avail, then fetch and goto 'Initialize variables' step.
  7. if no items to be driven on next clk, drive all read address signals low and goto 'Wait for TLM item in mailbox' step.

Definition at line 515 of file axi_driver.svh.

References ADDR_WIDTH, ar_from_class(), axi_seq_item_ar_vector_s::araddr, axi_seq_item_ar_vector_s::arburst, axi_seq_item_ar_vector_s::arid, axi_seq_item_ar_vector_s::arsize, axi_seq_item::convert2string(), m_config, axi_agent_config::max_clks_between_ar_transfers, axi_agent_config::min_clks_between_ar_transfers, readaddress_mbx, and readdata_mbx.

Referenced by run_phase().

Here is the call graph for this function:

Here is the caller graph for this function:

task axi_driver::read_data ( )

monitors Read Data channel and sends out TLM pkt

This task should match the corresponding on in axi_monitor but it doesn't yet

Todo:
: match read_data task in axi_monitor Instead it waits for a pkt in its mailbox. This packet will come from read_address once it has put the address out on the bus. The just continually waits for a valid and ready beat on the channel and stores it in that packet it got from read address. When rlast received, send out analysis port and goes back to waiting for next pkt from read address.

Definition at line 605 of file axi_driver.svh.

References axi_seq_item::addr, ADDR_WIDTH, axi_seq_item::burst_size, axi_seq_item::burst_type, calculate_axlen(), axi_seq_item::cmd, axi_seq_item::data, e_READ_DATA, get_beat_N_byte_lanes(), axi_seq_item::len, m_config, axi_seq_item_r_vector_s::rdata, readdata_mbx, and axi_agent_config::rready_toggle_pattern.

Referenced by run_phase().

Here is the call graph for this function:

Here is the caller graph for this function:

task axi_driver::run_phase ( uvm_phase  phase)

Launches channel driver threads and then acts as a dispatcher.

After launching 5 different threads (one for each channel), this task acts as a dispatcher. It waits for TLM packets and then stuffs them into the appropriate thread's mailbox. IE: If it's an AXI write packet then it puts the packet into the write_address's mailbox so it can handle it. It the waits for the next TLM packet. NOTE: it does not wait for the other thread to finish processing the packet, it just puts it in the mailbox and then immediately waits for the next packet.

Definition at line 91 of file axi_driver.svh.

References axi_seq_item::cmd, axi_seq_item::convert2string(), e_READ, e_WRITE, read_address(), read_data(), readaddress_mbx, write_address(), write_data(), write_response(), and writeaddress_mbx.

Here is the call graph for this function:

axi_driver::uvm_component_utils ( axi_driver  )
task axi_driver::write_address ( )

Write Address channel thread.

  1. Deassert awvalid
  2. Wait for TLM item in mailbox
  3. Initialize variables
  4. Write out
  5. if ready and valid, wait X clocks where x>=0, then check for any more queued items
  6. if avail, then fetch and goto 'Initialize variables' step.
  7. if no items to be driven on next clk, drive all write address signals low and goto 'Wait for TLM item in mailbox' step.

Definition at line 138 of file axi_driver.svh.

References ADDR_WIDTH, aw_from_class(), axi_seq_item_aw_vector_s::awaddr, axi_seq_item_aw_vector_s::awburst, axi_seq_item_aw_vector_s::awid, axi_seq_item_aw_vector_s::awsize, axi_seq_item::convert2string(), m_config, axi_agent_config::max_clks_between_aw_transfers, axi_agent_config::min_clks_between_aw_transfers, writeaddress_mbx, and writedata_mbx.

Referenced by run_phase().

Here is the call graph for this function:

Here is the caller graph for this function:

task axi_driver::write_data ( )

Write Data channel thread.

  1. Deassert wvalid
  2. wait for TLM item to get queued
  3. initialize variables
  4. loop
  5. update variables when wready & wvalid (slave has received current beat)
  6. write out
  7. if wlast and ready and valid, wait X clocks where x>=0, then check for any more queued items
  8. if avail, then fetch and goto 'Initialize variables' step.
  9. if no items to be driven on next clk, the drive all write data signals low and goto 'Wait for TLM item to get queued' step.

Definition at line 233 of file axi_driver.svh.

References axi_seq_item::addr, axi_agent_config::axi_incompatible_wvalid_toggling_mode, axi_seq_item::burst_size, calculate_axlen(), axi_agent_config::clks_without_wvalid_or_wready_max, axi_seq_item::convert2string(), axi_seq_item::get_beat_N_data(), axi_seq_item::len, m_config, axi_agent_config::max_clks_between_w_transfers, axi_agent_config::min_clks_between_w_transfers, axi_seq_item::valid, axi_seq_item_w_vector_s::wdata, axi_seq_item_w_vector_s::wlast, writedata_mbx, writeresponse_mbx, axi_seq_item_w_vector_s::wstrb, axi_agent_config::wvalid, and axi_seq_item_w_vector_s::wvalid.

Referenced by run_phase().

Here is the call graph for this function:

Here is the caller graph for this function:

task axi_driver::write_response ( )

Write Response channel thread.

Wait for write response (bvalid and bready) Convert to TLM itemand send back to sequence

Todo:
: this task needs to be cleaned up. it doesn't actually wait for response

Definition at line 479 of file axi_driver.svh.

References axi_seq_item::bid, axi_seq_item_b_vector_s::bid, axi_agent_config::bready_toggle_pattern, axi_seq_item::bresp, axi_seq_item_b_vector_s::bresp, axi_seq_item::cmd, e_WRITE_RESPONSE, m_config, and writeresponse_mbx.

Referenced by run_phase().

Here is the caller graph for this function:

Member Data Documentation

axi_agent_config axi_driver::m_config
memory axi_driver::m_memory

Definition at line 36 of file axi_driver.svh.

Referenced by axi_agent::build_phase().

mailbox<axi_seq_item> axi_driver::readaddress_mbx = new(0)

Definition at line 41 of file axi_driver.svh.

Referenced by read_address(), and run_phase().

mailbox<axi_seq_item> axi_driver::readdata_mbx = new(0)

Definition at line 42 of file axi_driver.svh.

Referenced by read_address(), and read_data().

mailbox<axi_seq_item> axi_driver::writeaddress_mbx = new(0)

Definition at line 38 of file axi_driver.svh.

Referenced by run_phase(), and write_address().

mailbox<axi_seq_item> axi_driver::writedata_mbx = new(0)

Definition at line 39 of file axi_driver.svh.

Referenced by write_address(), and write_data().

mailbox<axi_seq_item> axi_driver::writeresponse_mbx = new(0)

Definition at line 40 of file axi_driver.svh.

Referenced by write_data(), and write_response().


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