ÔÆÌ⺣ - רҵÎÄÕ·¶ÀýÎĵµ×ÊÁÏ·ÖÏíÆ½Ì¨

µ±Ç°Î»ÖãºÊ×Ò³ > ³ÌÐò˵Ã÷Îĵµ

³ÌÐò˵Ã÷Îĵµ

  • 62 ´ÎÔĶÁ
  • 3 ´ÎÏÂÔØ
  • 2026/1/7 4:46:54

¶¥²ã½á¹¹£º phy_tx_en clk50M phy_tx_err phy_rx_clk phy_ff_tx_data[7:0] phy_rx_data_valid ip_receive phy_resetb phy_rx_err phy_reseta phy_rx_data[7:0]

clk_125M_out button_reset

phy_rx_data_valid Êý¾ÝÄ£¿éºÍIPºËÄ£¿é£º phy_rx_err mac_datain[31:0] ff_tx_data[31:0] mac_end ff_tx_eop ff_tx_sop mac_start ff_tx_wren mac_wr clk_50M/ff_rx_clk data_module mac_reg_addr[7:0] phy_ff_tx_data[7:0] mac mac_reg_wr_data[31:0] phy_tx_en mac_reg_wren phy_tx_err clk50M/ff_tx_clk nerset clk_125M/tx_clk

phy_rx_clk

phy_rx_data[7:0]

¼Ä´æÆ÷ÅäÖúÍÊý¾Ý²úÉúÄ£¿é£º clk_125M clk50M clk_31_25M mac_reg_wren pll nreset clk1_25 mac_reg_wr_data[31:0] clk50M set_reg mac_reg_addr[7:0] nreset button_reset phy_reseta rst phy_resetb clk1_25M data_a[31:0] mac_datain[31:0] clk_50M fifoa_flag mac_wr nreset clk_50M a mac_start phy_reseta reset fifoa_rd mac_end mac_wr fifoa_rd data_b[31:0] clk_31_25M fifob_rd fifob_flag phy_resetb clk_50M b nreset fifob_rd a¡¢b½á¹¹£º clk1_25M fifo_datain[7:0] reset fifo_wren data_a[31:0] randoma packed_ fifo_wclk rdusedw[9:0] agea packed_ generator fifoa_flag fifoa_rd clk_50M 350 generator dff clk_50M _fifo _compare nreset clk_31_25M fifo_datain[7:0] reset data_b[31:0] randomb fifo_wren packed_ fifo_wclk rdusedw[9:0] ageb packed_ generator fifob_rd fifob_flag clk_50M 350 generator dff clk_50M _fifo _compare nreset randomÄ£¿éÊÇÊý¾ÝͶ±£Ð­ÒéÄ£¿é²¢²úÉú[7:0]µÄµÝÔöÊý¾Ý£¬¾­¹ýfifo½«Êý¾ÝÒÔ[31:0]Êä³ö£¬È»ºórdusedw[9:0]Óë350½øÐбȽϣ¬±È½Ï´óС£¬Èç¹û´óµÄ»°Êä³öfifo_flag=1¡£±íʾºóÃæ¿ÉÒÔÌí¼ÓÒÔ̫֡¡£

¼Ä´æÆ÷wrÄ£¿é״̬»ú£º rst _ fifob_flag==1_ _ headcnt=1; datacnt=1 channel_sel=1; fifoa_rd=0; flag=1 fifoa_rd=0; flag=~flag£¿ mac_dataout=0; s1 s2 rst s0 temp_data=0; headcnt=1____ mac_wr=0; mac_start=0; channel_sel=1 flag=0 fifoa_flag==1 _ mac_end=0; wr_num=0; channel_sel=0; flag=0; channel_sel=0;

