使用C编程来调用VHDL实现 [英] Using C programming to call VHDL implementation

查看:148
本文介绍了使用C编程来调用VHDL实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑编写一个C函数,该函数基本上将实数数组/矢量作为参数传递给VHDL实现,而VHDL代码使用FPGA中的数组进行一些计算并将结果返回给C功能.所以,我的问题-我该如何编写一个C函数来调用VHDL实现?谁能在正确的方向上指导我,例如教程,API或其他任何东西?

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! :)

推荐答案

VHDL不会导致运行时例程,而是变成硬件中的实际实现.为了能够通过VHDL例程与CPU中的高级语言进行通信,必须将CPU和VHDL模块连接起来,并且VHDL代码必须具有适当的含义以提供来自CPU的数据.

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.

在您的情况下,有两种方法,一种是VHDL是通过CPU和FPGA逻辑都可以访问共享数据的方式实现的,在这种情况下,您需要知道该地址是什么.另一种方法是,如果VHDL通过串行端口,USB或以太网将数据提供给CPU,但是在两种情况下,VHDL例程都必须支持这一点.

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.

在任何情况下,您都需要了解更多有关FPGA的知识,而不仅仅是进行过程调用.

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

本文可能会帮助您了解谁能正常工作(也可能不是正确的FPGA,但无论如何还是有帮助的.)

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

如何将FPGA连接到微控制器

这篇关于使用C编程来调用VHDL实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