Altera® AXI4 Bus Functional Model User Guides

ID 838773
Date 5/19/2025
Public
Document Table of Contents

1.4.1. Using the Altera® AXI4 Memory-Mapped Manager BFM Flow

The following steps guide you through the Manager BFM flow:
  1. For the Manager BFM, import the altera_axi_bfm_pkg from the altera_lnsim_ver library:
    import altera_lnsim_ver.altera_axi_bfm_pkg::*;
  2. Make declarations for read and write transactions and the manager BFM:
    AlteraAxiTransaction wr_tr, rd_tr; 
    BaseAxiBfm#(ADDR_WIDTH, DATA_WIDTH, ID_WIDTH, USER_WIDTH) axi_mgr_bfm;
    
  3. Assign the BaseAxiBfm object to the manager BFM, using the proper mode.

    For AXI4:

    axi_mgr_bfm = <bfm_intf>.AXI4MAN.bfm;

    For AXI4-Lite:

    axi_mgr_bfm = <bfm inst>.AXI4LITEMAN.bfm
  4. Before using the BFM, use m_reset to reset the BFM:
    axi_mgr_bfm.m_reset();
  5. Create the read and write transactions using manager_bfm_rd_tx( ) and manager_bfm_wr_tx(). Configure the transactions during the transaction creation or using the set_*() methods:
    // Create Write Transaction
    wr_tr = axi_mgr_bfm.manager_bfm_wr_tx();   
    
    // Configure Write Transaction
    wr_tr.set_id(1);
    wr_tr.set_awaddr(0);
    wr_tr.set_burst_length(3);
    wr_tr.set_size(AXI4_BYTES_8);
    wr_tr.set_burst_type(BURST_TYPE_INCR);
    …
    // Create Read Transaction and configure
    rd_tr = axi_mgr_bfm.manager_bfm_rd_tx(1, 0, 3, AXI4_BYTES_8, BURST_TYPE_INCR);
    
  6. Execute transactions by using put_transaction() and drive_transaction():
    // Execute Write Transaction
    axi_mgr_bfm.put_transaction(wr_tr); 
    axi_mgr_bfm.drive_transaction();
    …
    
    // Execute Read Transaction
    axi_mgr_bfm.put_transaction(rd_tr); 
    axi_mgr_bfm.drive_transaction();