Author Topic: FPGA EEVBlog segments / Xilinx buyer's remorse  (Read 21073 times)

0 Members and 1 Guest are viewing this topic.

Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 798
  • Country: lt
Re: FPGA EEVBlog segments / Xilinx buyer's remorse
« Reply #50 on: May 23, 2014, 08:01:42 am »
Actually, an Ethernet stack on an FPGA is not that bad of an idea. I implemented a UDP/IP stack in verilog in about a week that can run at 1G line rate, and it is very useful for getting data into and out of an FPGA. The only annoying part was the dang UDP checksum in the header, necessitating some FIFOs.

You can write 0x0000 there (or 0xFFFF - I don't remember) and this will pass as a valid checksum. It's specified in RFC standards and some of the devices doesn't generate the checksum at all.
 

Offline legacy

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: FPGA EEVBlog segments / Xilinx buyer's remorse
« Reply #51 on: May 23, 2014, 08:11:16 am »
@miguelvp
understood, thank you  :-+
 

Offline alex.forencich

  • Frequent Contributor
  • **
  • Posts: 397
  • Country: us
    • Alex Forencich
Re: FPGA EEVBlog segments / Xilinx buyer's remorse
« Reply #52 on: May 23, 2014, 08:25:37 am »
Actually, an Ethernet stack on an FPGA is not that bad of an idea. I implemented a UDP/IP stack in verilog in about a week that can run at 1G line rate, and it is very useful for getting data into and out of an FPGA. The only annoying part was the dang UDP checksum in the header, necessitating some FIFOs.

You can write 0x0000 there (or 0xFFFF - I don't remember) and this will pass as a valid checksum. It's specified in RFC standards and some of the devices doesn't generate the checksum at all.

All zeros is also an option, yes.  I had to calculate the length anyway, which is also in the header, so I figured I might as well implement the checksum as well.  The module I have will accept a framed data input of indeterminate length on an AXI stream bus (series of bytes with a tlast signal indicating the end of the frame), add a UDP header with the specified ports, fill in the length and checksum as computed from the data, and then send the result to the next module on another AXI stream interface.  The only trick is that the data neds to be stored in a FIFO while the length and checksum are calculated, then the header can be attached via a second parallel header FIFO and the packet sent on its merry way. 
Python-based instrument control: Python IVI, Python VXI-11, Python USBTMC
 

Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 798
  • Country: lt
Re: FPGA EEVBlog segments / Xilinx buyer's remorse
« Reply #53 on: May 23, 2014, 09:57:37 am »
Actually, an Ethernet stack on an FPGA is not that bad of an idea. I implemented a UDP/IP stack in verilog in about a week that can run at 1G line rate, and it is very useful for getting data into and out of an FPGA. The only annoying part was the dang UDP checksum in the header, necessitating some FIFOs.

You can write 0x0000 there (or 0xFFFF - I don't remember) and this will pass as a valid checksum. It's specified in RFC standards and some of the devices doesn't generate the checksum at all.

All zeros is also an option, yes.  I had to calculate the length anyway, which is also in the header, so I figured I might as well implement the checksum as well.  The module I have will accept a framed data input of indeterminate length on an AXI stream bus (series of bytes with a tlast signal indicating the end of the frame), add a UDP header with the specified ports, fill in the length and checksum as computed from the data, and then send the result to the next module on another AXI stream interface.  The only trick is that the data neds to be stored in a FIFO while the length and checksum are calculated, then the header can be attached via a second parallel header FIFO and the packet sent on its merry way.

I did that on UDP reception using Altera :)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf