Forum Discussion
Altera_Forum
Honored Contributor
14 years agoYou'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!)