Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

Communicating with PCIe card

Altera_Forum
Honored Contributor II
781 Views

Hi, 

 

I have an image loaded on a Stratix V FPGA which includes a PCIe core and DDR3 controller as an end point. The FPGA is of course on a PCIe card. 

I would like to write a C program which runs on the host Linux PC and writes data to the card over PCIe. The idea is to have a program write data to the on-board DDR3 RAM.  

 

What is the best way to do this? Are there any libraries provided to communicate with a PCIe device? Thanks in advance.
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
94 Views

There are lots of examples lurking. 

Linux has a /dev entry for each BAR of every PCI slave, so it is as simple as identifying the correct entry, opening the device, and using read(), write() or mmap(). 

These transfers will be relatively slow because each memory access will be a separate PCIe transfer and they take a long time. 

Fine for program load and debug, not really any use for transferring 'real' data.
Altera_Forum
Honored Contributor II
94 Views

Hi, 

 

Just search for "Quartus PCIe DMA reference designs". 

 

One of the reference designs that pops up is this: 

http://www.altera.com/support/refdesigns/ip/interface/ref-pciexpress-avalonmm-hp.html 

 

There is a section that explains how to access the devices from Linux. 

 

Thanks, 

Evgeni
Reply