s1״̬±í£ºconstruct the mac frame header and first 2bytes of udp payload,total length is 42+2=44 bytes headcnt 1 first 4byte of mac header 2 Ìõ¼þ ״̬ mac_dataout=32'h01005e09; wr_num=wr_num+10'd1; mac_wr=1; mac_start=1; headcnt=headcnt+9'd1; mac_dataout=32'h09091234 mac_dataout=32'h090a1234; wr_num=wr_num+10'd1; mac_start=0; headcnt=headcnt+9'd1; mac_dataout=32'h56789abc; wr_num=wr_num+10'd1; headcnt=headcnt+9'd1; mac_dataout=32'h08004500; wr_num=wr_num+10'd1; headcnt=headcnt+9'd1; mac_dataout=32'h0596b3ba; mac_dataout=32'h059633fd; wr_num=wr_num+10'd1; headcnt=headcnt+9'd1; mac_dataout=32'h00000111; wr_num=wr_num+10'd1; headcnt=headcnt+9'd1; mac_dataout=32'hae7cc0a8; mac_dataout=32'h2e3ac0a8; wr_num=wr_num+10'd1; headcnt=headcnt+9'd1; mac_dataout=32'ha865e009; mac_dataout=32'ha864e009; wr_num=wr_num+10'd1; headcnt=headcnt+9'd1; mac_dataout=32'h0909d431; fifoa_rd=1; mac_dataout=32'h090ad431; wr_num=wr_num+10'd1; headcnt=headcnt+9'd1; fifob_rd=1; mac_dataout=32'h17710582; wr_num=wr_num+10'd1; headcnt=headcnt+9'd1; temp_data=fifoa_datain; temp_data=fifob_datain; mac_dataout=32'h00000000; wr_num=wr_num+10'd1; headcnt=1; state=2'b11; ×¢½â first 4byte of mac header channel_sel==0 channel_sel==1 3 4 last 2 byte of mac header and first 2 byte of ip header 5 channel_sel==0 channel_sel==1 channel_sel==0 channel_sel==1 channel_sel==0 channel_sel==1 6 7 8 first channel:source ip=192.168.168.101 second channel:source ip=192.168.168.100 first channel:dest ip=224.9.9.9 second channel:dest ip=224.9.9.10 no udp checksum,first 2 byte of udp payload is 0x0000 9 last 2 byte of ip header and first 2 byte of udp header 10 11 last 2 byte of udp header and first 2 byte of udp payload channel_sel==0 channel_sel==1 channel_sel==0 channel_sel==1

s2״̬±í£ºconstruct the rest part of udp payload ,total length is 350*4=1400bytes datacnt 348 Ìõ¼þ * channel_sel==0 channel_sel==1 ״̬ datacnt=datacnt+9'd1; temp_data=fifoa_datain; fifoa_rd=0; temp_data=fifob_datain; mac_dataout={temp_data[7:0],temp_data[15:8],temp_data[23:16], temp_data[31:24]}; wr_num=wr_num+10'd1; fifob_rd=0; datacnt=datacnt+9'd1; temp_data=32'd0; mac_dataout={temp_data[7:0],temp_data[15:8],temp_data[23:16], temp_data[31:24]}; wr_num=wr_num+10'd1; mac_end=1; datacnt=1; temp_data=32'd0; mac_dataout=32'd0; mac_end=0; mac_wr=0; state=2'b00; wr_num=0; datacnt=datacnt+9'd1; temp_data=fifoa_datain; temp_data=fifob_datain; mac_dataout={temp_data[7:0],temp_data[15:8],temp_data[23:16], temp_data[31:24]}; wr_num=wr_num+10'd1; ×¢½â 350 351 elsedatacnt channel_sel=0 channel_sel=1

״̬ÃèÊö£º

S0£º½«flagÐźÅ×öÒ»¸ö·´×ª£¬²¢¶¨Òåflag=0&&fifoa_flag==1ʱchannel_sel<=0£»flag=1&&fifob_flag==1ʱchannel_sel<=1£»

S1£º6+6+2+20+8+1400×Ö½Ú£»¾ßÌå·ÖΪa,b£»ÔÚÕâÀïÕë¶Ôa½øÐÐÃèÊö¡£

b888e3e5efb5123456789abc080045000596b3ba00000111d6e5c0a8a865c0a80001d43117710582 00000000+data_in£»

1¡¢b888e3e5efb5×Ô¼ºµçÄÔ±¾»úmacµØÖ·£»

2¡¢123456789abc °å×ÓÉÏmacµØÖ·£¨×Ô¼º½øÐÐÅäÖã©£» 3¡¢0800 ·²ÊÇЯ´øIP°üµÄÖ¡µÄÀàÐÍÓò¶¼ÊÇ0x0800£» 4¡¢45000 IPÊײ¿/°æ±¾

