olo_axi_master_full¶
Status Information¶
VHDL Source: olo_axi_master_full
Description¶
This entity is a wrapper around olo_axi_master_simple to allow the following things:
- Access to non word-aligned addresses
- Arbitrarily sized (not a multiple of AXI data words) transfers
- AXI data width can be bigger than the data-width of the user interface
Besides the capability for unaligned transfers, the user interface is the same as for olo_axi_master_simple - please read through the documentation of olo_axi_master_simple. Important topics covered there are:
- Automatic splitting of transfers at 4kB boundaries
- Automatic splitting of transfers at the maximum bust-size supported by AXI4
- High Latency vs. Low Latency transactions
Important differences between olo_axi_master_full and olo_axi_master_simple are:
- Transaction size (CmdWr_Size/CmdRd_Size) is given in bytes not words
- Write data cannot be provided before the command (due to the required alignment)
- No byte enables are provided on the user interface because data is aligned automatically.
Note that due to the alignment logic, every command takes at least four clock cycles to process. In most cases there significant bursts are executed this does not matter but for cases where many very small (e.g. single-beat) transactions are required this entity is suboptimal.
Throughput¶
The data path takes the next command without a gap (see Overview): from 16 words per command, writes reach one beat per clock cycle. The command rate is bound by olo_axi_master_simple (one command every 6 clock cycles) plus one clock cycle per command in this entity, which limits shorter commands. For reads the entity keeps one command in flight beyond the one whose data it delivers, so the read latency is hidden only for long commands: at a read latency of 8 clock cycles about two clock cycles per command are lost from 16 words per command, shorter read commands wait for part of the latency. With UserDataWidth_g < AxiDataWidth_g the user side is the limit: one user word per clock cycle.
Measured with 32-bit user and AXI data, AxiMaxBeats_g = 16, back-to-back commands in high-latency mode, a slave that is always ready and a read latency of 8 clock cycles (beats per clock cycle, writes on the AXI data channel):
| Command size | Writes | Reads |
|---|---|---|
| 8 bytes (2 words) | 0.29 | 0.19 |
| 16 bytes (4 words) | 0.58 | 0.34 |
| 32 bytes (8 words) | 0.89 | 0.58 |
| 64 bytes (16 words) | 1.00 | 0.89 |
| 64 bytes at offset 1 | 0.94 | 0.89 |
| 1 KB | 1.00 | 0.99 |
An unaligned command of 16 words spans 17 AXI words, hence 0.94 at offset 1.
Most of the logic in this entity is related to unaligned and odd-sized transfers. So if you only require an AXI data width that is larger than the user interface data width, you may consider using olo_axi_master_simple along with olo_base_wconv_n2xn/ olo_base_wconv_xn2n (width conversion) to achieve better performance with less resource utilization.
Read and write logic are fully independent. So reads and writes can happen at the same time.
FIXED Bursts¶
A command with CmdWr_Fixed or CmdRd_Fixed = '1' is executed with FIXED bursts as described for olo_axi_master_simple: all bursts at the same address, at most 16 beats each, not split at 4kB boundaries. For such a command:
- The address bits below the AXI data width are ignored: the transfer starts at the AXI word that contains the address.
- The user data is packed into the AXI beats from byte lane 0 without realignment: beat n carries the bytes n x B to n x B + B - 1 of the transfer, B = AxiDataWidth_g/8.
- Write: the strobes of the last beat are set for the remaining bytes only.
- Read: of the last beat only the remaining bytes are delivered.
- CmdWr_Size and CmdRd_Size remain in bytes.
Generics¶
| Name | Type | Default | Description |
|---|---|---|---|
| AxiAddrWidth_g | positive | 32 | AXI4 address width (width of AwAddr and ArAddr signals) Range: 12 ... 64 |
| AxiDataWidth_g | positive | 32 | AXI data width (must be a power of 2 of bytes and equal to or an integer multiple of UserDataWidth_g) Range: 8 ... 1024 |
| AxiMaxBeats_g | positive | 256 | Maximum number of beats in one AXI transaction. Values given by the AXI specification are 16 for AXI-3 and 256 for AXI-4. However, the user may choose any other number for scheduling reasons. Range: 1 ... 256 |
| AxiMaxOpenTransactions_g | positive | 8 | Maximum number of AXI commands (AW/AR-channel) to send before the first command is completed (outstanding transactions). Range: 1 ... 8 |
| UserTransactionSizeBits_g | positive | 24 | Number of bits used to specify the number of bytes to transfer on the user command interface. This is the only limiting factor for the transfer size requested. Must be smaller than AxiAddrWidth_g-1, so that a single transfer cannot exceed the AXI address range. |
| DataFifoDepth_g | positive | 1024 | Number of entries in the read/write data FIFOs (in AXI data words - AxiDataWidth_g, not bytes) |
| UserDataWidth_g | positive | 32 | Width of the user interface for data (Wr_Data/Rd_Data) |
| ImplRead_g | boolean | true | Implement read functionality (can be disabled to save resources) |
| ImplWrite_g | boolean | true | Implement write functionality (can be disabled to save resources) |
| RamBehavior_g | string | "RBW" | Block-RAM style (must match FPGA architecture) "RBW" Read before write, "WBR" Write before read |
Interfaces¶
Control¶
| Name | In/Out | Length | Default | Description |
|---|---|---|---|---|
| Clk | in | 1 | - | Clock |
| Rst | in | 1 | - | Reset input (high-active, synchronous to Clk) |
AXI Interfaces¶
| Name | In/Out | Length | Default | Description |
|---|---|---|---|---|
| M_Axi_... | * | * | * | AXI4 master interface. For the exact meaning of the signals, refer to the AXI protocol specification. |
Transaction requests are forwarded from the slave interface to the master interfaces. Responses are forwarded from the master interface to the slave interface.
Note about AXI Id Signals¶
The following signals are not included in the olo_axi_master_full interface but they could be mandatory for some applications or tools:
- M_Axi_AwId
- M_Axi_BId
- M_Axi_ArId
- M_Axi_RId
These signals are not included in olo_axi_master_full on purpose as they are not strictly needed to handle an AXI transaction. If some application or tool require these signals, the user should add them in the wrapping entity.
User Write Command Interface¶
| Name | In/Out | Length | Default | Description |
|---|---|---|---|---|
| CmdWr_Addr | in | AxiAddrWidth_g | 0 | Address to start writing at. Unaligned addresses are allowed and data is aligned automatically. |
| CmdWr_Size | in | UserTransactionSizeBits_g | 0 | Number of bytes in the transfer. Transfers may exceed AxiMaxBeats_g and 4k boundaries. Transfers are splitted by the olo_axi_master_simple automatically. |
| CmdWr_LowLat | in | 1 | '0' | '1' --> Low latency mode, '0' --> High latency mode It is recommended to not use low-latency transfers if AxiDataWidth_g > UserDataWidth_g because the width conversion limits the bandwidth which would lead to stall-cycles on the AXI bus. |
| CmdWr_Fixed | in | 1 | '0' | '1' --> FIXED bursts at the AXI word of CmdWr_Addr, '0' --> incrementing bursts See FIXED Bursts |
| CmdWr_Valid | in | 1 | '0' | AXI-S handshaking signal for CmdWr |
| CmdWr_Ready | out | 1 | - | AXI-S handshaking signal for CmdWr |
User Write Data Interface¶
| Name | In/Out | Length | Default | Description |
|---|---|---|---|---|
| Wr_Data | in | UserDataWidth_g | 0 | Write data |
| Wr_Valid | in | 1 | '0' | AXI-S handshaking signal for Wr |
| Wr_Ready | out | 1 | - | AXI-S handshaking signal for Wr |
User Read Command Interface¶
| Name | In/Out | Length | Default | Description |
|---|---|---|---|---|
| CmdRd_Addr | in | AxiAddrWidth_g | 0 | Address to start reading at. Unaligned addresses are allowed and data is aligned automatically. |
| CmdRd_Size | in | UserTransactionSizeBits_g | 0 | Number of bytes in the transfer Transfers may exceed AxiMaxBeats_g and 4k boundaries. Transfers are splitted by the olo_axi_master_simple automatically. |
| CmdRd_LowLat | in | 1 | '0' | '1' --> Low latency mode, '0' --> High latency mode It is recommended to not use low-latency transfers if AxiDataWidth_g > UserDataWidth_g because the width conversion limits the bandwidth which would lead to stall-cycles on the AXI bus. |
| CmdRd_Fixed | in | 1 | '0' | '1' --> FIXED bursts at the AXI word of CmdRd_Addr, '0' --> incrementing bursts See FIXED Bursts |
| CmdRd_Valid | in | 1 | '0' | AXI-S handshaking signal for CmdRd |
| CmdRd_Ready | out | 1 | - | AXI-S handshaking signal for CmdRd |
User Read Data Interface¶
| Name | In/Out | Length | Default | Description |
|---|---|---|---|---|
| Rd_Data | out | UserDataWidth_g | - | Read data |
| Rd_Last | out | 1 | - | Indicates last word of data related to a CmdRd command. The bit is related to the user command (CmdRd) and only set for the last AXI burst related to one user-command. |
| Rd_Valid | out | 1 | - | AXI-S handshaking signal for Rd |
| Rd_Ready | in | 1 | '1' | AXI-S handshaking signal for Rd |
User Response Interface¶
| Name | In/Out | Length | Default | Description |
|---|---|---|---|---|
| Wr_Done | out | 1 | - | Pulsed high when a write command was completed successfully. |
| Wr_Error | out | 1 | - | Pulsed high when a write command was completed but failed (AXI response from slave indicated an error) |
| Rd_Done | out | 1 | - | Pulsed high when a read command was completed successfully. |
| Rd_Error | out | 1 | - | Pulsed high when a read command was completed but at least one transaction failed (AXI response from slave indicated an error) |
| Wr_ErrorResp | out | 2 | - | AXI response code of the failed write command, valid in the clock cycle in which Wr_Error is high (see below). "00" in all other clock cycles. |
| Rd_ErrorResp | out | 2 | - | AXI response code of the failed read command, valid in the clock cycle in which Rd_Error is high (see below). "00" in all other clock cycles. |
A command fails if any response of its bursts is not OKAY; for reads this includes every beat. The master never requests exclusive access, so EXOKAY also counts as a failure. Wr_ErrorResp and Rd_ErrorResp report the first response other than OKAY of the failed command, in the order the responses are accepted: "10" (SLVERR), "11" (DECERR) or "01" (EXOKAY). Each command starts without an error code, so a successful command after a failed one reports no code.
Architecture¶
Overview¶
The entity is a wrapper around olo_axi_master_simple. It controls data alignment and the width conversion between user interface and AXI but uses olo_axi_master_simple to actually execute the transfers.
The only FIFOs present are the ones inside olo_axi_master_simple (see the corresponding documentation). As a result, significant amounts of data cannot be provided before the command because the command determines the alignment required (which is done before the data goes into the FIFO). However, user designs shall not rely on no data being accepted before the command - due to timing optimization a few words of data may be accepted before the command.
Commands follow each other without gaps: the data path takes the next command when the data of the current one are through, and the command is handed to olo_axi_master_simple independently. In high-latency mode olo_axi_master_simple takes the next command only after the data of the current one, so the data of a command can reach its data FIFO before the command. This relies on olo_axi_master_simple accepting write data before, with or after the command.
In cases where the amount of data to write - and hence the write command WrCmd_xxx - is unknown until no more data arrives, above situation is a problem because data is only accepted after the command. In this situation, it is recommended that the user inserts a FIFO (to buffer the data before a command can be generated) external to olo_axi_master_full.
The entity implements read and write side completely independent. It is possible to implement only one or the other direction of transfers.
Transaction Types¶
For simplicity, only burst transactions are shown. However, of course also single-word transactions are supported.
Note that latencies and delays may be drawn shorter than they actually are to keep the waveforms small. However, all relationship between signals are correct.
For all figures, an AXI-width of 32 bits and a user data width of 16 bits is assumed to keep the figures simple.
For simplicity reasons, only transfers that consist of one AXI transaction are shown. For the user interface, larger transactions (consisting of multiple AXI bursts) do behave exactly the same.
For all transactions, user data is right-aligned. The byte at the start address specified in the command is the LSB of the user input/output data.
Note that the transaction examples focus on data-alignment. For anything else, refer to the documentation of olo_axi_master_simple.
Read Transaction¶
The example below shows a read transaction.

