FPGA和PC以太网连接

FPGA and PC ethernet connection

我想将fpga板的以太网直接连接到PC的以太网,并进行双向数据传输。我对如何设置感到困惑。

  • Should I use Raw ethernet frames between FPGA and PC? But I could not find any windows application to send/capture raw frames. Can I do this in linux or something?
  • What would be the IP addresses and MAC addresses of PC and FPGA board in such a direct connection? How to find it? As there is no LAN or something involved here, I don't know how IP addresses get assigned to them.
  • Should I use TCP/IP or UDP in direct connection instead of raw frames? It seems to complicate FPGA side. I am not sure.
  • Is it better to have FPGA board and PC on same LAN, instead of direct connection. Again can I use raw frames or should I go for TCP/IP or UDP?
  • Is it necessary to implement ARP on FPGA, if I go for TCP/IP or UDP?

简答:

最好选择网络层协议而不是原始帧。我认为最好的方法是UDP。与 TCP/IP 相比,它具有简单 header 和更少的复杂性。它广泛用于 FPGA 和主机 PC 之间的通信。示例可在互联网上找到。将FPGA连接到与PC相同的网络,这样DHCP服务器就会为FPGA分配一个IP地址。如果您知道 FPGA 板的 MAC 地址,则不需要 ARP。通常它写在板子上。还有一个例子:在 Xilinx 中,我们可以在代码本身中配置 MAC。只要网络中没有其他设备使用相同的 MAC,它就是安全的。