5¡¢0596 IPÍ·+Êý¾Ý³¤¶È 20+8+1402=1430£» 6¡¢b3ba 16λ±êʾ£¬Ã¿´«1λ16λ±êʾ¼Ó1£» 7¡¢0000 FLAGS/offsetλ£» 8¡¢01ͨ¹ý×î¶à·Óɼ¶ÊýTTL£» 9¡¢11 UDPЭÒé

10¡¢d6e5 checksumÊý¾Ý

¼ÆËã·½·¨£ºÈ¡IPÊý¾Ý±¨±¨Í·²¿·Ö(20B)£¬Êý¾ÝÈçÏ£º 45 00 05 96 b3 ba 00 00 01 11 d6 e5 c0 a8 a8 65 c0 a8 00 01 (1)½«Ð£ÑéºÍ×Ö¶ÎÖÃΪ0£º ½«d6 e5ÖÃΪ00 00,¼´±ä³É:

45 00 05 96 b3 ba 00 00 01 11 00 00 c0 a8 a8 65 c0 a8 00 01 (2)·´ÂëÇóºÍ

4500 + 0596 /021c+ b3ba + 0000 + 0111 + 0000 + c0a8 + a865 + c0a8 + 0001 = 32917 ½«½«½øÎ»(3)¼Óµ½µÍ16λ(2917)ÉÏ:0003+2917=291a£» (3)È¡·´Âë

½«291aÈ¡·´µÃ:checksum= d6e5 0010100100011010 = 291a 1101011011100101 = d6e5£»

11¡¢c0a8a865 Ô´IPµØÖ·£¬°å×ÓÉÏ×Ô¶¨ÒåµÄIPµØÖ·£»

12¡¢c0a80001Ä¿µÄIPµØÖ·£¬pc»úÉÏʹÓõÄЭÒé4¾²Ì¬µØÖ·£»

13¡¢d431 Ô´¶Ë¿ÚºÅ1771Ä¿µÄ¶Ë¿ÚºÅ£¨²»Óøü¸Ä£© 14¡¢0582 UDPÍ·+Êý¾Ý³¤¶È8+1402=1410 0x582£» 15¡¢ 0000 ¼ìÑéУÑéchecksumÊÇ·ñÕýÈ· ¼ÆËã·½·¨ £º

(1)¶ÔÊײ¿ÖÐÿ¸ö16 bit½øÐжþ½øÖÆ·´ÂëÇóºÍ; (2)½«(1)Öеõ½µÄºÍÔÙÈ¡·´Âë ,¿´ÊÇ·ñΪ0. ½ÓÊÕµ½µÄIPÊý¾Ý±¨Êײ¿:

45 00 05 96 b3 ba 00 00 01 11 d6 e5 c0 a8 a8 65 c0 a8 00 01 ÏÂÃæÀ´ÑéÖ¤ÏÂ: (1)·´ÂëÇóºÍ

4500+0030+804c+4000+8006+b52e+d343+117b+cb51+153d=3fffc

4500 + 0596 + b3ba + 0000 + 0111 + d6e5 + c0a8 + a865 + c0a8 + 0001 = 3fffc 0003+fffc=ffff£»

(2)È¡·´Âë:~ffff=0 ÕýÈ·

16¡¢ 0000 Á½×Ö½ÚµÄUDPÔØºÉ

17¡¢data_in£»randomÖвúÉúµÄdata_in°üº¬ÁËÊý¾ÝÍ·°üЭÒ飬ÔÚÊý¾Ý¶ÎÓû§Ê¹ÓÃ×Ô¶¨ÒåÓ¦ÓÃʱ£¨ÀýÈç´«ÊäͼƬ£©Ê¹ÓøÃЭÒé¶ÔÊý¾Ý½øÐÐÒ»¸ö¼ÓЭÒéÍ·µÄ²Ù×÷£»

S2£ºÊý¾Ý´«Êä״̬

datacnt==348ʱ½«fifo_rd<=0½øÐÐÇåÁã²Ù×÷£» datacnt==350ʱmac_end<=1;À­µÍÊäÈëʹÄÜÐźţ» datacnt==351ʱËùÓÐÊý¾ÝÖÃÁã²¢»Øµ½S0״̬£»

