Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20703 Discussions

communication from an FPGA to a computer through PCIE

Altera_Forum
Honored Contributor II
1,911 Views

Hello all, 

 

 

I apologize if this is the wrong place to post this question I am new to the forums.  

 

 

 

I have Cyclone IV GX FPGA Development Kit Board. I need your guidance to start my final year project. I would like to connect a camera to the FPGA then stream the data to my computer (Linux) through PCIE. Also, I have to develop a GUI under Linux to display video and to access to registers. 

 

 

My current status is that I know c++/c programming, Linux but have no idea of PCIE protocole and FPGA. 

 

 

So my question is if there are some PCIE libraries under Linux and if it is needed to develop a driver to access to the FPGA. 

 

 

Thanks in advance 

 

Mag
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
929 Views

You'll need to write a linux device driver to access the fpga as a PCIe slave. 

Most of that code is generic linux driver code, PCIe appears very similar to PCI to linux device drivers. 

 

Although PCIe looks logically like PCI, in fact it is a comms protocol using hdlc frames to send requests and responses. 

 

However doing single-cycle transfers over PCIe is very, very, very slow. You'll need to use PCIe transfers that copy (something like) 128 bytes each. That means they have to be initiated by a DMA engine that is adequately coupled with the PCIe master interface. 

 

You can request the data transfers from either end, but getting the fpga to initiate PCIe transfers is a lot harder than just getting it to respond. 

 

Getting the linux system to perform DMA may also not be easy. 

I had to write the linux driver code for the PCIe DMA on the ppc 83xx cpu we use. (Actually that did mean I could write the interface I needed!)
0 Kudos
Reply