• 0
Luke Abela

Ethernet Communications in an FPGA

Question

Good day,

I am currently working on a system which requires ethernet control on an FPGA. To this extent I have successfully managed to implement the echo server as per Xilinx`s tutorial. However, I now require to transmit data from my laptop to the FPGA. I am unsure of how to amend this project in its current state to receive data from an external program (such as matlab) and from where to verify the data I have received is correct. Could anyone kindly provide some insight? Regards

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hello Luke,

basically you have to design some sort of communication protocol for your specific application and integrate that into the networking stacks of your systems.

For example, if you want to transfer a matrix A from your Matlab host to your FPGA board, do some calculations there resulting in a new matrix B, and transfer matrix B back to your Matlab host, do the following:

Maybe it is a good idea to implement your server code also on your PC first, because this is easier to debug. For example, you could can start with a Matlab-to-Matlab TCP/IP connection, then go over to Matlab-to-"C-Programm on your PC" TCP/IP connection and finally, you can run your well-tested C server code on your FPGA board.

The TCP implementations of your operating system, respectively the lwIP-Stack of your FPGA-Board, will automatically care for a reliable network connection: TCP is a protocol, that allows you to establish a connection from a client to a server, and then exchange a bidirectional byte stream. TCP will automatically care for the completeness as well as the correct order of the transferred data (using acknowledgements).  It will also ensure the integrity of the transferred data (using checksums) and provides congestion control. These mechanisms protect your communication against lost or corrupted data on the network; lost or corrupted data will be resent automatically. However, these features do not protect your communication against man-in-the-middle attacks or similar. If you need that, you have to implement additional protocol layers like TLS: https://en.wikipedia.org/wiki/Transport_Layer_Security

If your project does not need all those fancy TCP features, you should have a look at UDP: https://en.wikipedia.org/wiki/User_Datagram_Protocol.

Best regards,

Christian

Share this post


Link to post
Share on other sites
  • 0

@Luke Abela,

I recently had the opportunity to write a data processing application that used an FPGA as an "accelerator".  Sadly, it probably slowed down processing, but the infrastructure is something you are more than welcome to examine and work with if you would like.  Data was sent to the FPGA using UDP packets over ethernet, read on the FPGA, assembled into larger packets for an FFT engine, processed, and then returned.

Dan

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now