In Ethernet module , why do we need FIFO block before the mac layer ? Can we bypass it ? Thanx in advance


The FIFO reduces the number of interrupts the attached processor has to service. In theory you could bypass it, but if you do so, the microprocessor will typically waste a lot of time on the overhead of interrupt servicing.

For a quick analogy, let's assume you were asked to move 40 gallons of water 20 miles. The FIFO is roughly equivalent to a truck with a 20 gallon water tank, so you make only two trips to get all the water to the destination. Without the FIFO, you can only carry one water bottle at a time, so you'd have to make around 500 trips back and forth instead.

  • \$\begingroup\$ Your analogy is pretty good but does lack an important detail. Another part of the FIFO idea is that trip to carry the 1 gallon jugs may take a longer time than the rate that the gallons of water are required at the destination. It is also a more efficient to load up a 20 gallon tank in one go instead of having to fill a set of individual 1 gallon jugs. Back to the software world the FIFO can be loaded in full (or in part) more efficiently if a block is loaded at one go. The FIFO also also has delivers the data to the destination at the rate needed. \$\endgroup\$ – Michael Karas Nov 7 '14 at 18:48
  • \$\begingroup\$ Am making a processor on FPGA which processes incoming packets.The example design given by Xilinx has FIFO block. The FIFO block is delaying the incoming packets. Can I drop the FIFO module and speed ma design ? \$\endgroup\$ – Nijil Kadavathu Valapil Nov 7 '14 at 19:48
  • \$\begingroup\$ @NijilKadavathuValapil: removing the FIFO will reduce latency, but (at least usually) at the expense of substantially increasing processor overhead. \$\endgroup\$ – Jerry Coffin Nov 7 '14 at 19:49
  • \$\begingroup\$ My Ethernet speed is 1Gbps and ma system clock is 125 MHz.So system is getting one byte in one clock cycle.Do I still need a FIFO ? .I am confused. \$\endgroup\$ – Nijil Kadavathu Valapil Nov 7 '14 at 19:59
  • \$\begingroup\$ @NijilKadavathuValapil - think about what processor instructions are required to transfer a byte from the MAC to memory, plus the instructions for running that in a loop, and then compute how many processor cycles those instructions require. I'll give really good odds that is much more than 1 cycle! Also, if you miss even once (maybe you need to service an interrupt), you have an overrun and will lose bytes! \$\endgroup\$ – DoxyLover Nov 7 '14 at 20:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.