»ùÓÚFPGAµÄǧÕ×ÒÔÌ«ÍøÉè¼Æ - ͼÎÄ

·¢²¼Ê±¼ä : ÐÇÆÚÒ» ÎÄÕ»ùÓÚFPGAµÄǧÕ×ÒÔÌ«ÍøÉè¼Æ - ͼÎĸüÐÂÍê±Ï¿ªÊ¼ÔĶÁ

Õª Òª

Õª Òª

Ëæ×ÅÐÅÏ¢¼¼ÊõµÄ¿ìËÙ·¢Õ¹£¬ÒÔÌ«ÍøǶÈëʽÉ豸µÄÓ¦ÓÃÔ½À´Ô½¹ã·º¡£ÎªÁËÈÃÒÔÌ«Íø¸÷É豸֮¼äÄܹ«Æ½ÓÐЧµØ¹²ÏíͨÐÅý½é£¬¶ÔÒÔÌ«ÍøMAC²ãÊý¾Ý´¦ÀíϵͳµÄÑо¿ÏÔµÃÓÈΪÖØÒª¡£

Ϊ´Ë£¬±¾ÎÄÊ×ÏÈ·ÖÎöÁËÒÔÌ«Íø¼°ÆäÏà¹ØЭÒéµÄ»ù±¾ÄÚº­£¬½âÆÊÁËÒÔÌ«ÍøMAC²ãͨÐÅ»úÖÆ¡¢Ö¡µÄÌØÐÔÓë¸ñʽ¡¢PHY½Ó¿ÚЭÒé¡¢ARPЭÒéÒÔ¼°I2CЭÒ顣ͬʱͨ¹ý¶ÔFPGAоƬµÄÁ˽⣬ȷ¶¨ÁË»ùÓÚ88E1111оƬºÍXC3S400FPGAоƬÏà½áºÏµÄϵͳÉè¼Æ·½°¸£¬Ö§³Ö1000Base-T±ê×¼ÒÔÌ«ÍøµÄ½ÓÈ룬Íê³ÉÁËϵͳµÄÓ²¼þµç·Éè¼Æ¡£ÏµÍ³Éè¼ÆÖУ¬88E1111Íê³ÉPHY²ãÊý¾ÝµÄ´¦Àí£¬FPGAÔòÍê³ÉMAC²ãÊý¾ÝµÄ´¦Àí£¬Ö÷Òª°üº¬½ÓÊÕMACÊý¾ÝÖ¡µÄУÑéºÍ½â·â¡¢´ý·¢ËÍÊý¾ÝÖ¡µÄ·â×°¡¢MACµØÖ·Â˲¨¡¢IPÊý¾Ý°üµÄÌáÈ¡¡¢ARPµØÖ·Ó³ÉäµÈ£¬ÊÇϵͳµÄºËÐÄ¡£ÔÚFPGAÉè¼ÆÖУ¬×ñÑ­×ÔÉ϶øϵÄÉè¼Æ˼Ï룬¶Ô¶¥²ãÄ£¿éÒÔ¼°PHY½Ó¿Ú¡¢MACºËÐÄ´¦Àí¡¢Óû§ÅäÖá¢Óû§Êý¾Ý¸÷¹¦ÄÜ×ÓÄ£¿éÒÀ´Î½øÐÐÉè¼Æ¡£

¹Ø¼ü´Ê£ºÒÔÌ«Íø MAC²ã FPGA

ABSTRACT

ABSTRACT

With the rapid development of IT,the embedded devices of accessing to Ethernet are used more and more widely.In order to make each device enjoy a fair and effective shared communications medium, it is particularly important to research the data processing system of the Ethernet MAC layer.

To this end,it is firstly done to analyze the basic connotation of Ethernet and the related agreements,and to dissect the communication mechanisms of the Ethernet MAC layer,the characteristics and format of the frame,the PHY interface protocol,the ARP protocol,I2C protocol in the paper.According to the characteristics and working principle of the FPGA chip ,the system design, which supports the accessing of the 1000Base-T Ethernet,is determined based on the combination of the 88E1111 PHY chip and XC3S400-4fg456C FPGA chip of Xilinx.Then the hardware circuit design is accomplished by the Cadence development tool.In this system, 88E1111 and FPGA respectively completes the data processing of PHY layer and the data processing of the MAC layer,which mainly consists of the calibration and dearchive of the receiving data frames, the encapsulation of the data frames,the MAC address filtering, the extraction of the IP packet,The ARP address mapping,and so on. So FPGA is the core of the system. Following the top-down design conception,the design of FPGA successively includes the top-level module,and the submodule of the PHY interface,the MAC core processing,the user configuration,the user data interface.

