What is a good interface for a Linux device driver for a co-processing peripheral

馋奶兔 提交于 2019-12-04 15:51:06

My team has been working on this sort of thing for a couple of years. To enable the lowest latency between the CPU and the programmable logic, we memory map the hardware into the application process so that it can directly communicate with the hardware. This eliminates the OS overhead after the initial connection.

Still, we find that CPU -> accelerator and back is at least 1 microsecond. This leads us to offload bigger chunks of work or use this path to configure data acquisition operations that write results directly to the system DRAM.

Depending on the mix of work, there are a variety of ways you can arrange for the accelerator to be shared.

  1. You can have a mutex protecting the hardware, so that each process using it has exclusive access.

  2. You can have a daemon with exclusive access, and have it multiplex requests and demultiplex responses.

  3. Your accelerator can provide multiple independent ports that can be used simultaneously by different processes. You need a way to assign the ports to processes and to reclaim them afterward.

If your accelerator has request and response queues, they can be accessed either by programmed IO (memory map hardware registers) or by shared memory queues in system DRAM (and DMA to/from the programmable logic).

See our FPGA 2015 paper for some more discussion of these approaches: http://www.connectal.org/connectal-fpga2015.pdf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!