When the Endpoint for PCIe receives a Memory or I/O Read TLP, the TLP destination address and transaction type are compared with the values programmed in the core BARs. If the TLP passes this comparison check, the core passes the TLP to the Receive AXI4-Stream interface of the PIO design.
Along with the start of packet, end of packet, and ready handshaking signals, the Completer Requester AXI4-Stream interface also asserts the appropriate BAR ID[2:0] signal to indicate to the PIO design the specific destination BAR that matched the incoming TLP. On reception, the PIO design state machine processes the incoming Read TLP and extracts the relevant TLP information and passes it along to the internal block RAM read request controller of the PIO design.
Based on the specific BAR ID[2:0] signal asserted, the RX
state machine indicates to the internal read request controller the appropriate 2 KB
block RAM to use before asserting the read enable request. For example, if a Memory Read
32 Request TLP is received by the core targeting the default Mem32 BAR2, the core passes
the TLP to the PIO design and sets BAR ID[2:0] to 010b
. The RX state
machine extracts the lower address bits from the Memory 32 Read TLP and instructs the
internal Memory Read Request controller to start a read operation.
In this example, the setting BAR ID[2:0] to
010b
instructs the PIO memory read controller to access the Mem32
space, which by default represents 2 KB of memory space. A notable difference in
handling of memory write and read TLPs is the requirement of the receiving device to
return a Completion with Data TLP in the case of memory or I/O read request.
While the read is being processed, the PIO design RX state
machine deasserts m_axis_cq_tready
, causing the Receive AXI4-Stream interface to stall receiving any further TLPs until the
internal Memory Read controller completes the read access from the block RAM and
generates the completion. Deasserting m_axis_cq_tready
in this way is
not required for all designs using the core. The PIO design uses this method to simplify
the control logic of the RX state machine.