SPRUGR9H November 2010 – April 2015 66AK2E05 , 66AK2H06 , 66AK2H12 , 66AK2H14 , 66AK2L06 , AM5K2E02 , AM5K2E04 , SM320C6678-HIREL , TMS320C6652 , TMS320C6654 , TMS320C6655 , TMS320C6657 , TMS320C6670 , TMS320C6671 , TMS320C6672 , TMS320C6674 , TMS320C6678
The Queue N Register D (Figure 4-14) is written to add a packet to the queue and read to pop a packet off a queue. The packet is pushed to or popped from the queue only when the Queue Register D is written.
NOTE
Remember that all accesses to Registers A, B, C and D are considered by the hardware an atomic access. If reading/writing Register C with this register, read the atomicity note in the section for Register C. Reading Registers A and B are best done using the Queue Peek region. Please see the above register descriptions for more information. Pushing to the VBUSM address is faster than the VBUSP address due to the deeper write buffer (and no stalls), but popping is faster via the VBUSP address to due the higher VBUSM SCR latency for pop operations.
31 | 4 | 3 | 0 |
DESC_PTR | DESC_SIZE |
R/W-0 | R/W-0 |
Legend: R/W = Read/Write; - n = value after reset |
Bit | Field | Description |
---|---|---|
31-4 | DESC_PTR | Descriptor pointer. It will be read as 0 if the queue is empty. It will indicate a 16-byte-aligned address that points to a descriptor when the queue is not empty. Writing a 0 will force queue empty, possibly losing queued descriptors. |
3-0 | DESC_SIZE | Descriptor hint size (PKTDMA pre-fetch size), encoded in 16-byte increments as follows:
This field should be set to the smallest value that is greater than or equal to the size of the entire control portion of the descriptor. This includes all descriptor information (including the protocol specific bytes) with the exception of the data portion of the monolithic descriptor. If this value is smaller than the control portion size of the descriptor, the PKTDMA will not fetch the remainder and will hang. For AIF Monolithic Mode, this value should always be set to 3. If the queue is empty, this field will return a 0x0 when read. When the Packet DMA pushes descriptors to TX Return queues, this field will be 0. When it pushes to RX Destination queues, it will be set based on the constructed descriptor. |
CAUTION
A race condition may occur whenever a program writes to two differing memory endpoints, meaning that the memory writes are not guaranteed to land in the order written. When the write to push to a PKTDMA Tx queue immediately follows a write to another endpoint (such as a descriptor or payload data), the PKTDMA could start reading the data before it has actually landed. This can be mitigated by adding an MFENCE instruction prior to the push.