Forum Discussion
Issues when testing DMA feature provided by Avalon MM+ IP with S10 GX dev kit card on Ubuntu 18.04
- 4 years ago
The problem you seen might related to below KBD
Why does the Intel® Stratix® 10 Avalon®-MM Interface for PCIe* with DMA example design fail the link test and the DMA test when using the default selected BAR0?DescriptionWhen the internal DMA Descriptor Controller is enabled, the BAR0 Avalon®-MM master is not available for general-purpose usage. The DMA Descriptor Controller uses this BAR0 interface through which the host CPU programs in the descriptor table.
The intel_fpga_pcie_link_test user application selects BAR0 as default when it's initially executed. If the user forgets to change to BAR2, which is where the onchip memory is attached, then both the link test and the DMA test will fail.
ResolutionThe user must change to BAR2 before executing the link test and the DMA test.
See the execution transcript of the intel_fpga_pcie_link_test user application below for how to change to BAR2.
~$ sudo ./intel_fpga_pcie_link_test
*********************************************************
Intel FPGA PCIe Link Test
Version 2.0
0: Automatically select a device
1: Manually select a device
*********************************************************
> 0
Opened a handle to BAR 0 of a device with BDF 0x1300
*********************************************************
0: Link test - 100 writes and reads
1: Write memory space
2: Read memory space
3: Write configuration space
4: Read configuration space
5: Change BAR
6: Change device
7: Enable SRIOV
8: Do a link test for every enabled virtual function
belonging to the current device
9: Perform DMA
10: Quit program
*********************************************************
> 5
Changing BAR...
Enter BAR number (-1 for none):
> 2
Successfully changed BAR!
The issue is for both '0: Link test - 100 writes and reads" and "9: Perform DMA".
When the card works well, choose '0: Link test - 100 writes and reads" and get the result like this.
Doing 100 writes and 100 reads.. Number of write errors: 0 Number of read errors: 0 Number of dword mismatches: 0
Choose "9: Perform DMA" and get,
********************************************************* Current DMA configurations Run Read (card->system) ? 1 Run Write (system->card) ? 1 Run Simultaneous ? 1 Number of dwords/desc : 2048 Number of descriptors : 128 Total length of transfer : 1e+03 KiB ********************************************************* 0: Run DMA 1: Toggle read DMA 2: Toggle write DMA 3: Toggle simultaneous DMA 4: Set the number of dwords per descriptor 5: Set the number of descriptors per DMA 6: Return to main menu *********************************************************
then "0 : Run DMA",
Enter the number of DMA operations to initiate; enter 0 for infinite loop:
Enter "2" and then get the result.
********************************************************* Current DMA configurations Run Read (card->system) ? 1 Run Write (system->card) ? 1 Run Simultaneous ? 1 Number of dwords/desc : 2048 Number of descriptors : 128 Total length of transfer : 1e+03 KiB Current run #: 2 Current time : Wed Mar 23 13:49:54 2022 DMA throughputs, in GB/s (10^9B/s) Current Read Throughput : 0.01 Average Read Throughput : 0.01 Current Write Throughput : 0.01 Average Write Throughput : 0.01 Current Simul Throughput : 0.01 Average Simul Throughput : 0.01 *********************************************************
When the USB blaster II disconnected issue happens, both could not work.
'0: Link test - 100 writes and reads" :
Number of write errors: 0 Number of read errors: 0 Number of dword mismatches: 100
"9: Perform DMA" :
Current run #: 1 Current time : Wed Mar 23 13:53:10 2022 DMA throughputs, in GB/s (10^9B/s) Current Read Throughput : 0.00 Average Read Throughput : inf Current Write Throughput : 0.00 Average Write Throughput : inf Current Simul Throughput : 0.00 Average Simul Throughput : inf ********************************************************* Stopping DMA run due to error..
Meanwhile I notice that when the USB blaster II works, run the command
$ lsusb
and we can find the FPGA card.
lsusb : Bus 001 Device 002: ID 09fb:6810 Altera
when USB blaster II is disconnected, it disappears.
I see, when USB blaster II is connected, both tests passing ('0: Link test - 100 writes and reads" and "9: Perform DMA")
When USB blaster II disconnected, definitely the result will show as failed since the connection has loss.
Can you identify under what condition the USB blaster II start loss its connection? While at the middle of performing the '9: Perform DMA"? Or when both test #0 and test#9 completed and you repeat another round of test?
- He4Forum4 years ago
Occasional Contributor
The issue usually happens when both test #0 and test#9 have completed and I'm going to repeat another round of test.
And it seems if I don't kill the testing application task and make it keep running, this issue won't happen.
Meanwhile, seems only after I kill current running test application and launch a new one, USB blaster II will be disconnected. And usually, I only could run the test successfully for 1 or 2 times, then the DMA could not work.
- He4Forum4 years ago
Occasional Contributor
What's more, when I run the command,
$ dmesg | grep usbI find there is one item shows like this.
[ 556.832823] usb 1-8: USB disconnect, device number 2The device does disconnect via USB. Don't know why this happens.
- He4Forum4 years ago
Occasional Contributor
I find that at the middle of performing the '9: Perform DMA", it will happen too. I try to set the loop number to 1000 and when it's running at the 52th loop, the issue happens.