A newer version of this document is available. Customers should click here to go to the newest version.
B.1. Queue Control
The QCSR space contains queue control and status information. This register space of 1 MB can support up to 256 H2D and 256 D2H queues, where each queue is allocated 256 bytes of register space. The memory space allocated to each function is enough for each function to have allocated all the DMA Channels. However, the actual number depends on the parameters input at IP generation time.
Address [7:0]: Registers for the queues
Address [18:8]: Queue number
Address [19]: 0 = D2H, 1=H2D
The following registers are defined for the H2D/D2H queues. The base addresses for H2D and D2H are different, but registers (H2D and D2H) have the same address offsets.
Register Name | Address Offset | Access Type | Description |
---|---|---|---|
Q_CTRL | 8’h00 | R/W | Control Register |
RESERVED | 8’h04 | Reserved | |
Q_START_ADDR_L | 8’h08 | R/W | Lower 32 bits of the queue base address in system memory. This is the beginning of the linked-list of 4KB pages containing the descriptors. |
Q_START_ADDR_H | 8’h0C | R/W | Upper 32 bits of the queue base address in system memory. This is the beginning of the linked-list of 4KB pages containing the descriptors. |
Q_SIZE | 8’h10 | R/W | Number of maximum entries in a queue. Powers of 2 only. |
Q_TAIL_POINTER | 8’h14 | R/W | Current pointer to the last valid descriptor queue entry in the host memory. |
Q_HEAD_POINTER | 8’h18 | RO | Current pointer to the last descriptor that was fetched. Updated by the Descriptor Fetch Engine. |
Q_COMPLETED_POINTER | 8’h1C | RO | Last completed pointer after DMA is done. Software can poll this for status if Writeback is disabled. |
Q_CONSUMED_HEAD_ADDR_L | 8’h20 | R/W | Lower 32 bits of the system address where the ring consumed pointer is stored. This address is used for consumed pointer writeback. |
Q_CONSUMED_HEAD_ADDR_H | 8’h24 | R/W | Upper 32 bits of the system address where the ring consumed pointer is stored. This address is used for consumed pointer writeback. |
Q_BATCH_DELAY | 8’h28 | R/W | Delay the descriptor fetch until the time elapsed from a prior fetch exceeds the delay value in this register to maximize fetching efficiency. |
Q_DATA_DRP_ERR_CTR | 8’h40 | RW | Data drop error counter. |
Q_PYLD_CNT | 8’h44 | R/W | 20-bit payload count. DMA payload size in bytes and must be 64-byte aligned. Maximum 1 MB, with 20’h0 indicating 1 MB. The value set in this register must be the same as used by the Host software to populate the PYLD_CNT field of descriptors for the respective channel. Applicable only for D2H AXI-S port mode. Unused in all other modes. |
Q_RESET | 8’h48 | R/W | Request reset for the queue by writing 1’b1 to this register, and poll for a value of 1’b0 when reset has been completed by hardware. Hardware clears this bit after completing the reset of a queue. Similar process occurs when FLR reset is detected for a VF. |
The following registers are defined for each implemented H2D and D2H queue. The total QCSR address space for each H2D/D2H is 256B and requires 8 bits of address.
Bits[31:0] | Name | R/W | Default | Description |
---|---|---|---|---|
[31:10] | rsvd | Reserved | ||
[9] | q_intr_en | R/W | 0 | If set, upon completion, generate an MSI-X interrupt for the queue. |
[8] | q_wb_en | R/W | 0 | If set, upon completion, do a write-back for the queue. |
[7:1] | rsvd | Reserved | ||
[0] | q_en | R/W | 0 | Enable. Once it is enabled, the DMA starts fetching pending descriptors and executing them. |
Bits[31:0] | Name | R/W | Default | Description |
---|---|---|---|---|
[31:0] | q_strt_addr_l | R/W | 0 | After software allocates the descriptor ring buffer, it writes the lower 32-bit allocated address to this register. The descriptor fetch engine uses this address and the pending head/tail pointer to fetch the descriptors. |
Bits[31:0] | Name | R/W | Default | Description |
---|---|---|---|---|
[31:0] | q_strt_addr_h | R/W | 0 | After software allocates the descriptor ring buffer, it writes the upper 32-bit allocated address to this register. The descriptor fetch engine uses this address and the pending head/tail pointer to fetch the descriptors. |
Bits[31:0] | Name | R/W | Default | Description |
---|---|---|---|---|
[31:5] | rsvd | Reserved | ||
[4:0] | q_size | R/W | 1 | Size of the descriptor ring in power of 2 and maximum value of 16. The unit is number of descriptors. Hardware defaults to using a value of 1 if an illegal value is written. A value of 1 means a queue size of 2 (2^1). A value of 16 (0x10) means a queue size of 64K (2^16). |
Bits[31:0] | Name | R/W | Default | Description |
---|---|---|---|---|
[31:16] | rsvd | Reserved | ||
[15:0] | q_tl_ptr | R/W | 0 | After software sets up a last valid descriptor in the descriptor buffer, it programs this register with the position of the last (tail) valid descriptor that is ready to be executed. The DMA Descriptor Engine fetches descriptors from the buffer up to this position of the buffer.
Note: Writing 0x0 to Q_TAIL_POINTER is illegal.
|
Bits[31:0] | Name | R/W | Default | Description |
---|---|---|---|---|
[31:25] | rsvd | Reserved | ||
[24] | q_err_during_desc_fetch | RO | 0 | Error during descriptor fetch, e.g. Cmplto/UR. |
[23:16] | rsvd | Reserved | ||
[15:0] | q_hd_ptr | R/W | 0 | After the DMA Descriptor Fetch Engine fetches the descriptors from the descriptor buffer, up to the tail pointer, it updates this register with that last fetched descriptor position. The fetch engine only fetches descriptors if the head and tail pointers are not equal. |
Bits[31:0] | Name | R/W | Default | Description |
---|---|---|---|---|
[31:16] | rsvd | Reserved | ||
[15:0] | q_cmpl_ptr | R/W | 0 | This register is updated by hardware to store the last descriptor position (pointer) that DMA has completed, and all data for that descriptor and previous descriptors has arrived at the intended destinations. Software can poll this register to find out the status of the DMA for a specific queue. |
Bits[31:0] | Name | R/W | Default | Description |
---|---|---|---|---|
[31:0] | q_cnsm_hd_addr_l | R/W | 0 | Software programs this register with the lower 32-bit address location where the writeback targets after DMA is completed for a descriptor with writeback bit enabled. |
Bits[31:0] | Name | R/W | Default | Description |
---|---|---|---|---|
[31:0] | q_cnsm_hd_addr_h | R/W | 0 | Software programs this register with the upper 32-bit address location where the writeback targets after DMA is completed for a set of descriptors. |
Bits[31:0] | Name | R/W | Default | Description |
---|---|---|---|---|
[31:20] | rsvd | Reserved | ||
[19:0] | q_batch_dscr_delay | R/W | 0 | Software programs this register with the amount of time between fetches for descriptors. Each unit is 2ns. |
Bits[31:0] | Name | R/W | Default | Description |
---|---|---|---|---|
[31:21] | rsvd | Reserved | ||
[20] | q_d2h_data_drop_err_st | R/W | 0 | D2H data drop error status for a channel. This bit is set when packets are received for a channel that is not enabled or when packets are dropped for a channel that is enabled. |
[19] | rsvd | Reserved | ||
[18] | rsvd | Reserved | ||
[17] | q_data_err_mm | R/W | 0 | Data error status for a channel in AXI-MM mode. |
[16] | q_data_err_st | R/W | 0 | Data error status for a channel in AXI-S mode. |
[15:0] | q_data_drp_err_cnt | R/W | 0 | Data drop error count. The error count is updated by the hardware and count increments whenever the D2H side drops a packet. The error count saturates at all 1's and needs software to clear. Data drop example cases:
Note: For packets received for a channel that is enabled, TID update is done by software. However, the descriptors that are not yet fetched are not dropped.
|
Bits[31:0] | Name | R/W | Default | Description |
---|---|---|---|---|
[31:20] | rsvd | Reserved | ||
[19:0] | q_pyld_cnt | R/W | 0 | 20-bit payload count. DMA payload size in bytes. Maximum 1 MB, with 20’h0 indicating 1 MB. This value must be the same as set in the descriptors payload count field. Applicable only for D2H AXI-S port mode. Unused in all other modes. |
Bits[31:0] | Name | R/W | Default | Description |
---|---|---|---|---|
[31:1] | rsvd | Reserved | ||
[0] | q_reset | R/W | 0 | Request reset for the queue by writing 1’b1 to this register, and poll for a value of 1’b0 when reset has been completed by hardware. Hardware clears this bit after completing the reset of a queue. |