2.5.1.3.1. Class Axi4StreamTransfer
The Transmitter BFM requires the user to segment the data, and then attach one or more of these transfers to a packet for transmission. The packet class (described later) is a convenient container for grouping transfers together.
The Receiver BFM assembles the received transfers from one or more data beats as transactions on the AXI4 streaming bus. The receiver provides the transfers directly, rather than placing the transfers into packets, because there is no standard way for the AXI4 streaming bus to communicate transfer relationships across the interface. Sending transfer association is often done using information in-band, inside the transfer for later processing, or by using the TUSER information to pass packet grouping information for later processing by your application.
You can use either of the following processes to get data in and out of Axi4StreamTransfer objects:
As all data:
- Type byte_t converted into Axi4StreamBytesData objects.
Or
As all byte objects:
- Data bytes—using Axi4StreamBytesData objects.
- Position bytes—using Axi4StreamBytesPosition objects.
- Null bytes—using Axi4StreamBytesNull objects.
- Data Error bytes—using Axi4StreamBytesDataError objects.
- Position Error bytes—using Axi4StreamBytesPositionError objects.
- Null Error bytes—using Axi4StreamBytesNullError objects.
The later sections of this document discuss method using both types of data entry.
BFM Transfer Object Basic Operation summarizes the basic concepts and interactions of transfer objects.
The delay and gap values can take any unsigned 32-bit integer value to model delays required by the BFM. This includes setting the delay and gap to zero for tightly packed bursts with no idle periods between consecutive transfers, as Consecutive Transfers with No Delay Nor Gap shows. delay is the time delay before the transmission of data. gap is the time delay after the transmission of data before the next transfer may start. The total space between two consecutive transfers consists of the gap of a preceding transfer and the delay from the following transfer, as Total Delay Between Data Transfers shows.
With the delay and gap values set to zero, there are no idle bus beats between consecutive transfers, as Consecutive Transfers with No Delay Nor Gap shows. You can set just one of the variables, such as delay, to model an interface while leaving gap set to zero. The delay and gap data members in the BFM’s Axi4StreamTransfer class are static. Once the data members are set to a value, they remain at that value with each new object created until changed explicitly. This allows you to “set-and-forget” delay and gap values if they are a consistent, repeating value.
The following sections detail how the transfer objects operate to support the basic functionality.