Jump to content
  • 0

Ethernet Communications in an FPGA


Luke Abela

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

Link to comment
Share on other sites

5 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

Link to comment
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

Link to comment
Share on other sites

  • 0

@cwerner77 @Dan I am having the same trouble, I have set up the echo server on microblaze successfully was able to echo back the data sent. But my work requires meto parse ethernet frames for ethernet headers,ip headers, tcp headers and finally payload. I have no idea how to go about it.Any help would be greatly appreciated.

Link to comment
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
×
×
  • Create New...