ÆäËûmac_dataout<={temp_data[7:0],temp_data[15:8],temp_data[23:16],temp_data[31:24]};

ʹÓÃSignalTap II½á¹û

ÏÖʹÓÃ512×Ö½ÚÊý¾Ý£¬ÐèÒª¸ü¸ÄÈçÏ£º

0596 IPÍ·+Êý¾Ý³¤¶È 20+8+1402=1430£¬¸ÄΪ0x21c = 20+8+512=540£» d6e5 checksumÊý¾Ý ¸ÄΪ25a0;

0582 UDPÍ·+Êý¾Ý³¤¶È8+1402=1410¸ÄΪ8+512 =520 = 0x208£» compareÄ£¿éÖн«350¸ü¸ÄΪ143£»

×¢ÊÍ£º512ÖаüÀ¨2×Ö½ÚudpÔØºÉÒÔ¼°Êý¾ÝÍ·°üЭÒ鲿·Ö

ËÑË÷¸ü¶à¹ØÓÚ£º ³ÌÐò˵Ã÷Îĵµ µÄÎĵµ
  • ÊÕ²Ø
  • Î¥¹æ¾Ù±¨
  • °æÈ¨ÈÏÁì
ÏÂÔØÎĵµ10.00 Ôª ¼ÓÈëVIPÃâ·ÑÏÂÔØ
ÍÆ¼öÏÂÔØ
±¾ÎÄ×÷Õߣº...

¹²·ÖÏí92ƪÏà¹ØÎĵµ

Îĵµ¼ò½é£º

¶¥²ã½á¹¹£º phy_tx_en clk50M phy_tx_err phy_rx_clk phy_ff_tx_data[7:0] phy_rx_data_valid ip_receive phy_resetb phy_rx_err phy_reseta phy_rx_data[7:0] clk_125M_out button_reset phy_rx_data_valid Êý¾ÝÄ£¿éºÍIPºËÄ£¿é£º phy_rx_err mac_datain[31:0] ff_tx_data[31:0] mac_end ff_tx_eop ff_tx_sop mac_start ff_tx_wren mac_wr clk_50M/ff_rx_clk data_module mac_reg_addr[7:0] phy_ff_tx_data[7:

¡Á ÓοͿì½ÝÏÂÔØÍ¨µÀ£¨ÏÂÔØºó¿ÉÒÔ×ÔÓɸ´ÖƺÍÅŰ棩
µ¥Æª¸¶·ÑÏÂÔØ
ÏÞÊ±ÌØ¼Û£º10 Ôª/·Ý Ô­¼Û:20Ôª
VIP°üÔÂÏÂÔØ
ÌØ¼Û£º29 Ôª/Ô ԭ¼Û:99Ôª
µÍÖÁ 0.3 Ôª/·Ý ÿÔÂÏÂÔØ150·Ý
ȫվÄÚÈÝÃâ·Ñ×ÔÓɸ´ÖÆ
VIP°üÔÂÏÂÔØ
ÌØ¼Û£º29 Ôª/Ô ԭ¼Û:99Ôª
µÍÖÁ 0.3 Ôª/·Ý ÿÔÂÏÂÔØ150·Ý
ȫվÄÚÈÝÃâ·Ñ×ÔÓɸ´ÖÆ
×¢£ºÏÂÔØÎĵµÓпÉÄÜ¡°Ö»ÓÐĿ¼»òÕßÄÚÈݲ»È«¡±µÈÇé¿ö£¬ÇëÏÂÔØÖ®Ç°×¢Òâ±æ±ð£¬Èç¹ûÄúÒѸ¶·ÑÇÒÎÞ·¨ÏÂÔØ»òÄÚÈÝÓÐÎÊÌ⣬ÇëÁªÏµÎÒÃÇЭÖúÄã´¦Àí¡£
΢ÐÅ£ºfanwen365 QQ£º370150219
Copyright © ÔÆÌ⺣ All Rights Reserved. ËÕICP±¸16052595ºÅ-3 ÍøÕ¾µØÍ¼ ¿Í·þQQ£º370150219 ÓÊÏ䣺370150219@qq.com