资源描述:
《程序说明文档》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、顶层结构:clk50Mphy(xenphyrxclkphy」xda(avalidphyrxerrphyrxda(a
2、7:0]buttonresetphy.tx.errip_receivephy_fUx_daia
3、7:()
4、phy.resetbphy.resetaclk_l25M.out数据模块和IP核模块:phy_rx_data_validdatamodulemac_endifLlx.eop,inac_startiff_lx_sopTmac.wrfftxwren--[elk.50M〃Trxc】k*imacrcgaddr
5、7:0
6、1mscn:guTdata[31:0],macrcgwr
7、cn,mac(latain
8、31:0
9、clk50M/fftxelkphy.rx.errfftxdata
10、31:O]macnersetelk125M/txelkphy」x_clkphyrxdata
11、7:0]寄存器配置和数据产生模块:a、b结构:clkl25Mresetrandomafifo_datain[7:0]►fifowrenfifowcikfifoardelk50Mpacked_generatorfifonresetresetfifo(latain
12、7:0
13、,randombfifo.wren1{fifo.wclkelk50Mpacked_generatorfifonresetra
14、ndom模块是数据投保协议模块并产牛[7:0]的递增数据,经过fifo将数据以⑶:0]输出,然后rdusedw[9:0]与350进行比较,比较大小,如果大的话输出fifo_flag=lo表示后面可以添加以太帧。寄存器wr模块状态机:rstheadcnt=kdalacnt=Ififba_rd=0;fifoa_rd=0;mac_dataout=0:temp_data=0;mac_wr=0;mac_starl=0:mac_end=0;wr_num=();flag=0;channel_sel=0;flfba_flag==l_channel_sel=O;sl状态表:constructthema
15、cframeheaderandfirst2bytesofudppayload^totallengthis42+2=44byteshcadcnl条件状态注解1first4byteofmacheadermac_dataout=32*h01005e09;wr_nurn=wr_num+10*d1;mac_wr=1:mac_start=l;hcadcnt=hcadcnt+9,d1;first4byteofmacheader2channelsel==0macdataout=32,h09()91234channcLscl==1mac_dataout=32,h090a1234;wr_num=wr_n
16、um+10'd1;mac_start=0;headcnt=headcnt+9*d1;3mac_dataou(=32*h56789abc;vvr_num=wr_num+l0*dl;headcnt=headcnt+9*d1;4last2byteofmacheaderandfirst2byteofipheadermac_da(aoiH=32'h08004500;wr_num=wr_num+10'd1;headcnt=headcnl+9*d1;5channcLscl==0macdataout=32,h0596b3ba;channel_sel==1mac_dauiom=32'h()59633f
17、d:wr_num=wr_num+10*d1;headcnt=headcnl+9*d1;6mac_dataout=32,hOOOOO111;wr_nurn=wr_num+10*d1;headen匸hcadcni+9'd1;7channcLscl==0macdataout=32,hac7cc0a8;channcLscl==1mac_dataout=32,h2c3ac0a8;wr_num=wr_num+10'd1;headcnt=headcnt+9,d1;8channel_sel==0mac_dataout=32,ha865e()()9;firstchaiineksourceip=192.
18、168.16&101channcLscl==lmac_daiaou(=32,ha864e009;vvr_num=wr_num+10*dl;headcnt=headcnt+9,d1;secondchanncksourccip=192.168.168.10()9last2byteofipheaderandfirst2byteofudpheaderchannel_sel==0mac_dataout=32,h09()9d431;fifdard=l;firstcha