Keywords: Ethernet the MAC layer FPGA

Ŀ ¼ i

Ŀ ¼

µÚÒ»Õ Ð÷ÂÛ ........................................................................................................ 1

1.1Ñо¿±³¾°¼°ÒâÒå ..................................................................................... 1 1.2¹úÄÚÍâÑо¿ÏÖ×´ ..................................................................................... 2 1.3ÂÛÎÄÄÚÈݺÍÂÛÎÄ×éÖ¯½á¹¹°²ÅÅ ............................................................. 3 µÚ¶þÕ ǧÕ×ÒÔÌ«ÍøÀíÂÛ»ù´¡ ............................................................................ 5

2.1ǧÕ×ÒÔÌ«Íø±ê×¼ ..................................................................................... 5 2.2½éÖÊ·ÃÎÊ¿ØÖÆ£¨MAC£© ........................................................................ 7

2.2.1°ëË«¹¤MAC .............................................................................. 7 2.2.2È«Ë«¹¤MAC .............................................................................. 9 2.3½éÖÊÎ޹ؽӿڣ¨MII£© ......................................................................... 10

2.3.1GMII½Ó¿ÚÐźŶ¨Òå ................................................................. 11 2.3.2GMII½Ó¿ÚʱÐòÌØÐÔ ................................................................. 14 2.3.3GMIIµÄ¹ÜÀíMDIO½Ó¿Ú ......................................................... 15 2.4ÎïÀí²ã¼¼Êõ ........................................................................................... 17 2.5TCP/IPЭÒéÕ» ....................................................................................... 18 µÚÈýÕ ÒÔÌ«ÍøÊý¾Ý´«ÊäÓ²¼þÉè¼ÆʵÏÖ .......................................................... 21

3.1ϵͳ·½°¸Éè¼Æ ....................................................................................... 21

3.1.1Éè¼Æ˼Ïë ................................................................................... 21 3.1.2ϵͳ¹¦ÄÜ ................................................................................... 21 3.1.3ϵͳ×ÜÌå½á¹¹Éè¼Æ ................................................................... 22 3.2оƬµÄÑ¡È¡ ........................................................................................... 23

3.2.1ÎïÀí²ãоƬѡÔñ ....................................................................... 23 3.2.2FPGAÖ÷оƬѡÔñ .................................................................... 25 3.3Ó²¼þµç·Éè¼Æ ....................................................................................... 26

3.3.1ÒÔÌ«Íø±ä»»µç·Éè¼Æ ............................................................... 26

µÚËÄÕ FPGAÈí¼þÉè¼ÆÓë·ÂÕæ ...................................................................... 33

ii Ŀ ¼

4.1FPGAÈí¼þ¿ª·¢¼ò½é ............................................................................ 33 4.2ϵͳ¶¥²ãÄ£¿éÉè¼Æ .............................................................................. 34 4.3PHY½Ó¿ÚÄ£¿éÉè¼Æ .............................................................................. 38

4.3.1Éè¼Æ˼Ïë .................................................................................. 38 4.3.2Ïà¹ØËã·¨ .................................................................................. 39 4.3.3¹¦ÄÜ·ÂÕæ .................................................................................. 40 4.4MACºËÐÄ´¦ÀíÄ£¿éÉè¼Æ ..................................................................... 41 4.5ʵÑé²âÊÔÓë½á¹û .................................................................................. 42

4.5.1Ó²¼þ²âÊÔƽ̨׼±¸ .................................................................. 42 4.5.2Èí¼þ²âÊÔƽ̨׼±¸ .................................................................. 43 4.5.3ϵͳ²âÊÔÓë½á¹û·ÖÎö .............................................................. 45

µÚÎåÕ ½áÂÛÓëÕ¹Íû ......................................................................................... 49 ÖÂл.................................................................................................................... 51 ²Î¿¼ÎÄÏ× ........................................................................................................... 53

ÁªÏµºÏͬ·¶ÎÄ¿Í·þ£ºxxxxx#qq.com(#Ì滻Ϊ@)