Altera_Forum
Honored Contributor
15 years agoSIV PCIe high performance ref design data can arrive out of order
Hi,
We've been using the Stratix IV PCIe high-performance reference design for a while and see some funny behavior when performing a read DMA: the data arrives into our logic out of order intermittently. Let me set the scene - we want to transfer a 4kB block of data from the RC's memory to our logic using the read DMA functionality in the CDMA reference design - for simplicity, assume our logic is just like the end point memory instantiated in the reference design, except it is 128-bit wide to match the datapath used for the x8, gen2 variant we're using. We set up the read descriptor table to transfer a single 4kB block of data from RC to EP. The CDMA/PCIe block splits the 4kB block of data into many 512Byte payloads, which I'll label P1, P2, P3, etc, where P1 has the first 512 bytes of the 4kB block, P2 has the next 512 bytes, etc. Most of the time the data arrives at the EP memory in exactly the order it is in the RC's memory, but sometimes we see that the first 48 bytes from P2 and P3 appear in P1! In terms of memory addresses, we would expect to see the EP memory addresses to appear in the following order as data is written to the EP memory: 0, 16, 32, 48, 64, 80, 96, 112, 126, 144, 160, 176, 192, etc But sometimes we see: 0, 16, 32, 48, 512, 528, 544, 1024, 1040, 1056, 64, 80, 96, etc where 512, 528, 544, are addresses associated with payload P2, and addresses 1024, 1040, 1056 are associated with payload P3. Note that the 48-byte chunks are effectively cut-and-pasted from where they should appear into P1 i.e. they don't reappear again later. It's like entries in the PCIe/CDMA rx-buffer have been re-ordered. We see this occurring about 10% of the time. All of the data arrives ok and gets written to the correct EP memory address, but order is important to us as we actually want to write the data to a fifo rather than a memory. Note also that this behavior is only seen in actual hardware - it doesn't occur in the reference design functional simulation. Has anybody else seen this behavior? If anyone can shed any light on this I would greatly appreciate it!