Using C programming to call VHDL implementation

*爱你&永不变心* 提交于 2019-12-24 03:45:05

问题


I'm thinking about writing a C function which basically passes an array/vector of real numbers to a VHDL implementation as an argument and the VHDL code does some computation using the array in a FPGA and returns the result back to the C function. So, my question - How do I go about writing a C function to call the VHDL implementation? Can anyone guide me in the right direction like a tutorial,API or anything?

Any help will be appreciated. Thanks! :)


回答1:


VHDL does not result in a run time routine, it turns into an actual implementation in HW. To be able to communicate with a VHDL routine to/from a high level lalnguage in a CPU, the CPU and the VHDL module must be connected and the VHDL code must have proper mean to provide data from the CPU.

In your case, there are 2 ways, one is that the VHDL is implemented in a way that the shared data can be accessed by both the CPU and the FPGA logic, in that case, you need to know what that address is. The other way is if the VHDL is providing data via serial port, or USB or ethernet to the CPU, but in both cases, this must be supported by the VHDL routine.

In any case, you need to know a lot more about the FPGA than just making a procedure call.

This article might help you a bit to understand who things works (might not be the right FPGA either, but probably helps anyway).

How to interface FPGAs to microcontrollers



来源:https://stackoverflow.com/questions/30926630/using-c-programming-to-call-vhdl-implementation

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