Read transaction \p> The read command together with the address of the first used byte and the size of the data required in bytes is asserted. The _olo_axi_master_full_ then calculates the word-aligned AXI start address (0x0200) and the number of AXI-beats required (3 \--\> _M\_Axi\_ArLen_=2) and asserts the AXI AR-command. The received data is aligned correctly in order to have the first byte the user requested as LSB of the first _Rd_Data_ word. Unused trailing bytes may have any value, they shall never be interpreted. Note that the _Rd\_Done_ signal is asserted as soon as all data is read from AXI, even if the data was not yet consumed on the _Rd_Data_ interface. #### Write Transaction The example below shows a write transaction. Note that a high-latency write (AXI commands only sent after data is in buffer) is shown in this figure. 
Write transaction \p> In this example, the user provides some data before the command. The first word is accepted before the command, all other data is not accepted before the command is known. Then the write command together with the address of the first byte to write and the size of the data is provided. The _olo_axi_master_full_ then calculates the word-aligned AXI start address (0x0200) and the number of AXI-beats required (3 \--\> _M\_Axi\_ArLen_=2) and asserts the AXI AW-command. The user data is automatically aligned to the alignment of the AXI bus. Unused bytes may have any value, which is fine because the corresponding strobe signal is set to low. The same applies to the user interface: unused trailing bytes can have any value and do not influence the transaction. As soon as the write response from AXI is received, the _Wr_Done_ signal is asserted.