XS-2 RGMII Ethernet MAC library question Topic is solved

New to XMOS and XCore? Get started here.
Post Reply
y0lo
Member
Posts: 12
Joined: Tue Sep 08, 2015 8:47 am

XS-2 RGMII Ethernet MAC library question

Post by y0lo »

Hi fellows,

I'm trying to understand how does the RGMII receiver work?
Actually, for what there are used two "rgmii_rx_lld" threads with "first/second" state and "ping-pong" channel?

Is it necessary only to fast resume the receiving (and don't spend time for checking packet and saving params)?

Or there are other reasons?

Best regards,
Y0lo


View Solution
peter
XCore Addict
Posts: 230
Joined: Wed Mar 10, 2010 12:46 pm

Post by peter »

Hi y0lo,

The reason for having two threads is so that the hard real-time requirements of the interpacket timing of ethernet are met. For RGMII the interpacket gap is 96ns, which when you are running at 62.5MIPS is only 6 instructions to be ready to receive the following packet. It just isn't possible to complete the CRC check, pass off the packet received and set up all the required state to receive the next packet in 6 instructions.

So instead, there are two threads which take it in turns receiving the packets. There are careful constraints that have to be met to ensure correct ownership of the ports, etc, and meet the timing so there is probably a reason for the position of every instruction in that code.

Regards,

Peter
y0lo
Member
Posts: 12
Joined: Tue Sep 08, 2015 8:47 am

Post by y0lo »

Peter,

Clear.
Thank you very much for the quick response!

Best regards,
Y0lo
Post Reply