Altera_Forum
Honored Contributor
7 years agoArria 10 PCIe Avalon-MM DMA Reference Design: Read/Write Timeout
Hi guys,
I tried searching through the forum for this and found some posts on it but no solution to the issue. I am currently in possession of a Nallatech 385a PCIe card with an Arria 10 on it. I am running this on CentOS 7 and using Quartus Prime version 17.1. What I've done with the Avalon-MM DMA reference design ( https://www.altera.com/en_us/pdfs/literature/an/an690.pdf ) is change the device and the pin assignments. The reference design archive package I am using is "hip_a10gx_g3_x8_avmm_dma256_1602_PS.qar". I am able to generate the HDL, fully compile, and program the .jic file into flash and restart the PC so the design saves and re-enumerates the PCIe bus properly. I am also able to make the test throughput code, install the driver, and run the program. However, the read/write test is timing out. I am able to see the device in lspci and output its details. Attached are screenshots of Quartus and the terminal output is below. Any and all help is greatly appreciated!
$ cd Downloads/
$ cd avmm_dma_linux/
$ su
Password:
# make
make -C /lib/modules/3.10.0-862.2.3.el7.x86_64/build M=/home/arclab/Downloads/avmm_dma_linux
make: Entering directory `/usr/src/kernels/3.10.0-862.2.3.el7.x86_64'
Building modules, stage 2.
MODPOST 1 modules
make: Leaving directory `/usr/src/kernels/3.10.0-862.2.3.el7.x86_64'
# ./install
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions *.symvers *.order
make -C /lib/modules/3.10.0-862.2.3.el7.x86_64/build M=/home/arclab/Downloads/avmm_dma_linux
make: Entering directory `/usr/src/kernels/3.10.0-862.2.3.el7.x86_64'
LD /home/arclab/Downloads/avmm_dma_linux/built-in.o
CC /home/arclab/Downloads/avmm_dma_linux/altera_dma.o
/home/arclab/Downloads/avmm_dma_linux/altera_dma.c: In function ‘init_rp_mem’:
/home/arclab/Downloads/avmm_dma_linux/altera_dma.c:272:9: warning: unused variable ‘increment_value’
u32 increment_value = 0;
^
/home/arclab/Downloads/avmm_dma_linux/altera_dma.c: In function ‘rp_ep_compare’:
/home/arclab/Downloads/avmm_dma_linux/altera_dma.c:287:9: warning: unused variable ‘count’
u32 count = 1;
^
/home/arclab/Downloads/avmm_dma_linux/altera_dma.c:286:12: warning: unused variable ‘rp_tmp’
u32 j, rp_tmp, ep_tmp;
^
/home/arclab/Downloads/avmm_dma_linux/altera_dma.c: In function ‘dma_test’:
/home/arclab/Downloads/avmm_dma_linux/altera_dma.c:362:13: warning: unused variable ‘ep_tmp’
u32 rp_tmp, ep_tmp;
^
/home/arclab/Downloads/avmm_dma_linux/altera_dma.c:362:5: warning: unused variable ‘rp_tmp’
u32 rp_tmp, ep_tmp;
^
/home/arclab/Downloads/avmm_dma_linux/altera_dma.c:361:12: warning: unused variable ‘j’
int i, j;
^
/home/arclab/Downloads/avmm_dma_linux/altera_dma.c:360:63: warning: unused variable ‘simul_write_count’
int loop_count = 0, num_loop_count = 1, simul_read_count, simul_write_count;
^
/home/arclab/Downloads/avmm_dma_linux/altera_dma.c:360:45: warning: unused variable ‘simul_read_count’
int loop_count = 0, num_loop_count = 1, simul_read_count, simul_write_count;
^
/home/arclab/Downloads/avmm_dma_linux/altera_dma.c:360:25: warning: unused variable ‘num_loop_count’
int loop_count = 0, num_loop_count = 1, simul_read_count, simul_write_count;
^
/home/arclab/Downloads/avmm_dma_linux/altera_dma.c:360:9: warning: unused variable ‘loop_count’
int loop_count = 0, num_loop_count = 1, simul_read_count, simul_write_count;
^
In file included from /home/arclab/Downloads/avmm_dma_linux/altera_dma.c:15:0:
/home/arclab/Downloads/avmm_dma_linux/altera_dma.c: At top level:
/home/arclab/Downloads/avmm_dma_linux/altera_dma.h:171:12: warning: ‘rp_compare’ declared ‘static’ but never defined
static int rp_compare(u8 *virt_addr1, u8 *virt_addr2, u32 num_dwords);
^
/home/arclab/Downloads/avmm_dma_linux/altera_dma.c: In function ‘rp_ep_compare.isra.5’:
/home/arclab/Downloads/avmm_dma_linux/altera_dma.c:313:14: warning: ‘ep_tmp’ may be used uninitialized in this function
printk(KERN_DEBUG "ep_tmp = %08x\n", ep_tmp);
^
Building modules, stage 2.
MODPOST 1 modules
CC /home/arclab/Downloads/avmm_dma_linux/altera_dma.mod.o
LD /home/arclab/Downloads/avmm_dma_linux/altera_dma.ko
make: Leaving directory `/usr/src/kernels/3.10.0-862.2.3.el7.x86_64'
#
**********************************************
** ALTERA AVMM DMA driver **
** version 2.02 **
** 1) start DMA **
** 2) enable/disable read dma **
** 3) enable/disable write dma **
** 4) enable/disable simul dma **
** 5) set num dwords (256 - 2048) **
** 6) set num descriptors (1 - 128) **
** 8) loop dma **
** 10) exit **
**********************************************
Run Read ? 1
Run Write ? 1
Run Simultaneous ? 1
Read Passed ? 0
Write Passed ? 0
Simultaneous Passed ? 0
Read EPLast timeout ? 1
Write EPLast timeout ? 1
Number of Dwords/Desc : 512
Number of Descriptors : 128
Length of transfer : 256 KB
Rootport address offset : 0
Read Time : 0 s and 249767 us
Read Throughput : 0.000978 GB/S
Write Time : 0 s and 216415 us
Write Throughput : 0.001128 GB/S
Simultaneous Time : 0 s and 270368 us
Simultaneous Throughput : 0.001807 GB/S#
$ sudo lspci -s 01:00.0 -vvv
password for arclab:
01:00.0 Non-VGA unclassified device: Altera Corporation Device e003 (rev 01)
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 33
Region 0: Memory at f0120000 (64-bit, prefetchable)
Region 4: Memory at f0100000 (64-bit, prefetchable)
Capabilities: MSI: Enable+ Count=1/4 Maskable- 64bit+
Address: 00000000fee003d8 Data: 0000
Capabilities: Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
Capabilities: Express (v2) Endpoint, MSI 00
DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 75.000W
DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop+
MaxPayload 256 bytes, MaxReadReq 512 bytes
DevSta: CorrErr+ UncorrErr- FatalErr- UnsuppReq+ AuxPwr- TransPend-
LnkCap: Port# 1, Speed 8GT/s, Width x8, ASPM not supported, Exit Latency L0s <4us, L1 <1us
ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp+
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 8GT/s, Width x8, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
DevCap2: Completion Timeout: Not Supported, TimeoutDis+, LTR-, OBFF Not Supported
DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF Disabled
LnkCtl2: Target Link Speed: 8GT/s, EnterCompliance- SpeedDis-
Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
Compliance De-emphasis: -6dB
LnkSta2: Current De-emphasis Level: -3.5dB, EqualizationComplete+, EqualizationPhase1+
EqualizationPhase2+, EqualizationPhase3+, LinkEqualizationRequest-
Capabilities: Virtual Channel
Caps: LPEVC=0 RefClk=100ns PATEntryBits=1
Arb: Fixed- WRR32- WRR64- WRR128-
Ctrl: ArbSelect=Fixed
Status: InProgress-
VC0: Caps: PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
Arb: Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
Ctrl: Enable+ ID=0 ArbSelect=Fixed TC/VC=01
Status: NegoPending- InProgress-
Capabilities: Vendor Specific Information: ID=1172 Rev=0 Len=044 <?>
Capabilities: # 19
Capabilities: Advanced Error Reporting
UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
CEMsk: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
AERCap: First Error Pointer: 00, GenCap- CGenEn- ChkCap- ChkEn-
Kernel driver in use: Altera DMA
$
$ ls /dev/ -l
total 0
crw-rw-rw-. 1 root root 243, 0 May 16 19:16 altera_dma