C2H Stream Packet Type - 3.3 English

Versal ACAP CPM DMA and Bridge Mode for PCI Express Product Guide (PG347)

Document ID
PG347
Release Date
2022-11-02
Version
3.3 English

The following are some of the different C2H stream packets.

Regular Packet

The regular C2H packet has both the data packet and Completion (CMPT) packet. They are a one-to-one match.

The regular C2H data packet can be multiple beats.

  • s_axis_c2h_ctrl_qid = C2H descriptor queue ID.
  • s_axis_c2h_ctrl_len = length of the packet.
  • s_axis_c2h_mty = empty byte should be set in last beat.
  • s_axis_c2h_ctrl_has_cmpt = 1'b1. This data packet has a corresponding CMPT packet.

The regular C2H CMPT packet is one beat.

  • s_axis_c2h_cmpt_ctrl_qid = Completion queue ID of the packet. This can be different from the C2H descriptor QID.
  • s_axis_c2h_cmpt_ctrl_cmpt_type = HAS_PLD. This completion packet has a corresponding data packet.
  • s_axis_c2h_cmpt_ctrl_wait_pld_pkt_id = This completion packet has to wait for the data packet with this ID to be sent before the CMPT packet can be sent.

When the user application sends the data packet, it must count the packet ID for each packet. The first data packet has a packet ID of 1, and it increments for each data packets.

For the regular C2H packet, the data packet and the completion packet is a one-to-one match. Therefore, the number of data packets with s_axis_c2h_ctrl_has_cmpt as 1'b1 should be equal to the number of CMPT packet with s_axis_c2h_cmpt_ctrl_cmpt_type as HAS_PLD.

The QDMA has a shallow completion input FIFO of depth 2. For better performance, add FIFO for completion input as shown in the diagram below. Depth and width of the FIFO depends on the use case. Width is dependent on the largest CMPT size for the application, and depth is dependent on performance needs. For best performance for 64 Byte CMPT, a depth of 512 is recommended.

When the user application sends the data payload, it counts every packet. The first packet starts with a pkt_pld_id of 1. The second packet has a pkt_pld_id of 2, and so on. It is a 16-bits counter once the count reaches 16'hffff it wraps around to 0 and count forward.

The user application defines the CMPT type.

  • If the s_axis_c2h_cmpt_ctrl_cmpt_type is HAS_PLD, the CMPT has a corresponding data payload. The user application must place pkt_pld_id of that packet in the s_axis_c2h_cmpt_ctrl_wait_pld_pkt_id field. The DMA will only send out this CMPT after it sends out the corresponding data payload packet.
  • If the s_axis_c2h_cmpt_ctrl_cmpt_type is NO_PLD_NO_WAIT, the CMPT does not have any data payload, and it does not need to wait for payload. Then the DMA will send out this CMPT.
  • If the s_axis_c2h_cmpt_ctrl_cmpt_type is NO_PLD_BUT_WAIT, the CMPT does not have a corresponding data payload packet. The CMPT must wait for a particular data payload packet before the CMPT is sent out. Therefore, the user application must place the pld_pkt_id of that particular data payload into the s_axis_c2h_cmpt_ctrl_wait_pld_pkt_id field. The DMA will not send out the CMPT until the data payload with that pld_pkt_id is sent out.
Figure 1. CMPT Input FIFO

Immediate Data Packet

The user application can have a packet that only writes to the Completion Ring without having a corresponding data packet transfer to the host. This type of packet is called immediate data packet. For the immediate data packet, the QDMA will not send the data payload, but it will write to the CMPT Queue. The immediate packet does not consume a descriptor.

For the immediate data packet, the user application only sends the CMPT packet to the DMA, and it does not send the data packet.

The following is the setting of the immediate completion packet. There is no corresponding data packet.

In some applications, the immediate completion packet does not need to wait for any data packet. But in some applications, it might still need to wait for the data payload packet. When the completion type is NO_PLD_NO_WAIT, the completion packet can be sent out without waiting for any data packet. When the completion type is NO_PLD_BUT_WAIT, the completion packet must specify the data packet ID that it needs to wait for.

  • s_axis_c2h_cmpt_user_cmpt_type = NO_PLD_NO_WAIT or NO_PLD_BUT_WAIT.
  • s_axis_c2h_cmpt_ctrl_wait_pld_pkt_id = Do not increment packet count.

Zero Length Packet

The length of the data packet can be zero. On the input, the user needs to send one beat of data. The zero length packet consumes the descriptor. The QDMA will send out 1DW payload data.

The following is the setting of the zero length packet:

  • 1 beat of data
  • s_axis_c2h_ctrl_len = 0
  • s_axis_c2h_mty = 0
Note: Zero Byte packets are not supported in Internal mode and Cache bypass mode. The QDMA may hang if zero byte packets are dropped due to not available descriptor. Zero Byte Packets are supported in Simple bypass mode.

Disable Completion Packet

The user application can disable the completion for a specific packet. The QDMA provides direct memory access (DMA) to the payload, but does not write to the C2H Completion Ring. The user application only sends the data packet to the DMA, and does not send the CMPT packet.

The following is the setting of the disable completion packet:

  • s_axis_c2h_ctrl_has_cmpt = 1'b0