1.1.1. Altera® AXI4 Memory-Mapped Specification Support
1.1.2. Altera® AXI4 Memory-Mapped BFM Components
1.1.3. Altera® AXI4 Memory-Mapped Supported Features
1.1.4. Altera® AXI4 Memory-Mapped BFM SystemVerilog Packages
1.1.5. Altera® AXI4 Memory-Mapped BFM Supported Flows
1.1.6. Altera® AXI4 Memory-Mapped BFM Supported Simulators
1.3.1. Altera® AXI4 Memory-Mapped Manager BFM Configuration
1.3.2. Altera® AXI4 Memory-Mapped Manager BFM Interface
1.3.3. Altera® AXI4 Memory-Mapped Subordinate BFM Configuration
1.3.4. Altera® AXI4 Memory-Mapped Subordinate BFM Interface
1.3.5. Altera® AXI4-Lite Memory-Mapped Manager BFM Configuration
1.3.6. Altera® AXI4-Lite Memory-Mapped Manager BFM Interface
1.3.7. Altera® AXI4-Lite Memory-Mapped Subordinate BFM Configuration
1.3.8. Altera® AXI4-Lite Memory-Mapped Subordinate BFM Interface
1.3.9. Altera® AXI4 Memory-Mapped Inline Monitor Configuration
1.3.10. Altera® AXI4 Inline Monitor Interface
1.4.1. Using the Altera® AXI4 Memory-Mapped Manager BFM Flow
1.4.2. Using the Altera® AXI4 Memory-Mapped Subordinate BFM Flow
1.4.3. Using the Altera® AXI4 Memory-Mapped Monitor BFM Flow
1.4.4. Altera® AXI4 Memory-Mapped Manager RTL Implementation Example
1.4.5. Altera® AXI4 Memory-Mapped Manager Platform Designer BFM Implementation Example
1.5.1. Altera® AXI4 Memory-Mapped BFM Configuration API
1.5.2. Altera® AXI4 Memory-Mapped BFM Reset API
1.5.3. Altera® AXI4 Memory-Mapped Manager Transaction Creation API
1.5.4. Altera® AXI4 Memory-Mapped Subordinate Transaction Creation API
1.5.5. Altera® AXI4 Memory-Mapped Transaction Configuration API
1.5.6. Altera® AXI4 Memory-Mapped BFM Transaction Execution API
1.5.7. Altera® AXI4 Memory-Mapped Host Memory API
2.4.1. Using the Transmitter BFM Flow
IP Catalog Transmitter BFM Generation Flow
Platform Designer Transmitter BFM Generation Flow
Creating a Testbench using the AXI4 Streaming BFM
2.4.2. Using the Receiver BFM Flow
2.4.3. Altera® AXI4 Streaming BFM Tools
2.4.4. Altera® AXI4 Streaming BFM RTL Example
2.4.5. Altera® AXI4 Streaming BFM Platform Designer Example
2.5.1.2.1. Class Axi4StreamBytes
2.5.1.2.2. Data Members in Axi4StreamBytes Class
2.5.1.2.3. Methods in Axi4StreamBytes Class
2.5.1.2.4. Class Axi4StreamBytesData
2.5.1.2.5. Methods in Axi4StreamBytesData Class
2.5.1.2.6. Class Axi4StreamBytesPosition
2.5.1.2.7. Methods in Axi4StreamBytesPosition Class
2.5.1.2.8. Class Axi4StreamBytesNull
2.5.1.2.9. Methods in Axi4StreamBytesNull Class
2.5.1.2.10. Class Axi4StreamBytesDataError
2.5.1.2.11. Data Members in Axi4StreamBytesDataError Class
2.5.1.2.12. Methods in Class Axi4StreamBytesDataError
2.5.1.2.13. Class Axi4StreamBytesPositionError
2.5.1.2.14. Data Members in Class Axi4StreamBytesPositionError
2.5.1.2.15. Methods in Class Axi4StreamBytesPositionError
2.5.1.2.16. Class Axi4StreamBytesNullError
2.5.1.2.17. Data Members in Class Axi4StreamBytesNullError
2.5.1.2.18. Methods in Class Axi4StreamBytesNullError
2.4.1. Using the Transmitter BFM Flow
The following steps describe implementation of the Transmitter BFM from the Quartus® Prime Pro Edition IP Catalog or from Platform Designer. You can use either the IP Catalog flow to define a single Transmitter BFM and testbench, or use the Platform Designer flow to integrate the BFM and testbench into a Platform Designer system.
IP Catalog Transmitter BFM Generation Flow
- From the Quartus® Prime Pro Edition software IP Catalog, search for the Altera AXI4 Streaming Transmitter BFM.
- In the IP parameter editor, specify appropriate parameters and generate the HDL for your transmitter configuration.
- Create a testbench and connect the Transmitter BFM to the DUT.
- To access the Transmitter BFM, use the following hierarchy:
<bfm inst>.axi4_stream_bfm_transmitter_0.axi4_stream_tx_bfm
Platform Designer Transmitter BFM Generation Flow
- In the Quartus® Prime Pro Edition software, click Tools > Platform Designer.
- In Platform Designer's IP Catalog, search for the Altera AXI4 Streaming Transmitter BFM.
- In the IP parameter editor, specify appropriate parameters for your Transmitter configuration.
- To generate the Platform Designer system and testbench, click Generate HDL.
- To access the Transmitter BFM in the testbench, use the following hierarchy:
<PD system inst>.<PD bfm inst>.<PD bfm inst>.axi4_stream_tx_bfm
Creating a Testbench using the AXI4 Streaming BFM
- Import the required Altera AXI4 Streaming BFM SystemVerilog packages:
import altera_lnsim_ver.axi4_stream_bfm_types_pkg::*; import altera_lnsim_ver.axi4_stream_bytes_class_pkg::*; import altera_lnsim_ver.axi4_stream_transfer_class_pkg::*; import altera_lnsim_ver.axi4_stream_packet_class_pkg::*;
- Define the transfers and packets:
// Transfer Axi4StreamTransfer#(.AXI4_STREAMING_DATA_BUS_WIDTH(DATA_BUS_WIDTH), .AXI4_STREAMING_TID_WIDTH(TID_WIDTH), .AXI4_STREAMING_TDEST_WIDTH(TDEST_WIDTH), .AXI4_STREAMING_TUSER_WIDTH(TUSER_WIDTH)) tx_tr; // Packet Axi4StreamPacket#(.AXI4_STREAMING_DATA_BUS_WIDTH(DATA_BUS_WIDTH), .AXI4_STREAMING_TID_WIDTH(TID_WIDTH), .AXI4_STREAMING_TDEST_WIDTH(TDEST_WIDTH), .AXI4_STREAMING_TUSER_WIDTH(TUSER_WIDTH)) p;
- Create the transfer:
tx_tr = new();
- Load data from data buffer or from data queue:
- Option 1: Load from data buffer:
//Define data buffer byte_t byte_buf []; … byte_buf = '{8'h00, 8'h11, 8'h22, 8'h33, 8'h44, 8'h55, 8'h66, 8'h77, 8'h88, 8'h99, 8'hAA, 8'hBB, 8'hCC, 8'hDD, 8'hEE, 8'hFF, 8'h10, 8'h11, 8'h12, 8'h13, 8'h14, 8'h45, 8'h16, 8'h17, 8'h18, 8'h19, 8'h1A, 8'h1B, 8'h1C, 8'h1D, 8'h1E, 8'h1F}; tx_tr.set_payload_from_data(byte_buf); tx_tr.set_gap(5);
- Option 2: Load from data queue:
//Define byte classes, byte arrays and queue Axi4StreamBytes#(AXI4_STREAMING_TUSER_WIDTH) asb;// Super Class Axi4StreamBytesData#(AXI4_STREAMING_TUSER_WIDTH) asbd;// data Axi4StreamBytesPosition#(AXI4_STREAMING_TUSER_WIDTH) asbp;// position Axi4StreamBytesNull#(AXI4_STREAMING_TUSER_WIDTH) asbn;// null Axi4StreamBytes#(AXI4_STREAMING_TUSER_WIDTH) ba[];// array Axi4StreamBytes#(AXI4_STREAMING_TUSER_WIDTH) q[$];// queue … // Load queue with bytes q.delete(); asbd = new(8'h00); asbd.set_tuser_value('hbcd); asb = asbd; q.push_back(asb); asbd = new(8'h11); asb = asbd; q.push_back(asb); asbd = new(8'h22); asb = asbd; q.push_back(asb); asbd = new(8'h33); asb = asbd; q.push_back(asb); … //Position Byte asbp = new(); asb = asbp; q.push_back(asb); //Null Byte asbn = new(); asb = asbn; q.push_back(asb); asbd = new(8'h17); asb = asbd; q.push_back(asb); asbd = new(8'h18); asbd.set_tuser_value(0); asb = asbd; q.push_back(asb); // Load byte array ba = new[q.size()]; for(i=0; i<q.size(); i++) begin ba[i] = q[i]; end // Configure transfer as needed: tx_tr.set_tid('hf); tx_tr.set_tdest(7); tx_tr.set_gap(5); tx_tr.set_delay(5); Load byte array into transfer tx_tr.set_payload_from_bytes(ba); Transmit packet: <bfm>.transmit_bfm.put_packet_for_transmit(p);
- Option 1: Load from data buffer: