diff options
79 files changed, 558 insertions, 15343 deletions
diff --git a/control_lib/cascadefifo2.v b/control_lib/cascadefifo2.v deleted file mode 100644 index 984cc46e6..000000000 --- a/control_lib/cascadefifo2.v +++ /dev/null @@ -1,56 +0,0 @@ - - -// This FIFO exists to provide an intermediate point for the data on its -// long trek from one RAM (in the buffer pool) to another (in the longfifo) -// The shortfifo is more flexible in its placement since it is based on -// distributed RAM - -// This one has the shortfifo on both the in and out sides. -module cascadefifo2 - #(parameter WIDTH=32, SIZE=9) - (input clk, input rst, - input [WIDTH-1:0] datain, - output [WIDTH-1:0] dataout, - input read, - input write, - input clear, - output full, - output empty, - output [15:0] space, - output [15:0] occupied); - - wire [WIDTH-1:0] data_int, data_int2; - wire empty_int, full_int, transfer; - wire empty_int2, full_int2, transfer2; - wire [4:0] s1_space, s1_occupied, s2_space, s2_occupied; - wire [15:0] l_space, l_occupied; - - shortfifo #(.WIDTH(WIDTH)) shortfifo - (.clk(clk),.rst(rst),.clear(clear), - .datain(datain), .write(write), .full(full), - .dataout(data_int), .read(transfer), .empty(empty_int), - .space(s1_space),.occupied(s1_occupied) ); - - longfifo #(.WIDTH(WIDTH),.SIZE(SIZE)) longfifo - (.clk(clk),.rst(rst),.clear(clear), - .datain(data_int), .write(transfer), .full(full_int), - .dataout(data_int2), .read(transfer2), .empty(empty_int2), - .space(l_space),.occupied(l_occupied) ); - - shortfifo #(.WIDTH(WIDTH)) shortfifo2 - (.clk(clk),.rst(rst),.clear(clear), - .datain(data_int2), .write(transfer2), .full(full_int2), - .dataout(dataout), .read(read), .empty(empty), - .space(s2_space),.occupied(s2_occupied) ); - - assign transfer = ~empty_int & ~full_int; - assign transfer2 = ~empty_int2 & ~full_int2; - - assign space = {11'b0,s1_space} + {11'b0,s2_space} + l_space; - assign occupied = {11'b0,s1_occupied} + {11'b0,s2_occupied} + l_occupied; - -endmodule // cascadefifo2 - - - - diff --git a/control_lib/newfifo/fifo18_to_ll8.v b/control_lib/newfifo/fifo18_to_ll8.v deleted file mode 100644 index 4653244ef..000000000 --- a/control_lib/newfifo/fifo18_to_ll8.v +++ /dev/null @@ -1,58 +0,0 @@ - -module fifo18_to_ll8 - (input clk, input reset, input clear, - input [35:0] f18_data, - input f18_src_rdy_i, - output f18_dst_rdy_o, - - output reg [7:0] ll_data, - output ll_sof_n, - output ll_eof_n, - output ll_src_rdy_n, - input ll_dst_rdy_n); - - wire ll_sof, ll_eof, ll_src_rdy; - assign ll_sof_n = ~ll_sof; - assign ll_eof_n = ~ll_eof; - assign ll_src_rdy_n = ~ll_src_rdy; - wire ll_dst_rdy = ~ll_dst_rdy_n; - - wire f18_sof = f18_data[32]; - wire f18_eof = f18_data[33]; - wire f18_occ = f18_data[35:34]; - wire advance, end_early; - reg [1:0] state; - assign debug = {29'b0,state}; - - always @(posedge clk) - if(reset) - state <= 0; - else - if(advance) - if(ll_eof) - state <= 0; - else - state <= state + 1; - - always @* - case(state) - 0 : ll_data = f18_data[31:24]; - 1 : ll_data = f18_data[23:16]; - 2 : ll_data = f18_data[15:8]; - 3 : ll_data = f18_data[7:0]; - default : ll_data = f18_data[31:24]; - endcase // case (state) - - assign ll_sof = (state==0) & f18_sof; - assign ll_eof = f18_eof & (((state==0)&(f18_occ==1)) | - ((state==1)&(f18_occ==2)) | - ((state==2)&(f18_occ==3)) | - (state==3)); - - assign ll_src_rdy = f18_src_rdy_i; - - assign advance = ll_src_rdy & ll_dst_rdy; - assign f18_dst_rdy_o = advance & ((state==3)|ll_eof); - assign debug = state; - -endmodule // ll8_to_fifo36 diff --git a/control_lib/newfifo/fifo_2clock.v b/control_lib/newfifo/fifo_2clock.v index 2ada39fb0..07ae090f2 100644 --- a/control_lib/newfifo/fifo_2clock.v +++ b/control_lib/newfifo/fifo_2clock.v @@ -16,21 +16,33 @@ module fifo_2clock assign read = src_rdy_o & dst_rdy_i; generate - if(SIZE==9) - fifo_xlnx_512x36_2clk mac_tx_fifo_2clk - (.rst(rst), - .wr_clk(wclk),.din(datain),.full(full),.wr_en(write),.wr_data_count(level_wclk), - .rd_clk(rclk),.dout(dataout),.empty(empty),.rd_en(read),.rd_data_count(level_rclk) ); - else if(SIZE==11) - fifo_xlnx_2Kx36_2clk mac_tx_fifo_2clk - (.rst(rst), - .wr_clk(wclk),.din(datain),.full(full),.wr_en(write),.wr_data_count(level_wclk), - .rd_clk(rclk),.dout(dataout),.empty(empty),.rd_en(read),.rd_data_count(level_rclk) ); - else if(SIZE==6) - fifo_xlnx_64x36_2clk mac_tx_fifo_2clk - (.rst(rst), - .wr_clk(wclk),.din(datain),.full(full),.wr_en(write),.wr_data_count(level_wclk), - .rd_clk(rclk),.dout(dataout),.empty(empty),.rd_en(read),.rd_data_count(level_rclk) ); + if(WIDTH==36) + if(SIZE==9) + fifo_xlnx_512x36_2clk fifo_xlnx_512x36_2clk + (.rst(rst), + .wr_clk(wclk),.din(datain),.full(full),.wr_en(write),.wr_data_count(level_wclk), + .rd_clk(rclk),.dout(dataout),.empty(empty),.rd_en(read),.rd_data_count(level_rclk) ); + else if(SIZE==11) + fifo_xlnx_2Kx36_2clk fifo_xlnx_2Kx36_2clk + (.rst(rst), + .wr_clk(wclk),.din(datain),.full(full),.wr_en(write),.wr_data_count(level_wclk), + .rd_clk(rclk),.dout(dataout),.empty(empty),.rd_en(read),.rd_data_count(level_rclk) ); + else if(SIZE==6) + fifo_xlnx_64x36_2clk fifo_xlnx_64x36_2clk + (.rst(rst), + .wr_clk(wclk),.din(datain),.full(full),.wr_en(write),.wr_data_count(level_wclk), + .rd_clk(rclk),.dout(dataout),.empty(empty),.rd_en(read),.rd_data_count(level_rclk) ); + else + fifo_xlnx_512x36_2clk fifo_xlnx_512x36_2clk + (.rst(rst), + .wr_clk(wclk),.din(datain),.full(full),.wr_en(write),.wr_data_count(level_wclk), + .rd_clk(rclk),.dout(dataout),.empty(empty),.rd_en(read),.rd_data_count(level_rclk) ); + else if((WIDTH==19)|(WIDTH==18)) + if(SIZE==4) + fifo_xlnx_16x19_2clk fifo_xlnx_16x19_2clk + (.rst(rst), + .wr_clk(wclk),.din(datain),.full(full),.wr_en(write),.wr_data_count(level_wclk), + .rd_clk(rclk),.dout(dataout),.empty(empty),.rd_en(read),.rd_data_count(level_rclk) ); endgenerate assign occupied = {{(16-SIZE-1){1'b0}},level_rclk}; diff --git a/coregen/fifo_xlnx_16x19_2clk.ngc b/coregen/fifo_xlnx_16x19_2clk.ngc new file mode 100644 index 000000000..b12d34d7c --- /dev/null +++ b/coregen/fifo_xlnx_16x19_2clk.ngc @@ -0,0 +1,3 @@ +XILINX-XDB 0.1 STUB 0.1 ASCII +XILINX-XDM V1.4e +$3f24g<,[o}e~g`n;"2*413&;$>"9 > %10?*nhel%fmyz cnpfc`h(|dz$Sni fhdl[}jipV;=t<7P2bnh*kah92:?7=>=0593477339:=<95?8122?45<9'::>6?6:HLSQQ<cag6:47>11592=?IR\Y__6iazt=3;>5863;80>=:432006>5?l29x>=>?ff662(363=;n794FNQWW>uthoVof|ywPtipfwm:4294996:5IORVP?vugnUna}zv_ujqavnXizyn~y2<:1<11>2=AGZ^X7~}of]fiur~W}byi~fPndebp`:4294:h6:5IORVP?vugnUmyabPtipfwm:4294986:5IORVP?vugnUmyabPtipfwmYf{zoyx1=50?07?1<NFY__6}|`g^dvhiYs`{oxdR`jg`vf86<76=1?NI<>8:79KPRW]]0omyoPcnwmp92=87;i784@UURVP?tcWmkmRm`uov?0?699k1>6B[[PTV9swYci}kTob{at=694;2<=H3==68;;72:41=11<K?7;766595=D753?K?7;ONA395A7=0L=13>9?;;9CFB1=?MJL:74:491230>?780805;:497230>?1>0>054864:;EB<4<I980M<<4A308E62<I<<256O\YOA\V@A33K;9;>5MU3:8FPUXAGLD=6M;;BC;E7=DM880OEKLK^NJG@HTMV^R\H=4CMP:?FIJE@^_II?;;BMQAZABFLXJXDAA_HLEK2=DZLK_II?4D59GF3@33MHI>>5KPN78@UTF8<1O\_O>5:FSVD423MZYM>:4F9:;6>@C;2LOO95IDBG7?CBDX=1MHIH<;GFS0>@CXL>0JK6?5:Dbhvc63N90KCJ>;H08M54<A880E?<4I2;8MKOS[]K_I>5FNW18MJD53EE=7AANDDF4?II@AJKG86BZT348HPR5WE>0@XZ<4:NVP10<D\^?SI84LTV7[I3<EZMDBn5BakmqR`ttafdh7@gaosTfvvohf:1E==:4N0237>H69:1E=?=4N010?K73;2D:9>5A1718J4143G;3?6@>929M655<F;;87C<=3:L176=I:=90B?8<;O0;7>H4::1E?>=4N270?K50;2D85>5A4018J1243G>>?6@;629M0<5<F<:87C;=3:L606=I=<80B;=4N760?K02;2D=:>5A6618J3>43G<2>6@83:L446=I?890B:<<;O507>H0<:1E;8=4N640?K10;2D<4>5A7808J=5<F1:87C6>3:L;66=I0:90B5:<;O::6>H>;2D2<>5A9018J<443G38?6@6629M=25<F0287C76f:LA[GSTX@DT\_A_S69MAQQHZB;0C?5@K09S0>VFZ]k0\D@PBTQJ@]d<X@DTNX]AALG0?UTB92[37_OB17Z2@3=TG\XHI>5\PN68P\VB;:1^<"i}f/pe+be&jf`t"Cwos]q`Zvi|{UiecQwos2345YUmzgx<=<;T2,cw`)zo%lou lljz,I}iuW{nT|cz}_ckm[}iu89::S_k|umv276=R8&myj#|i/fa{*fjlp&GscQ}d^rmpwYeagUsc>?03]Qavsk|8997X> gsd-vc)`kq$h`fv Mymq[wbXxg~ySjmPxnp3456XZly~`y?<2:W3+bta&{l$knv!cmi{+H~hzVxoS}`{r^e`[}iu89::S_k|umv277=R8&myj#|i/fa{*fjlp&GscQ}d^rmpwY`kVrd~=>?2^Pfwpjs9:90Y=!hrg,qb*adp'iggu!Bxnp\swYwf}xTnd`Pxnp3456XZly~`y?<3:W3+bta&{l$knv!cmi{+H~hzV}yS}`{r^`jjZ~hz9:;=R\jstnw565<]9%l~k }f.e`|+ekcq%Ftb|Pws]sjqtXj`dTtb|?010\V`urd};8>6[?/fpe*w`(ojr%oaew/LzlvZquWyd~Ril_ymq4567W[oxyaz>339V4*aun'xm#jmw.bnh|*Kg{U|~R~ats]dgZ~hz9:;=R\jstnw564<]9%l~k }f.e`|+ekcq%Ftb|Pws]sjqtXojUsc>?03]Qavsk|88:7X> gsd-vc)`kq$h`fv re]sjqtXj`d7<3<>;T2,cw`)zo%lou lljz,vaYwf}xTnd`31?02?P6(o{l%~k!hcy,`hn~(zmU{by|Pbhl?6;463\:$kh!rg-dg}(ddbr$~iQnup\flh;;78;7X> gsd-vc)`kq$h`fv re]sjqtXj`dT<?>4U1-dvc(un&mht#mcky-q`Zvi|{UiecQ>219V4*aun'xm#jmw.bnh|*tcWyd~Rlfn^014>S7'nxm"h gbz-gim'{nT|cz}_ckm[6413\:$kh!rg-dg}(ddbr$~iQnup\flhXpfx;<=>=6:W3+bta&{l$knv!cmi{+wbXxg~ySoga_ymq4566:?1^<"i}f/pe+be&jf`t"|k_qlwvZdnfVrd~=>?2328Q5)`zo$yj"ilx/aoo})ulVzexQhc=2=65=R8&myj#|i/fa{*fjlp&xoS}`{r^e`848582_;#j|i.sd,cf~)keas#jPpovq[be;:78;7X> gsd-vc)`kq$h`fv re]sjqtXoj682<h4U1-dvc(un&mht#mcky-q`Zvi|{UloR>>f:W3+bta&{l$knv!cmi{+wbXxg~ySjmP10d8Q5)`zo$yj"ilx/aoo})ulVzexQhc^02b>S7'nxm"h gbz-gim'{nT|cz}_fa\770<]9%l~k }f.e`|+ekcq%yhR~ats]dgZgtzlm7<3<9;T2,cw`)zo%lou lljz,vaYwf}xTknQnssgd8485>2_;#j|i.sd,cf~)keas#jPpovq[beXizxnk1<1279V4*aun'xm#jmw.bnh|*tcWyd~Ril_`qqab:46;?0Y=!hrg,qb*adp'iggu!}d^rmpwY`kVkx~hiP0378Q5)`zo$yj"ilx/aoo})ulVzexQhc^cpv`aX9;?0Y=!hrg,qb*adp'iggu!}d^rmpwY`kVkx~hiP2378Q5)`zo$yj"ilx/aoo})ulVzexQhc^cpv`aX;;30Y=!hrg,qb*adp'iggu!}d^rmpwY`kVkx~hiPd0>3:7?<]9%l~k }f.e`|+ekcq%yhR~ats]dgZgtzlmTh<2>>3;8Q5)`zo$yj"ilx/aoo})ulVzexQhc^cpv`aXl8692?74U1-dvc(un&mht#mcky-q`Zvi|{UloRo|rde\`4:46;20Y=!hrg,qb*adp'iggu!}d^rmpwY`kVkx~hiPd0]36==R8&myj#|i/fa{*fjlp&xoS}`{r^e`[duumnUo=R?=8:W3+bta&{l$knv!cmi{+wbXxg~ySjmParpfcZb6W;837X> gsd-vc)`kq$h`fv re]sjqtXojUjkh_e3\773<]9%l~k }f.e`|+ekcq%yhR~ats]dgZ~hz9:;<?;4U1-dvc(un&mht#mcky-q`Zvi|{UloRv`r123573<]9%l~k }f.e`|+ekcq%yhR~ats]dgZ~hz9:;>??4U1-dvc(un&mht#mcky-tvZvi|{Uiec2?>338Q5)`zo$yj"ilx/aoo})pzVzexQmio>2:77<]9%l~k }f.e`|+ekcq%|~R~ats]amk:56;;0Y=!hrg,qb*adp'iggu!xr^rmpwYeag682?>4U1-dvc(un&mht#mcky-tvZvi|{UiecQ?219V4*aun'xm#jmw.bnh|*quWyd~Rlfn^314>S7'nxm"h gbz-gim'~xT|cz}_ckm[7473\:$kh!rg-dg}(ddbr${Qnup\flhX;;<0Y=!hrg,qb*adp'iggu!xr^rmpwYeagUsc>?0105?P6(o{l%~k!hcy,`hn~({U{by|Pbhl\|jt789;9:6[?/fpe*w`(ojr%oaew/vp\tkruWkceSua}012165=R8&myj#|i/fa{*fjlp&}yS}`{r^e`858582_;#j|i.sd,cf~)keas#z|Ppovq[be;978;7X> gsd-vc)`kq$h`fv ws]sjqtXoj692?>4U1-dvc(un&mht#mcky-tvZvi|{Ulo1=11g9V4*aun'xm#jmw.bnh|*quWyd~Ril_13e?P6(o{l%~k!hcy,`hn~({U{by|Pgb]25c=R8&myj#|i/fa{*fjlp&}yS}`{r^e`[77a3\:$kh!rg-dg}(ddbr${Qnup\cfY4:?1^<"i}f/pe+be&jf`t"y}_qlwvZadWhyyij2?>348Q5)`zo$yj"ilx/aoo})pzVzexQhc^cpv`a;978=7X> gsd-vc)`kq$h`fv ws]sjqtXojUjkh<3<12>S7'nxm"h gbz-gim'~xT|cz}_fa\evtbo595>85Z0.eqb+ta'nis"nbdx.uq[uhszVmhSl}}ef]360=R8&myj#|i/fa{*fjlp&}yS}`{r^e`[duumnU:>85Z0.eqb+ta'nis"nbdx.uq[uhszVmhSl}}ef]160=R8&myj#|i/fa{*fjlp&}yS}`{r^e`[duumnU8>45Z0.eqb+ta'nis"nbdx.uq[uhszVmhSl}}ef]g5969:01^<"i}f/pe+be&jf`t"y}_qlwvZadWhyyijQk1=3=6<=R8&myj#|i/fa{*fjlp&}yS}`{r^e`[duumnUo=1<1289V4*aun'xm#jmw.bnh|*quWyd~Ril_`qqabYc9595>55Z0.eqb+ta'nis"nbdx.uq[uhszVmhSl}}ef]g5Z6502_;#j|i.sd,cf~)keas#z|Ppovq[beXizxnkRj>_00;?P6(o{l%~k!hcy,`hn~({U{by|Pgb]bwwc`Wm;T>?64U1-dvc(un&mht#mcky-tvZvi|{UloRo|rde\`4Y4:<1^<"i}f/pe+be&jf`t"y}_qlwvZadWqey<=>?249V4*aun'xm#jmw.bnh|*quWyd~Ril_ymq4566:<1^<"i}f/pe+be&jf`t"y}_qlwvZadWqey<=>=369V4*aun'xm#jb?.sf,cw7)o{nh>#|kc.Ob`aYulVnhSdQndeqvf5678=9h7X> gsd-vc)`d9$yh"i}1/eq`f4)zmi$Aljk_sf\`fYnWhnoxl?012\g|:66:90Y=!hrg,qb*ak8'xo#j|>.fpgg7(ulj%FxlPdhde[rtXzmUa}:<4:W3+bta&{l$ka>!re-dv4(`zmi9"jl/LqvfZbnnoU|~R|k_uos04543\:$kh!rg-dh5(ul&my=#i}db0-vae(EziSigif^uq[wbX|dz=?95Z0.eqb+ta'nf;"j gs3-cwbd:'xoo"C|uc]gmc`X{UyhRzbp630<>S7'nxm"h gm2-va)`z8$l~im=.sf`+HurjVnbjkQxr^pg[qkwWjs7=3=n;T2,cw`)zo%l`= }d.eq5+aulj8%~im Mrwa[aoanV}ySjPtlr\g|:668;8n6[?/fpe*w`(oe:%~i!hr0,dvae5&{nh#@}zb^fjbcYpzVxoSyc_ymq84869:h0Y=!hrg,qb*ak8'xo#j|>.fpgg7(ulj%FxlPdhde[rtXzmUa}Qwos>0:47502_;#j|i.sd,ci6)zm%l~< hrea1*wbd'{nThnQf_10;?P6(o{l%~k!hl1,q`*au9'myhn<!rea,vaYckVcT=?64U1-dvc(un&mg<#|k/fp2*btck;$yhn!}d^f`[lY5:11^<"i}f/pe+bj7&{n$k?!gsf`6+tck&xoSimPi^11<>S7'nxm"h gm2-va)`z8$l~im=.sf`+wbXljUbS9=>;T2,cw`)zo%l`= }d.eq5+aulj8%~im re]ggZoXe|r;<=<30?16?P6(o{l%~k!hl1,q`*au9'myhn<!rea,vaYckVcTaxv?010?4;YT_89:7X> gsd-vc)`d9$yh"i}1/eq`f4)zmi$~iQkc^k\ip~78987=3=<;T2,cw`)zo%l`= }d.eq5+aulj8%~im re]ggZoXe|r;<=<31?3277=R8&myj#|i/fn3*wb(o{;%kjl2/pgg*tcWmiTeRczx1236979::;0Y=!hrg,qb*ak8'xo#j|>.fpgg7(ulj%yhRjl_h]nq}678;692><4U1-dvc(un&mg<#|k/fp2*btck;$yhn!}d^f`[lYj}q:;<?2=>012?P6(o{l%~k!hl1,q`*au9'myhn<!rea,vaYckVcTaxv?010?7;553\:$kh!rg-dh5(ul&my=#i}db0-vae(zmUooRgPmtz3454;;7;8:6[?/fpe*w`(oe:%~i!hr0,dvae5&{nh#jPdb]j[hs89:90>0>_RU374=R8&myj#|i/fn3*wb(o{;%kjl2/pgg*tcWmiTeRczx1236929;;1^<"i}f/pe+bj7&{n$k?!gsf`6+tck&xoSimPi^ov|567:5>5=>84U1-dvc(un&mg<#|k/fp2*btck;$yhn!}d^f`[lYj}q:;<?2;>0]PS54f3\:$kh!rg-dh5(ul&my=#|iwgv,VDKXZMUNBRHXFU31=>S7'nxm"h gm2-va)`z8$yjzh{/SCN[WC@G\^TIC?=b:W3+bta&{l$ka>!re-dv4(un~l#_OB_WCOMAYA_O^:=>=4U1-dvc(un&mg<#|k/fp2*w`pn}%hy|Pfvdw[vrf|lUM_@QIFe302>S7'nxm"h gm2-va)`z8$yjzh{/bwqvZ`pn}Uxxlzj_GQN[C@c9$Ce?55Z0.eqb+ta'nf;"j gs3-vcqa|&i~~Qiwgv\wqgsmVLXARHId0/Jj474;2_;#j|i.sd,ci6)zm%l~< }fvdw+fsuzVl|jyQ|t`vf[CUJWOLo>>84U1-dvc(un&mg<#|k/fp2*w`pn}%hy|Pfvdw[vrf|lUM_@QIFe0.Mk5?3\:$kh!rg-dh5(ul&my=#|iwgv,gptuWo}mxR}{aug\BVKXNOn9!D`>13:8Q5)`zo$yj"ic0/pg+bt6&{l|jy!jmqvz[cqa|Vli>:5Z0.eqb+ta'nf;"j gs3-vcqa|&of|ywPfvdw[l4b3\:$kh!rg-dh5(ul&my=#|iwgv,ahvsqVl|jyQf_np34565n2_;#j|i.sd,ci6)zm%l~< }fvdw+`kw|pUm{kzPi^mq45679;?0Y=!hrg,qb*ak8'xo#j|>.sdtbq)r{lxTzlbfd3;8Q5)`zo$yj"ic0/pg+btf{'xxx~!}al]fiur~WohTe>>4U1-dvc(un&mg<#|k/fpbw+tt|z%ym`Qjmqvz[cdXaVey<=>?369V4*aun'xm#jb?.sf,cwgt&{y"|nm^gntqXnkUbSb|?012240YT_9987X> gsd-vc)`d9$yh"i}ar,qwqu(zhgTi`~{y^da[lYhz9:;<<?:369V4*aun'xm#jb?.sf,cwgt&{y"|nm^gntqXnkUbSb|?012250YT_9997X> gsd-vc)`d9$yh"i}ar,qwqu(zhgTi`~{y^da[lYhz9:;<?9<2:W3+bta&{l$ka>!re-dvdu)zz~x#ob_dosp|YajVcTc>?01:;5c=R8&myj#|i/fn3*wb(zhgTzlbfd^dtbq443\:$kh!rg-dh5(ul&x{by| MbmvjqYdg|d>95Z0.eqb+ta'nf;"j rqlwv*Kdg|dSnaznu110>S7'nxm"h gm2-va)uxg~y#@m`uov\gjsi|?8?7X> gsd-vc)`d9$yh"|nup,Ifirf}Uhcx`{9208Q5)`zo$yj"ic0/pg+wvi|{%Fob{at^alqkrXpfx7<3?>_HLU[54d3\:$kh!rg-dh5(ul&x{by| MbmvjqYdg|dSua}<0<257e<]9%l~k }f.eo4+tc'{zex!BcnwmpZeh}g~Ttb|32?326f=R8&myj#|i/fn3*wb(zyd~"Clotlw[firf}Usc2<>032b>S7'nxm"h gm2-va)uxg~y#naznu>3:4`<]9%l~k }f.eo4+tc'{zex!lotlw8486n2_;#j|i.sd,ci6)zm%y|cz}/bmvjq:568l0Y=!hrg,qb*ak8'xo#~ats-`kphs4:4:i6[?/fpe*w`(oe:%~i!}povq+firf}U;=h5Z0.eqb+ta'nf;"j rqlwv*eh}g~T=<k4U1-dvc(un&mg<#|k/srmpw)dg|dS??j;T2,cw`)zo%l`= }d.psjqt(kfexR==2:W3+bta&{l$ka>!re-qtkru'je~byQk1=2=67=R8&myj#|i/fn3*wb(zyd~"m`uov\`4:66;80Y=!hrg,qb*ak8'xo#~ats-`kphsWm;7>3<=;T2,cw`)zo%l`= }d.psjqt(kfexRj><2<15>S7'nxm"h gm2-va)uxg~y#naznu]g5Z65;2_;#j|i.sd,ci6)zm%y|cz}/bmvjqYc9V:T=??4U1-dvc(un&mg<#|k/srmpw)dg|dSi?P1318Q5)`zo$yj"ic0/pg+wvi|{%hcx`{_e3\5Z7592_;#j|i.sd,ci6)zm%y|cz}/bmvjqYc9V89?6[?/fpe*w`(oe:%~i!}povq+firf}Uo=R<P1338Q5)`zo$yj"ic0/pg+wvi|{%hcx`{_e3\775<]9%l~k }f.eo4+tc'{zex!lotlw[a7X;V;986[?/fpe*w`(oe:%~i!}povq+firf}Uecy>?000;?P6(o{l%~k!hl1,tv*apiz$|y} r`o\bpjkWohTe?;4U1-dvc(un&mg<#y}/fubw+qt|z%ym`Qiumn\m7e<]9%l~k }f.eo4+qu'n}j#y|tr-qehYa}efTeRa}01236c=R8&myj#|i/fn3*rt(o~kx"z}{s.pbiZ`rdeUbSb|?01225=543\:$kh!rg-dh5(pz&m|m~ xsuq,vdkXn|fgSdQ`r123447?WZ];>k5Z0.eqb+ta'nf;"z| gvcp*rus{&xjaRhzlm]j[jt789::8<<j;T2,cw`)zo%l`= xr.etev(p{}y$~lcPftno[lYhz9:;<?8=e:W3+bta&{l$ka>!ws-dsdu)z~x#ob_gwohZoXg{:;<=;<2d9V4*aun'xm#jb?.vp,crgt&~y"|nm^dvhiYnWfx;<=>63528Q5)`zo$yj"ic0/uq+bqck8$|hnkwt.Ob`aYpzVnjxlQlotlw[lYflm:;<=Qly=3=05=R8&myj#|i/fn3*rt(o~nh=#ykcdzw+HgclV}ySio{a^alqkrXaVkoh=>?0^az8683:2_;#j|i.sd,ci6){%l{im>.vf`a}r(EhnoSz|Pd`vb[firf}UbSljk0123[f;;7;:8;5Z0.eqb+ta'nf;"z| gvf`5+qcklr#@okd^uq[agsiVidyczPi^cg`5678Vir0>0>1^QT415<]9%l~k }f.eo4+qu'n}oo< xdbg{p*KflmU|~Rjnt`]`kphsW`Ujhi>?01]{kw:668;??6[?/fpe*w`(oe:%{!hwea2*rbdmq~$Aljk_vp\`drfWje~byQf_`fg4567Wqey0?0>1518Q5)`zo$yj"ic0/uq+bqck8$|hnkwt.Ob`aYpzVnjxlQlotlw[lYflm:;<=Qwos>0:473?2_;#j|i.sd,ci6){%l{im>.vf`a}r(EhnoSz|Pd`vb[firf}UbSljk0123[}iu4:4:=R]X1558Q5)`zo$yj"ic0/uq+bqck8$|hnkwt.Ob`aYpzVnjxlQlotlw[lYflm:;<=Qwos>0:47X[^88>6[?/fpe*w`(oe:%{!hwea2*rbdmq~$A~{m_ekebZquW{nTx`~9329V4*aun'xm#jb?.vp,crbd9'}oohv{/LqvfZbnnoU|~R|k_uos34503\:$kh!rg-dh5(pz&m|hn?!weaf|q)J{|hThdhi_vp\vaYseyUhu1?1389V4*aun'xm#jb?.vp,crbd9'}oohv{/LqvfZbnnoU|~R|k_uos[f;97;:?l5Z0.eqb+ta'nf;"z| gvf`5+qcklr#@}zb^fjbcYpzVxoSyc_ymq85869:k0Y=!hrg,qb*ak8'}y#jykc0,t`fc|&GxyoQkigd\swYulV~f|Rv`r=3=544a3\:$kh!rg-dh5(pz&m|hn?!weaf|q)caolT{Q}d^vnt969:o1^<"i}f/pe+bj7&~x$kzjl1/ugg`~s'~xThlzn_bmvjqYnW98m7X> gsd-vc)`d9$|~"ixdb3-saebp}%|~Rjnt`]`kphsW`U:>k5Z0.eqb+ta'nf;"z| gvf`5+qcklr#z|Pd`vb[firf}UbS?<i;T2,cw`)zo%l`= xr.et`f7)minty!xr^fbpdYdg|dSdQ<2g9V4*aun'xm#jb?.vp,crbd9'}oohv{/vp\`drfWje~byQf_51;?P6(o{l%~k!hl1,tv*aplj;%{imjxu-tvZbf|hUhcx`{_h]b`a67896:2>64U1-dvc(un&mg<#y}/fugg4(pljosx"y}_ecweZeh}g~TeRokd1234949;11^<"i}f/pe+bj7&~x$kzjl1/ugg`~s'~xThlzn_bmvjqYnWhno<=>?<2<2`>S7'nxm"h gm2-sw)uidU|~Rka_h317>S7'nxm"h gm2-sw)pxg~y#@m`uov\gjsi|;>0Y=!hrg,qb*ak8'}y#z~ats-Ngjsi|Vidycz<259V4*aun'xm#jb?.vp,suhsz&Ghcx`{_bmvjq05<2_;#j|i.sd,ci6){%||cz}/LalqkrXkfex4==;T2,cw`)zo%l`= xr.usjqt(Eje~byQlotlw[}iu494:=RGAV^21g>S7'nxm"h gm2-sw)pxg~y#@m`uov\gjsi|Vrd~1?1100`?P6(o{l%~k!hl1,tv*qwf}x$Anaznu]`kphsWqey0?0>13a8Q5)`zo$yj"ic0/uq+rvi|{%Fob{at^alqkrXpfx7?3?>1g9V4*aun'xm#jb?.vp,suhsz&idycz30?3e?P6(o{l%~k!hl1,tv*qwf}x$ob{at=3=5c=R8&myj#|i/fn3*rt(yd~"m`uov?6;7a3\:$kh!rg-dh5(pz&}{by| cnwmp9599l1^<"i}f/pe+bj7&~x${}`{r.alqkrX88o0Y=!hrg,qb*ak8'}y#z~ats-`kphsW8;n7X> gsd-vc)`d9$|~"ynup,gjsi|V8:i6[?/fpe*w`(oe:%{!xpovq+firf}U8>?5Z0.eqb+ta'nf;"z| wqlwv*eh}g~Th<2?>308Q5)`zo$yj"ic0/uq+rvi|{%hcx`{_e3?5;453\:$kh!rg-dh5(pz&}{by| cnwmpZb64;49>6[?/fpe*w`(oe:%{!xpovq+firf}Uo=1=1209V4*aun'xm#jb?.vp,suhsz&idyczPd0]364=R8&myj#|i/fn3*rt(yd~"m`uov\`4Y6:81^<"i}f/pe+bj7&~x${}`{r.alqkrXl8U9><5Z0.eqb+ta'nf;"z| wqlwv*eh}g~Th<Q<239V4*aun'xm#jb?.vp,suhsz&idyczPd3>3:74<]9%l~k }f.eo4+qu'~zex!lotlw[a4;97897X> gsd-vc)`d9$|~"ynup,gjsi|Vn90?0=2:W3+bta&{l$ka>!ws-ttkru'je~byQk2=1=64=R8&myj#|i/fn3*rt(yd~"m`uov\`7Y7::1^<"i}f/pe+bj7&~x${}`{r.alqkrXl;U;S<<>;T2,cw`)zo%l`= xr.usjqt(kfexRj=_000?P6(o{l%~k!hl1,tv*qwf}x$ob{at^f1[4Y6:81^<"i}f/pe+bj7&~x${}`{r.alqkrXl;U9><5Z0.eqb+ta'nf;"z| wqlwv*eh}g~Th?Q<229V4*aun'xm#jb?.vp,suhsz&idyczPd3]0[4433\:$kh!rg-dh5(pz&}{by| cnwmpZhh|9:;=<84U1-dvc(un&gna"j`uu]j[5713\:$kh!rg-nah)cg|~TeR?>7:W3+bta&{l$ahc dnww[lY688=0Y=!hrg,qb*kbe&ndyyQf_0323>S7'nxm"h mdo,`jssW`U:><94U1-dvc(un&gna"j`uu]j[456?2_;#j|i.sd,i`k(lfSdQ>4058Q5)`zo$yj"cjm.flqqYnW8?:;6[?/fpe*w`(elg$hb{{_h]2241<]9%l~k }f.ofi*bh}}UbS<9>7:W3+bta&{l$ahc dnww[lY608<0Y=!hrg,qb*kbe&ndyyQf_335?P6(o{l%~k!bel-gkprXaV9::6[?/fpe*w`(elg$hb{{_h]753=R8&myj#|i/lgn+air|VcT9<84U1-dvc(un&gna"j`uu]j[3713\:$kh!rg-nah)cg|~TeR9>6:W3+bta&{l$ahc dnww[lY?9?1^<"i}f/pe+hcj'me~xRgP90g8Q5)`zo$yj"cjm.egi+bj'DxjaR\NM03e?P6(o{l%~k!bel-d`h(ce&Gym`Q]AL335c=R8&myj#|i/lgn+bbj&mg$Aob_SCN547a3\:$kh!rg-nah)`ld$oa"C}al]QEH759o1^<"i}f/pe+hcj'nnf"ic Mscn[WGJ9:;m7X> gsd-vc)jmd%lh` km.OqehYUID;?=k5Z0.eqb+ta'dof#jjb.eo,IwgjW[KF=8?i;T2,cw`)zo%fi`!hdl,gi*KuidUYM@?91g9V4*aun'xm#`kb/ffn*ak(E{kfS_OB163e?P6(o{l%~k!bel-d`h(ce&Gym`Q]AL3;5c=R8&myj#|i/lgn+bbj&mg$Aob_SCN5<7b3\:$kh!rg-nah)`ld$oa"C}al]QEH46m2_;#j|i.sd,i`k(omg%h`!Br`o\VDK49l1^<"i}f/pe+hcj'nnf"ic Mscn[WGJ<8o0Y=!hrg,qb*kbe&moa#jb/LpbiZTFE<;n7X> gsd-vc)jmd%lh` km.OqehYUID<:i6[?/fpe*w`(elg$kic!dl-NvdkXZHG<=h5Z0.eqb+ta'dof#jjb.eo,IwgjW[KF4<k4U1-dvc(un&gna"ikm/fn+HtfeVXJA4<:;T2,cw`)zo%fi`!hdl,gi*Yqi{cehhv?012?4;413\:$kh!rg-nah)`ld$oa"Qyaskm``~789:7==0=6:W3+bta&{l$ahc geo-`h)X~hxbbikw01238479:?1^<"i}f/pe+hcj'nnf"ic _wcqmkbbp9:;<1?=>348Q5)`zo$yj"cjm.egi+bj'V|j~d`key2345:6;78=7X> gsd-vc)jmd%lh` km.]uewoillr;<=>315<12>S7'nxm"h mdo,cak)ld%Tzl|fneg{456748?5>;5Z0.eqb+ta'dof#jjb.eo,[sguagnnt=>?0=35:70<]9%l~k }f.ofi*ace'nf#Rxnrhlga}67896:;3<9;T2,cw`)zo%fi`!hdl,gi*Yqi{cehhv?012?5=85=2_;#j|i.sd,i`k(omg%h`!Pv`pjjac89:;0<0=5:W3+bta&{l$ahc geo-`h)X~hxbbikw01238785=2_;#j|i.sd,i`k(omg%h`!Pv`pjjac89:;0>0=5:W3+bta&{l$ahc geo-`h)X~hxbbikw01238185=2_;#j|i.sd,i`k(omg%h`!Pv`pjjac89:;080=5:W3+bta&{l$ahc geo-`h)X~hxbbikw01238385=2_;#j|i.sd,i`k(omg%h`!Pv`pjjac89:;0:0=5:W3+bta&{l$ahc geo-`h)X~hxbbikw01238=85=2_;#j|i.sd,i`k(omg%h`!Pv`pjjac89:;040>e:W3+bta&{l$ahc geo-`h)cg|~Te1>11g9V4*aun'xm#`kb/ffn*ak(lfSd2>0?3e?P6(o{l%~k!bel-d`h(ce&ndyyQf<03=5c=R8&myj#|i/lgn+bbj&mg$hb{{_h>26;7a3\:$kh!rg-nah)`ld$oa"j`uu]j84599o1^<"i}f/pe+hcj'nnf"ic dnww[l:6<7;m7X> gsd-vc)jmd%lh` km.flqqYn48?5=k5Z0.eqb+ta'dof#jjb.eo,`jssW`6::3?i;T2,cw`)zo%fi`!hdl,gi*bh}}Ub0<911g9V4*aun'xm#`kb/ffn*ak(lfSd2>8?3f?P6(o{l%~k!bel-d`h(ce&ndyyQf<0<2a>S7'nxm"h mdo,cak)ld%ocxzPi=0=5`=R8&myj#|i/lgn+bbj&mg$hb{{_h>0:4c<]9%l~k }f.ofi*ace'nf#iazt^k?0;7b3\:$kh!rg-nah)`ld$oa"j`uu]j8086m2_;#j|i.sd,i`k(omg%h`!kotv\m9099l1^<"i}f/pe+hcj'nnf"ic dnww[l:068o0Y=!hrg,qb*kbe&moa#jb/emvpZo;07;n7X> gsd-vc)jmd%lh` km.flqqYn404:h6[?/fpe*w`(elg$kic!dl-gkprXaV::h6[?/fpe*w`(elg$kic!dl-gkprXaV;:i6[?/fpe*w`(elg$kic!dl-gkprXaV;;=h5Z0.eqb+ta'dof#jjb.eo,`jssW`U:=<k4U1-dvc(un&gna"ikm/fn+air|VcT=??j;T2,cw`)zo%fi`!hdl,gi*bh}}UbS<=>e:W3+bta&{l$ahc geo-`h)cg|~TeR?;1d9V4*aun'xm#`kb/ffn*ak(lfSdQ>50g8Q5)`zo$yj"cjm.egi+bj'me~xRgP173f?P6(o{l%~k!bel-d`h(ce&ndyyQf_052a>S7'nxm"h mdo,cak)ld%ocxzPi^3;5a=R8&myj#|i/lgn+bbj&mg$hb{{_h]15a=R8&myj#|i/lgn+bbj&mg$hb{{_h]05a=R8&myj#|i/lgn+bbj&mg$hb{{_h]75a=R8&myj#|i/lgn+bbj&mg$hb{{_h]65a=R8&myj#|i/lgn+bbj&mg$hb{{_h]55a=R8&myj#|i/lgn+bbj&mg$hb{{_h]45a=R8&myj#|i/lgn+bbj&mg$hb{{_h];5a=R8&myj#|i/lgn+bbj&mg$hb{{_h]:52=R8&myj#|i/scn[wc`g|~Tic?k;T2,cw`)zo%yylck.pg[wusWhyyij<?;T2,cw`)zo%yylck.pg[wusWhyyijQk1328Q5)`zo$yj"||tcnh+wbXzz~Tm~|jg^f15f=R8&myj#|i/sqwfim(zmUyyQlol`2`>S7'nxm"h rrvahn)ulVxxxRm`mc32a>S7'nxm"h rrvahn)ulVxxxR|jg=2=5`=R8&myj#|i/sqwfim(zmUyyQ}ef>2:4c<]9%l~k }f.pppgjl'{nT~~zPrde?6;7c3\:$kh!rg-qwqdkc&xoS}{_sgd[57c3\:$kh!rg-qwqdkc&xoS}{_sgd[47c3\:$kh!rg-qwqdkc&xoS}{_sgd[77c3\:$kh!rg-qwqdkc&}yS}{_`qqab473\:$kh!rg-qwqdkc&}yS}{_`qqabYc9;:0Y=!hrg,qb*tt|kf`#z|Prrv\evtboVn9=n5Z0.eqb+ta'{ynae ws]qwqYdgdh:h6[?/fpe*w`(zz~i`f!xr^pppZehek;:i6[?/fpe*w`(zz~i`f!xr^pppZtbo5:5=h5Z0.eqb+ta'{ynae ws]qwqYumn6:2<j4U1-dvc(un&xxxobd/vp\vvrXzlmT<<j4U1-dvc(un&xxxobd/vp\vvrXzlmT=l5ZSDP\EIOF[j1^_H\PVHQJFIC43_IH56XFEV]W]UC33^IGG?5XE0f8\LJNFQ'SHO.?.0"PPPD'8';+M^MFI79[WQJNJ>1S_YQHNE`8\ZEHZLUBBKA9;Yfa[Lba3QncS]|fmWgqwlii991Sh`QBakmqR`ttafd:<6Vkm^OjjjtQm{ybccm4amolwqYbey~rn6ocmnqw[cskd?1imnezpe9aefmrxVgj~fk}3:aooa=ci}kTob{at)2*`>bf|hUhcx`{(0+g?agsiVidycz'2(f8`drfWje~by&<)e9geqgXkfex%:&d:fbpdYdg|d0=0i;ecweZeh}g~787>17:famqcuz?1oec&?)79gmk.6!>1oec&>0(58`lh/98#<7iga(00*3>bnf!;8%:5kio*20,1<l`d#=8'8;ekm,40.?2nbb%?8)69gmk.60 <0hd`'2(48`lh/; <0hd`'4(48`lh/= <0hd`'6(48`lh/? <0hd`'8(48`lh/1 <0hd`30?58`lh;994<7iga<03=3>bnf5;92:5kio>27;1<l`d7=908;ekm8439?2nbb1?9>69gmk:6?730hd`31983:2=cag6:4384dhl?5;0<l`d7>384dhl?7;0<l`d78384dhl?1;0<l`d7:384dhl?3;0<l`d74384dhl?=;1<lf$='8;emvp-7.02ndyy&>0(:8`jss 8;"46j`uu*26,><lf$<=&8:flqq.6< 20hb{{(07*<>bh}}"::$64dnww,41.02ndyy&>8(58`jss ;#<7iazt)1*3>bh}}"?%:5kotv+1,1<lf$;'8;emvp-1.?2ndyy&7)69gkpr/1 =0hb{{<1<;?air|5;;255kotv?548?3me~x1?=>99gkpr;9:437iazt=37:==cg|~7=807;emvp971611ocxz316<b?air|5;36=07;emvp97?6>1ocxz31?58`jss4;4<7iazt=1=3>bh}}6?2:5kotv?1;1<lf0;08;emvp919?2ndyy27>69gkpr;1720iigi2oeg1>cjx}s8>6hffn]dakcui}eyS{:P3-"[mioip)ID^H.Heogqeqiu(8:%=#><159emciXpedsS<8w18]1gim4:2lbjbQwloz\53~61V8h`f"iigm\c`hbzh~d~Rx;_2.MKKC+FFDN?oj4fhdl[}jipV;=t<7P2bnh(coagVmnbh|ntnp\r1Y4$riTdl}Piov\gim:8%iTdl}Pssqw95*dW{nTjk~=0.`[mgtW{nThlzn_bmvjq;6$jUoecQxievk94?+kVbjRy}_ecweZeh}g~6=!mPftno[cjfozUyyQyam?2(fYneyfnah`{aukljZr~xl79 nQzsd]figccllnT~hi20-a\swYazl{6=!mPurg\`jssW{y1<"l_tlgaw`kg~Ugcz3?,b]kevYh~lxm`by20-a\twckghnT`lzjnb{>4)eXlfSzgkti?2=)eXezmdbRxnl<3/gZtcWmo{xe3>6-a\lduX}gnn~kb`w<2/gZnf{Vkgab}{_gwoh86+kVbjR||t<3/gZbf|hUhcx`{_vkgpm;2$jUcm~Qxr^c`o86+kVxiRklc<2/gZehedeeSnb`cj?3(fYpzVkhgRb`w<2/gZtcWyd~Ryfduj>0)eX}zoTjzh{_ecweZeh}g~6=!mPh`q\eikh{}Una}zv=1.`[wbXlh~jSnaznu]tmaro5<&hSbxjrgnlsZjh4:'oRy}_qlwvZqnl}b68!mPpsmd[`kw|pUu}k20-a\swYci}kTob{at^uj`qn:=%iT|kco`f\v`at58&hSiazt^pppZpfd4:'oRfns^fbpdYdg|d1="l_qplcZ`rdeUdk|h^lfcdrbWkg1<:#c^uq[acw|a7::!mPpsmd[`kw|pUdk|h^lfcdrbWkg18"l_qplcZcjx}sTxe|jsi]bwvcu|V|j`0:#c^jbwZpfd`n6<!mPpsmd[cskdV~c~h}g_`qpawrX~hf6=8"lolrlj`hsWgkfi0hffn]{hk~X9?r:5R<llj.`[sgkamUgcz3?,b]svlkXn`ldSywe<726}51$jU{~biPftno[qwm4:'oRcjmnpz[qwm48'q?k4fhdl[}jipV;=t<7P2bnh[coagVmnbh|ntnp\r1Y4WqyS<:4ftno3>oi|Vigg55agb`vmib?3f|n~kb`w`9svjaXmdzu<:4psmd[`kw|pUdk|h)2*51=wzfmTi`~{y^vkv`uo 8#:86~}of]fiur~W}byi~f'2(37?uthoVof|ywPtipfwm.4!8<0|ah_dosp|Ys`{oxd1=50?3a?uthoVof|ywPtipfwmYf{zoyx%>&1c9svjaXmdzuRzgrdqk[dutm{~#=$?m;qplcZcjx}sTxe|jsi]bwvcu|!8"=o5rne\ahvsqV~c~h}g_`qpawr/; ;o7}|`g^gntqX|axneQnsrgqp95=87;i7}|`g^gntqX|axneQaefcwa-6.9k1{~biPelrw}ZrozlycSckhaug+5,7e3yxdkRkbpu{\pmtb{aUeijo{e)0*5g=wzfmTi`~{y^vkv`uoWgolmyk'3(3g?uthoVof|ywPtipfwmYimnki1=50?;8twi`Wog`<=4psmd[cskdV~c~h}g(1+27>vugnUmyabPtipfwm.6!890|ah_gwohZrozlyc$?'>3:rqkbYa}efTxe|jsi*0-43<x{elSk{cl^vkv`uo4:0;2<o4psmd[cskdV~c~h}g_`qpawr/8 ;j7}|`g^dvhiYs`{oxdRo|sdpw,4/6i2zycjQiumn\pmtb{aUj~k}t)0*5d=wzfmTjxbc_ujqavnXizyn~y&<)0a8twi`Wog`Rzgrdqk[dutm{~7?7>11`9svjaXn|fgSyf}erj\j`af|l";%<o4psmd[cskdV~c~h}g_ogdeqc/9 ;j7}|`g^dvhiYs`{oxdR`jg`vf,7/6i2zycjQiumn\pmtb{aUeijo{e)1*5f=wzfmTjxbc_ujqavnXflmjxh2<:1<5?wbXkea:<6|k_ecweZeh}g~#<$??;sf\`drfWje~by&>)028vaYci}kTob{at)0*55=ulVnjxlQlotlw,6/682xoSio{a^alqkr/< ;;7jPd`vb[firf}6;2<>4re]geqgXkfex1?1119q`Zbf|hUhcx`{<3<24>tcWmkmRm`uov?7;753{nThlzn_bmvjq:3294:<6|k_ecweZeh}g~783;4re]fj3=ulVxxx>5}su58wgosm{x?7~||t59wvpc>3|doihcov78rdjnl?1|~Rolk79tvZekc8:0{Qkauc\gjsi|!:"==5xr^fbpdYdg|d$<'>0:uq[agsiVidycz'2(33?rtXlh~jSnaznu*0-46<{UomyoPcnwmp-2.991|~Rjnt`]`kphs494:<6y}_ecweZeh}g~7=3??;vp\`drfWje~by2=>028swYci}kTob{at=1=57=pzVnjxlQlotlw81<768:0{Qkauc\gjsi|5>596y}_dl5?rtXzz~vLM~8d`9CD}7=N3>1=v];0;0;7?>=9:82<<h5a81gk45>3;0b?<8:59'672=:;:0q^=j:3:0>=<6;;3;=k4n92f8W0c=:1i1<7?<2822b?g>;l1X?h4=8b83>45519;m6l7<f:f1<3<7280:w^:?:3:0>=<6;;3;=k4n92f8rQd1290:6<4jezQ74?4?;321=><600d9e<5c3-8:h7;i;W011?4|}?=1=6{98;28y!d72o1i>5850;14>6<4?rB9=o5U39874g=900j644r$c:96=0<,;886?6:;h0ae?6=3f8h47>5$c096fb<fk;1<65`2b594?"e:38hh6`m1;38?j4d>3:1(o<52bf8jg7=:21d>n;50;&a6?4dl2di=7=4;n0`0?6=,k81>nj4nc390>=h:k91<7*m2;0a<>he93:07b<m2;29 g4=:k20bo?51:9l6g7=83.i>7<m8:la5?4<3f8i<7>5$c096g><fk;1?65`2`d94?"e:38i46`m1;68?l4dn3:17b<7a;29?j4?<3:17d<l3;29?l4ek3:17b<96;29 g4=:>20bo?50:9l633=83.i>7<88:la5?7<3f8=87>5$c0962><fk;1>65`27194?"e:38<46`m1;18?j41:3:1(o<526:8jg7=<21d>;?50;&a6?4002di=7;4;n054?6=,k81>:64nc392>=h:<l1<7*m2;04<>he93=07b<:e;29 g4=:>20bo?58:9l63c=83.i>7<88:la5??<3f8=h7>5$c0962><fk;1m65`27a94?"e:38<46`m1;`8?j41j3:1(o<526:8jg7=k21d>;o50;&a6?4002di=7j4;n05=?6=,k81>:64nc39a>=h:?21<7*m2;04<>he93l07b<97;29 g4=:>20bo?51198k73c290/n?4=799mf4<6921d>8m50;&a6?4002di=7?=;:k17c<72-h96?;>;o`2>5=<a;9n6=4+b38114=ij80:76g=3e83>!d52;?:7cl>:398m75d290/n?4=509mf4<432c9?o4?:%`1>7363gh:6954i31b>5<#j;099<5ab086?>o5;00;6)l=:372?kd62?10e?=7:18'f7<5=81en<48;:k172<72-h96?;>;o`2>==<a;><6=4+b38114=ij80276g=4783>!d52;?:7cl>:`98m722290/n?4=509mf4<e32c9894?:%`1>7363gh:6n54i360>5<#j;099<5ab08g?>o5<;0;6)l=:372?kd62l10e?:>:18'f7<5=81en<4i;:k105<72-h96?;>;o`2>46<3`88:7>5$c09607<fk;1=<54i316>5<#j;099<5ab0826>=n:ho1<75m20a94?7=83:pD??m;%`;>77d3fkm6=44}c77>5<6290;wE<>b:&a<?333f?86=44}c14>5<1=3n86hktH33a?_5?28<p=?4>a;3:>40=910:87o5108:>43=9:0:47?n:`82=?75200::7?::06956<693w/n54=889'1f<2:2.8o7<77:&0b?4?02.jn7oj;h0af?6=3f82i7>5;h0aa?6=3f8947>5;n0`5?6=3`89n7>5;h0:3?6=,k81>464nc394>=n:0<1<7*m2;0:<>he93;07d<65;29 g4=:020bo?52:9j6<2=83.i>7<68:la5?5<3`8im7>5;n0;`?6=3f8h47>5$c096fb<fk;1<65`2b594?"e:38hh6`m1;38?j4d>3:1(o<52bf8jg7=:21d>n;50;&a6?4dl2di=7=4;n0`0?6=,k81>nj4nc390>=h:k91<7*m2;0a<>he93:07b<m2;29 g4=:k20bo?51:9l6g7=83.i>7<m8:la5?4<3f8i<7>5$c096g><fk;1?65`2`d94?"e:38i46`m1;68?l4fk3:1(o<52`f8jg7=821b>ll50;&a6?4fl2di=7?4;h0be?6=,k81>lj4nc396>=n:h31<7*m2;0b`>he93907d<lf;29?j4493:1(o<52218jg7=821d>>>50;&a6?44;2di=7?4;n01b?6=,k81>>=4nc396>=h:;o1<7*m2;007>he93907b<=d;29 g4=::90bo?54:9l6=g=831d>5:50;9j6d4=83.i>7<n3:la5?6<3`8j=7>5$c096d5<fk;1=65f2`294?"e:38j?6`m1;08?l4>n3:1(o<52`18jg7=;21b>n=50;9j6=d=831b>?m50;9j6a6=831d>oj50;9l6f4=831d>?750;9l6f6=831b>om50;9l630=83.i>7<88:la5?6<3f8=97>5$c0962><fk;1=65`27694?"e:38<46`m1;08?j41;3:1(o<526:8jg7=;21d>;<50;&a6?4002di=7:4;n055?6=,k81>:64nc391>=h:?:1<7*m2;04<>he93<07b<:f;29 g4=:>20bo?57:9l60c=83.i>7<88:la5?><3f8=i7>5$c0962><fk;1565`27f94?"e:38<46`m1;c8?j41k3:1(o<526:8jg7=j21d>;l50;&a6?4002di=7m4;n05e?6=,k81>:64nc39`>=h:?31<7*m2;04<>he93o07b<98;29 g4=:>20bo?5f:9l631=83.i>7<88:la5?7732e99i4?:%`1>71?3gh:6<?4;n06g?6=,k81>:64nc3957=<a;396=4+b381=6=ij80;76g=9083>!d52;387cl>:098m7?7290/n?4=929mf4<532c94k4?:%`1>7?43gh:6>54i31e>5<#j;099<5ab083?>o5;l0;6)l=:372?kd62810e?=k:18'f7<5=81en<4=;:k17f<72-h96?;>;o`2>6=<a;9i6=4+b38114=ij80?76g=3`83>!d52;?:7cl>:498m75>290/n?4=509mf4<132c9?54?:%`1>7363gh:6:54i314>5<#j;099<5ab08;?>o5<>0;6)l=:372?kd62010e?:9:18'f7<5=81en<4n;:k100<72-h96?;>;o`2>g=<a;>?6=4+b38114=ij80h76g=4283>!d52;?:7cl>:e98m725290/n?4=509mf4<b32c98<4?:%`1>7363gh:6k54i363>5<#j;099<5ab0824>=n::<1<7*m2;065>he93;:76g=3483>!d52;?:7cl>:008?l45i3:17d<n7;29 g4=:h20bo?50:9j6d0=83.i>7<n8:la5?7<3`8j97>5$c096d><fk;1>65f2`694?"e:38j46`m1;18?l4>k3:1(o<528f8jg7=821b>4l50;&a6?4>l2di=7?4;h0:e?6=,k81>4j4nc396>=n:031<7*m2;0:`>he93907b<7e;29?j44<3:17d<ne;29?g45:3:1=7>50z&a<?333A89=6F=1c9l16<722wi>=650;194?6|,k218l5G2338L77e3A9>7)89:3`e?!3f2;1b?44?::k75?6=3fh?6=44}c027?6=;3:1<v*m8;6b?M4592B9=o5G349'23<5jo1/9l4=;h1:>5<<a=;1<75`b583>>{e:9=1<7=50;2x g>=<h1C>??4H33a?M523-<=6?li;%7b>7=n;00;66g;1;29?jd32900qo<>1;291?6=8r.i47;?;I015>N59k1C?85+6781fc=#=h097d=6:188m6d=831b8<4?::ka7?6=3fh?6=44}c026?6=;3:1<v*m8;6b?M4592B9=o5G349'23<5jo1/9l4=;h1:>5<<a=;1<75`b583>>{e:9<1<7;50;2x g>==91C>??4H33a?M523-<=6?li;%7b>7=n;00;66g<b;29?l262900eo=50;9lf1<722wi><>50;694?6|,k218k5G2338L77e3-?j6?5f3883>>o393:17dl<:188kg2=831vn?>i:187>5<7s-h369h4H302?M46j2.>m7<4i2;94?=n<80;66gm3;29?jd32900qo<?e;290?6=8r.i47:i;I015>N59k1/9l4=;h1:>5<<a=;1<75fb283>>ie<3:17pl=1883>1<729q/n54;f:J164=O:8h0(8o52:k0=?6=3`>:6=44ic194?=hj=0;66sm20:94?2=83:p(o654g9K677<@;;i7);n:39j7<<722c?=7>5;h`0>5<<gk>1<75rb01a>5<3290;w)l7:5d8L7463A8:n6*:a;58m6?=831b8<4?::ka7?6=3fh?6=44}c32f?6==3:1<v*m8;6g?M4592B9=o5+5`81?l5>2900e>j50;9j04<722ci?7>5;n`7>5<<uk;:o7>55;294~"e03>o7E<=1:J15g=#=h097d=6:188m6b=831b8<4?::ka7?6=3fh?6=44}c32`?6==3:1<v*m8;6g?M4592B9=o5+5`81?l5>2900e>j50;9j04<722ci?7>5;n`7>5<<uk;:i7>55;294~"e03>o7E<=1:J15g=#=h097d=6:188m6b=831b8<4?::ka7?6=3fh?6=44}c32b?6==3:1<v*m8;6g?M4592B9=o5+5`81?l5>2900e>j50;9j04<722ci?7>5;n`7>5<<uk;>;7>55;294~"e03>h7E<=1:J15g=#=h097d=6:188m6d=831b?i4?::k75?6=3fh?6=44}c36=?6==3:1<v*m8;6`?M4592B9=o5+5`81?l5>2900e>l50;9j7a<722c?=7>5;n`7>5<<uk;>n7>55;294~"e03>h7E<=1:J15g=#=h097d=6:188m6d=831b?i4?::k75?6=3fh?6=44}c36`?6==3:1<v*m8;6`?M4592B9=o5+5`81?l5>2900e>l50;9j7a<722c?=7>5;n`7>5<<uk;==7>54;294~"e03>m7E<=1:J15g=#=h097d=6:188m17=831bn>4?::ma0?6=3th::=4?:583>5}#j10?j6F=209K64d<,<k1>6g<9;29?l262900eo=50;9lf1<722wi=4k50;794?6|,k218n5G2338L77e3-?j6?5f3883>>o4j3:17d=k:188m17=831dn94?::a5d6=83?1<7>t$c:90f=O:;;0D??m;%7b>7=n;00;66g<b;29?l5c2900e9?50;9lf1<722wi=l<50;794?6|,k218n5G2338L77e3-?j6?5f3883>>o4j3:17d=k:188m17=831dn94?::a5d5=83?1<7>t$c:90f=O:;;0D??m;%7b>7=n;00;66g<b;29?l5c2900e9?50;9lf1<722wi=4750;794?6|,k218n5G2338L77e3-?j6?5f3883>>o4j3:17d=k:188m17=831dn94?::a5<>=83?1<7>t$c:90f=O:;;0D??m;%7b>7=n;00;66g<b;29?l5c2900e9?50;9lf1<722wi=4950;794?6|,k218n5G2338L77e3-?j6?5f3883>>o4j3:17d=k:188m17=831dn94?::a5<0=83?1<7>t$c:915=O:;;0D??m;%7b>2=n;00;66g<b;29?l262900eo=50;9lf1<722wi=:750;694?6|,k218o5G2338L77e3-?j6?5f3883>>o4l3:17d:>:188kg2=831vn<9n:187>5<7s-h369l4H302?M46j2.>m7<4i2;94?=n;m0;66g;1;29?jd32900qo?8b;290?6=8r.i47:m;I015>N59k1/9l4=;h1:>5<<a:n1<75f4083>>ie<3:17pl>7b83>1<729q/n54;b:J164=O:8h0(8o52:k0=?6=3`9o6=44i5394?=hj=0;66sm16f94?2=83:p(o654c9K677<@;;i7);n:39j7<<722c8h7>5;h62>5<<gk>1<75rb0:f>5<2290;w)l7:5a8L7463A8:n6*:a;08m6?=831b?o4?::k0`?6=3`>:6=44oc694?=zj82m6=4::183!d?2<:0D?<>;I02f>"2i3=0e>750;9j7g<722c?=7>5;h`0>5<<gk>1<75rb0;3>5<2290;w)l7:5a8L7463A8:n6*:a;08m6?=831b?o4?::k0`?6=3`>:6=44oc694?=zj83:6=4::183!d?2=i0D?<>;I02f>"2i380e>750;9j7g<722c8h7>5;h62>5<<gk>1<75rb06e>5<2290;w)l7:428L7463A8:n6*:a;58m6?=831b?o4?::k75?6=3`h86=44oc694?=zj8?96=4::183!d?2=i0D?<>;I02f>"2i380e>750;9j7g<722c8h7>5;h62>5<<gk>1<75rb073>5<2290;w)l7:5a8L7463A8:n6*:a;08m6?=831b?o4?::k0`?6=3`>:6=44oc694?=zj8?:6=4::183!d?2=i0D?<>;I02f>"2i380e>750;9j7g<722c8h7>5;h62>5<<gk>1<75rbba94?2=83:p(o654c9K677<@;;i7);n:39j7<<722c8h7>5;h62>5<<gk>1<75rbb`94?2=83:p(o654c9K677<@;;i7);n:39j7<<722c8h7>5;h62>5<<gk>1<75rbbc94?2=83:p(o654c9K677<@;;i7);n:39j7<<722c8h7>5;h62>5<<gk>1<75rbb;94?2=83:p(o654c9K677<@;;i7);n:39j7<<722c8h7>5;h62>5<<gk>1<75rbg094?2=83:p(o654c9K677<@;;i7);n:39j7<<722c8h7>5;h62>5<<gk>1<75rbg394?2=83:p(o654c9K677<@;;i7);n:39j7<<722c8h7>5;h62>5<<gk>1<75rbg294?2=83:p(o654c9K677<@;;i7);n:39j7<<722c8h7>5;h62>5<<gk>1<75rbdd94?2=83:p(o654c9K677<@;;i7);n:39j7<<722c8h7>5;h62>5<<gk>1<75rb02g>5<3290;w)l7:5`8L7463A8:n6*:a;08m6?=831b?i4?::k75?6=3fh?6=44}c33g?6=<3:1<v*m8;6a?M4592B9=o5+5`81?l5>2900e>j50;9j04<722ei87>5;|`24g<72=0;6=u+b987f>N5:81C><l4$4c96>o413:17d=k:188m17=831dn94?::a55g=83>1<7>t$c:90g=O:;;0D??m;%7b>7=n;00;66g<d;29?l262900co:50;9~f`1=83>1<7>t$c:90g=O:;;0D??m;%7b>7=n;00;66g<d;29?l262900co:50;9~f`0=83>1<7>t$c:90g=O:;;0D??m;%7b>7=n;00;66g<d;29?l262900co:50;9~f`3=83>1<7>t$c:90g=O:;;0D??m;%7b>7=n;00;66g<d;29?l262900co:50;9~f`2=83>1<7>t$c:90g=O:;;0D??m;%7b>7=n;00;66g<d;29?l262900co:50;9~f462290?6=4?{%`;>1d<@;8:7E<>b:J01>"1>38ij6*:a;08m6?=831b?i4?::k75?6=3fh?6=44}c330?6=<3:1<v*m8;6a?M4592B9=o5G349'23<5jo1/9l4=;h1:>5<<a:n1<75f4083>>ie<3:17pl>0283>1<729q/n54;b:J164=O:8h0D>;4$7496g`<,<k1>6g<9;29?l5c2900e9?50;9lf1<722wi==<50;694?6|,k218o5G2338L77e3A9>7)89:3`e?!3f2;1b?44?::k0`?6=3`>:6=44oc694?=zjml1<7:50;2x g>=<k1C>??4H33a?M523-<=6?li;%7b>7=n;00;66g<d;29?l262900co:50;9~fac=83>1<7>t$c:90g=O:;;0D??m;I16?!012;hm7);n:39j7<<722c8h7>5;h62>5<<gk>1<75rbef94?2=83:p(o654c9K677<@;;i7E=:;%45>7da3-?j6?5f3883>>o4l3:17d:>:188kg2=831vnim50;694?6|,k218o5G2338L77e3A9>7)89:3`e?!3f2;1b?44?::k0`?6=3`>:6=44oc694?=zjm=1<7:50;2x g>=<k1C>??4H33a?!3f2;1b?44?::k0`?6=3`>:6=44oc694?=zjm<1<7:50;2x g>=<k1C>??4H33a?!3f2;1b?44?::k0`?6=3`>:6=44oc694?=zjm?1<7:50;2x g>=<k1C>??4H33a?!3f2;1b?44?::k0`?6=3`>:6=44oc694?=zjm>1<7:50;2x g>=<k1C>??4H33a?!3f2;1b?44?::k0`?6=3`>:6=44oc694?=zjon1<7:50;2x g>=<k1C>??4H33a?!3f2;1b?44?::k0`?6=3`>:6=44oc694?=zjoi1<7:50;2x g>=<k1C>??4H33a?!3f2;1b?44?::k0`?6=3`>:6=44oc694?=zjoh1<7:50;2x g>=<k1C>??4H33a?!3f2;1b?44?::k0`?6=3`>:6=44oc694?=zjok1<7:50;2x g>=<k1C>??4H33a?!3f2;1b?44?::k0`?6=3`>:6=44oc694?=zj8986=4;:183!d?2=h0D?<>;I02f>"2i380e>750;9j7a<722c?=7>5;n`7>5<<uk;8<7>54;294~"e03>i7E<=1:J15g=#=h097d=6:188m6b=831b8<4?::ma0?6=3th:?l4?:583>5}#j10?n6F=209K64d<,<k1>6g<9;29?l5c2900e9?50;9lf1<722wi=>950;694?6|,k218k5G2338L77e3-?j6:5f3883>>o393:17dl<:188kg2=831vn<=9:187>5<7s-h369h4H302?M46j2.>m794i2;94?=n<80;66gm3;29?jd32900qo?i2;291?6=8r.i47:l;I015>N59k1/9l4=;h1:>5<<a:h1<75f3e83>>o393:17bl;:188yg7a;3:197>50z&a<?2d3A89=6F=1c9'1d<53`926=44i2`94?=n;m0;66g;1;29?jd32900qo?id;291?6=8r.i47:l;I015>N59k1/9l4=;h1:>5<<a:h1<75f3e83>>o393:17bl;:188yg7am3:197>50z&a<?2d3A89=6F=1c9'1d<53`926=44i2`94?=n;m0;66g;1;29?jd32900qo?if;291?6=8r.i47:l;I015>N59k1/9l4=;h1:>5<<a:h1<75f3e83>>o393:17bl;:188yg4783:197>50z&a<?2d3A89=6F=1c9'1d<53`926=44i2`94?=n;m0;66g;1;29?jd32900qo<?1;291?6=8r.i47:l;I015>N59k1/9l4=;h1:>5<<a:h1<75f3e83>>o393:17bl;:188yg47:3:197>50z&a<?2d3A89=6F=1c9'1d<53`926=44i2`94?=n;m0;66g;1;29?jd32900qo<?3;291?6=8r.i47:l;I015>N59k1/9l4=;h1:>5<<a:h1<75f3e83>>o393:17bl;:188yg47<3:197>50z&a<?2d3A89=6F=1c9'1d<53`926=44i2`94?=n;m0;66g;1;29?jd32900qo?i4;291?6=8r.i47:l;I015>N59k1/9l4=;h1:>5<<a:h1<75f3e83>>o393:17bl;:188yg7a=3:197>50z&a<?2d3A89=6F=1c9'1d<53`926=44i2`94?=n;m0;66g;1;29?jd32900qo?i6;291?6=8r.i47:l;I015>N59k1/9l4=;h1:>5<<a:h1<75f3e83>>o393:17bl;:188yg7a?3:197>50z&a<?2d3A89=6F=1c9'1d<53`926=44i2`94?=n;m0;66g;1;29?jd32900qo?i8;291?6=8r.i47:l;I015>N59k1/9l4=;h1:>5<<a:h1<75f3e83>>o393:17bl;:188yg7a13:197>50z&a<?2d3A89=6F=1c9'1d<53`926=44i2`94?=n;m0;66g;1;29?jd32900qo?ia;291?6=8r.i47:l;I015>N59k1/9l4=;h1:>5<<a:h1<75f3e83>>o393:17bl;:188yg7aj3:197>50z&a<?2d3A89=6F=1c9'1d<53`926=44i2`94?=n;m0;66g;1;29?jd32900qo?ic;291?6=8r.i47:l;I015>N59k1/9l4=;h1:>5<<a:h1<75f3e83>>o393:17bl;:188yg7d=3:1h7>50z&a<?d23A89=6F=1c9j75<722c8=7>5;h11>5<<a:91<75f4083>>o3=3:17d:9:188m11=831b854?::k15`<722c9=k4?::ma3?6=3f>?6=44}c3a=?6=l3:1<v*m8;`6?M4592B9=o5f3183>>o493:17d==:188m65=831b8<4?::k71?6=3`>=6=44i5594?=n<10;66g=1d83>>o59o0;66am7;29?j232900qo?l4;29`?6=8r.i47l:;I015>N59k1b?=4?::k05?6=3`996=44i2194?=n<80;66g;5;29?l212900e9950;9j0=<722c9=h4?::k15c<722ei;7>5;n67>5<<uk;h:7>5d;294~"e03h>7E<=1:J15g=n;90;66g<1;29?l552900e>=50;9j04<722c?97>5;h65>5<<a==1<75f4983>>o59l0;66g=1g83>>ie?3:17b:;:188yg7d?3:1h7>50z&a<?d23A89=6F=1c9j75<722c8=7>5;h11>5<<a:91<75f4083>>o3=3:17d:9:188m11=831b854?::k15`<722c9=k4?::ma3?6=3f>?6=44}c3`e?6=l3:1<v*m8;`6?M4592B9=o5f3183>>o493:17d==:188m65=831b8<4?::k71?6=3`>=6=44i5594?=n<10;66g=1d83>>o59o0;66am7;29?j232900qo?l8;29`?6=8r.i47l:;I015>N59k1b?=4?::k05?6=3`996=44i2194?=n<80;66g;5;29?l212900e9950;9j0=<722c9=h4?::k15c<722ei;7>5;n67>5<<uk;h57>5d;294~"e03h>7E<=1:J15g=n;90;66g<1;29?l552900e>=50;9j04<722c?97>5;h65>5<<a==1<75f4983>>o59l0;66g=1g83>>ie?3:17b:;:188yg7dj3:1h7>50z&a<?d23A89=6F=1c9j75<722c8=7>5;h11>5<<a:91<75f4083>>o3=3:17d:9:188m11=831b854?::k15`<722c9=k4?::ma3?6=3f>?6=44}c3ae?6=l3:1<v*m8;`6?M4592B9=o5f3183>>o493:17d==:188m65=831b8<4?::k71?6=3`>=6=44i5594?=n<10;66g=1d83>>o59o0;66am7;29?j232900qo?md;29`?6=8r.i47l:;I015>N59k1b?=4?::k05?6=3`996=44i2194?=n<80;66g;5;29?l212900e9950;9j0=<722c9=h4?::k15c<722ei;7>5;n67>5<<uk;in7>5d;294~"e03h>7E<=1:J15g=n;90;66g<1;29?l552900e>=50;9j04<722c?97>5;h65>5<<a==1<75f4983>>o59l0;66g=1g83>>ie?3:17b:;:188yg7ek3:1h7>50z&a<?d23A89=6F=1c9j75<722c8=7>5;h11>5<<a:91<75f4083>>o3=3:17d:9:188m11=831b854?::k15`<722c9=k4?::ma3?6=3f>?6=44}c3aa?6=l3:1<v*m8;`6?M4592B9=o5f3183>>o493:17d==:188m65=831b8<4?::k71?6=3`>=6=44i5594?=n<10;66g=1d83>>o59o0;66am7;29?j232900qo?mf;29`?6=8r.i47l:;I015>N59k1b?=4?::k05?6=3`996=44i2194?=n<80;66g;5;29?l212900e9950;9j0=<722c9=h4?::k15c<722ei;7>5;n67>5<<uk;h<7>5d;294~"e03h>7E<=1:J15g=n;90;66g<1;29?l552900e>=50;9j04<722c?97>5;h65>5<<a==1<75f4983>>o59l0;66g=1g83>>ie?3:17b:;:188yg7d93:1h7>50z&a<?d23A89=6F=1c9j75<722c8=7>5;h11>5<<a:91<75f4083>>o3=3:17d:9:188m11=831b854?::k15`<722c9=k4?::ma3?6=3f>?6=44}c3`6?6=l3:1<v*m8;`6?M4592B9=o5f3183>>o493:17d==:188m65=831b8<4?::k71?6=3`>=6=44i5594?=n<10;66g=1d83>>o59o0;66am7;29?j232900qo?l3;29`?6=8r.i47l:;I015>N59k1b?=4?::k05?6=3`996=44i2194?=n<80;66g;5;29?l212900e9950;9j0=<722c9=h4?::k15c<722ei;7>5;n67>5<<uk;i<7>55;294~"e03>h7E<=1:J15g=#=h097d=6:188m6d=831b?i4?::k75?6=3fh?6=44}c3bb?6==3:1<v*m8;6`?M4592B9=o5+5`81?l5>2900e>l50;9j7a<722c?=7>5;n`7>5<<uk;ji7>55;294~"e03>h7E<=1:J15g=#=h097d=6:188m6d=831b?i4?::k75?6=3fh?6=44}c3b`?6==3:1<v*m8;6`?M4592B9=o5+5`81?l5>2900e>l50;9j7a<722c?=7>5;n`7>5<<uk;jo7>55;294~"e03>h7E<=1:J15g=#=h097d=6:188m6d=831b?i4?::k75?6=3fh?6=44}c3bf?6==3:1<v*m8;6`?M4592B9=o5+5`81?l5>2900e>l50;9j7a<722c?=7>5;n`7>5<<uk;jm7>55;294~"e03>h7E<=1:J15g=#=h097d=6:188m6d=831b?i4?::k75?6=3fh?6=44}c3b=?6==3:1<v*m8;6`?M4592B9=o5+5`81?l5>2900e>l50;9j7a<722c?=7>5;n`7>5<<uk;j47>55;294~"e03>h7E<=1:J15g=#=h097d=6:188m6d=831b?i4?::k75?6=3fh?6=44}c3a<?6==3:1<v*m8;6`?M4592B9=o5+5`81?l5>2900e>l50;9j7a<722c?=7>5;n`7>5<<uk;i;7>55;294~"e03>h7E<=1:J15g=#=h097d=6:188m6d=831b?i4?::k75?6=3fh?6=44}c3a2?6==3:1<v*m8;6`?M4592B9=o5+5`81?l5>2900e>l50;9j7a<722c?=7>5;n`7>5<<uk;i97>55;294~"e03>h7E<=1:J15g=#=h097d=6:188m6d=831b?i4?::k75?6=3fh?6=44}c3a0?6==3:1<v*m8;6`?M4592B9=o5+5`81?l5>2900e>l50;9j7a<722c?=7>5;n`7>5<<uk;i?7>55;294~"e03>h7E<=1:J15g=#=h097d=6:188m6d=831b?i4?::k75?6=3fh?6=44}c3a6?6==3:1<v*m8;6`?M4592B9=o5+5`81?l5>2900e>l50;9j7a<722c?=7>5;n`7>5<<uk;i=7>55;294~"e03>h7E<=1:J15g=#=h097d=6:188m6d=831b?i4?::k75?6=3fh?6=44}c3b3?6==3:1<v*m8;6`?M4592B9=o5+5`81?l5>2900e>l50;9j7a<722c?=7>5;n`7>5<<uk;j:7>55;294~"e03>h7E<=1:J15g=#=h097d=6:188m6d=831b?i4?::k75?6=3fh?6=44}c021?6=;3:1<v*m8;43?M4592B9=o5+5`824>o2>3:17d;8:188kdb=831vn?>n:180>5<7s-h36;>4H302?M46j2.>m7??;h75>5<<a<=1<75`ae83>>{e91=1<7=50;2x g>=>91C>??4H33a?!3f28i0e8850;9j12<722ejh7>5;|`233<72:0;6=u+b9854>N5:81C><l4$4c95f=n=?0;66g:7;29?jgc2900qo?;8;297?6=8r.i478?;I015>N59k1/9l4>c:k62?6=3`?<6=44o`f94?=zjj>1<7=50;2x g>=>91C>??4H33a?!3f28i0e8850;9j12<722ejh7>5;|``7?6=;3:1<v*m8;43?M4592B9=o5+5`82g>o2>3:17d;8:188kdb=831vnn<50;194?6|,k21:=5G2338L77e3-?j6<m4i4494?=n=>0;66and;29?xdem3:1?7>50z&a<?073A89=6F=1c9'1d<6k2c>:7>5;h74>5<<ghn1<75rbcf94?5=83:p(o65619K677<@;;i7);n:0a8m00=831b9:4?::mb`?6=3thio7>53;294~"e03<;7E<=1:J15g=#=h0:o6g:6;29?l302900clj50;9~f455290?6=4?{%`;>34<@;8:7E<>b:&6e?443`?=6=44i4594?=n=10;66and;29?xd6010;694?:1y'f=<1:2B9><5G20`8 0g=:81b9;4?::k63?6=3`?36=44o`f94?=zj8>26=4;:183!d?2?80D?<>;I02f>"2i38:7d;9:188m01=831b954?::mb`?6=3th:?44?:483>5}#j10=?6F=209K64d<,<k1?l5f5783>>o2?3:17d;7:188m0?=831dmi4?::a5=?=83?1<7>t$c:926=O:;;0D??m;%7b>74<a<<1<75f5683>>o203:17d;6:188kdb=831vn<:n:186>5<7s-h36;=4H302?M46j2.>m7<=;h75>5<<a<=1<75f5983>>o213:17bok:188yg74=3:197>50z&a<?043A89=6F=1c9'1d<582c>:7>5;h74>5<<a<21<75f5883>>ifl3:17pl>2d83>1<729q/n5492:J164=O:8h0(8o5e:k62?6=3`?<6=44i4:94?=him0;66sm16594?3=83:p(o65629K677<@;;i7);n:0`8m00=831b9:4?::k6<?6=3`?26=44o`f94?=zj82:6=4<:183!d?2?:0D?<>;I02f>"2i3h0e8850;9j12<722ejh7>5;|`26a<72<0;6=u+b9857>N5:81C><l4$4c9`>o2>3:17d;8:188m0>=831b944?::mb`?6=3th:>k4?:283>5}#j10=<6F=209K64d<,<k1=n5f5783>>o2?3:17bok:188yg70;3:1?7>50z&a<?073A89=6F=1c9'1d<502c>:7>5;h74>5<<ghn1<75rb037>5<4290;w)l7:728L7463A8:n6*:a;0;?l312900e8950;9lea<722wink4?:283>5}#j10=<6F=209K64d<,<k1=n5f5783>>o2?3:17bok:188ygd>29086=4?{%`;>36<@;8:7E<>b:&6e?7d3`?=6=44i4594?=him0;66sm10c94?3=83:p(o65629K677<@;;i7);n:058m00=831b9:4?::k6<?6=3`?26=44o`f94?=zj8>;6=4::183!d?2?90D?<>;I02f>"2i38>7d;9:188m01=831b954?::k6=?6=3fko6=44}c375?6==3:1<v*m8;40?M4592B9=o5+5`81e>o2>3:17d;8:188m0>=831b944?::mb`?6=3th::;4?:483>5}#j10=?6F=209K64d<,<k1>l5f5783>>o2?3:17d;7:188m0?=831dmi4?::a531=83?1<7>t$c:926=O:;;0D??m;%7b>7g<a<<1<75f5683>>o203:17d;6:188kdb=831vn<87:186>5<7s-h36;=4H302?M46j2.>m7<n;h75>5<<a<=1<75f5983>>o213:17bok:188yg71=3:197>50z&a<?043A89=6F=1c9'1d<312c>:7>5;h74>5<<a<21<75f5883>>ifl3:17pl>3e83>0<729q/n5493:J164=O:8h0(8o52`9j13<722c>;7>5;h7;>5<<a<31<75`ae83>>{e9?o1<7;50;2x g>=>:1C>??4H33a?!3f2;n0e8850;9j12<722c>47>5;h7:>5<<ghn1<75rb007>5<2290;w)l7:718L7463A8:n6*:a;18m00=831b9:4?::k6<?6=3`?26=44o`f94?=zjj:1<7:50;2x g>=>;1C>??4H33a?!3f2;h0e8850;9j12<722c>47>5;ncg>5<<ukhj6=4;:183!d?2?80D?<>;I02f>"2i38i7d;9:188m01=831b954?::mb`?6=3th:>;4?:483>5}#j10=?6F=209K64d<,<k1>n5f5783>>o2?3:17d;7:188m0?=831dmi4?::a57e=83?1<7>t$c:926=O:;;0D??m;%7b>1c<a<<1<75f5683>>o203:17d;6:188kdb=831vn<<m:186>5<7s-h36;=4H302?M46j2.>m784i4494?=n=>0;66g:8;29?l3>2900clj50;9~f40d290>6=4?{%`;>35<@;8:7E<>b:&6e?253`?=6=44i4594?=n=10;66g:9;29?jgc2900qo?9b;297?6=8r.i478?;I015>N59k1/9l4m;h75>5<<a<=1<75`ae83>>{e9;91<7;50;2x g>=>:1C>??4H33a?!3f2<1b9;4?::k63?6=3`?36=44i4;94?=him0;66sm16294?3=83:p(o65629K677<@;;i7);n:0g8m00=831b9:4?::k6<?6=3`?26=44o`f94?=zj8=:6=4::183!d?2?90D?<>;I02f>"2i39?7d;9:188m01=831b954?::k6=?6=3fko6=44}c35b?6==3:1<v*m8;40?M4592B9=o5+5`802>o2>3:17d;8:188m0>=831b944?::mb`?6=3th::94?:583>5}#j10=>6F=209K64d<,<k1>95f5783>>o2?3:17d;7:188kdb=831vn<=j:186>5<7s-h36;=4H302?M46j2.>m7;>;h75>5<<a<=1<75f5983>>o213:17bok:188yg7513:197>50z&a<?043A89=6F=1c9'1d<3;2c>:7>5;h74>5<<a<21<75f5883>>ifl3:17pl>2983>0<729q/n5493:J164=O:8h0(8o51e9j13<722c>;7>5;h7;>5<<a<31<75`ae83>>{e9?n1<7;50;2x g>=>:1C>??4H33a?!3f2;o0e8850;9j12<722c>47>5;h7:>5<<ghn1<75rbb394?3=83:p(o65629K677<@;;i7);n:0d8m00=831b9:4?::k6<?6=3`?26=44o`f94?=zjkh1<7;50;2x g>=>:1C>??4H33a?!3f28l0e8850;9j12<722c>47>5;h7:>5<<ghn1<75rb003>5<3290;w)l7:708L7463A8:n6*:a;a8m00=831b9:4?::k6<?6=3fko6=44}c3b0?6==3:1<v*m8;6`?M4592B9=o5+5`81?l5>2900e>l50;9j7a<722c?=7>5;n`7>5<<uk;>o7>55;294~"e03>h7E<=1:J15g=#=h097d=6:188m6d=831b?i4?::k75?6=3fh?6=44}c3:b?6==3:1<v*m8;6`?M4592B9=o5+5`81?l5>2900e>l50;9j7a<722c?=7>5;n`7>5<<uk;j=7>55;294~"e03>h7E<=1:J15g=#=h097d=6:188m6d=831b?i4?::k75?6=3fh?6=44}c36a?6==3:1<v*m8;6`?M4592B9=o5+5`81?l5>2900e>l50;9j7a<722c?=7>5;n`7>5<<uk;>47>55;294~"e03>h7E<=1:J15g=#=h097d=6:188m6d=831b?i4?::k75?6=3fh?6=44}c36e?6==3:1<v*m8;6`?M4592B9=o5+5`81?l5>2900e>l50;9j7a<722c?=7>5;n`7>5<<uk;3:7>52;294~"e03?i7E<=1:J15g=n=<0;66and;29?xd6<>0;6?4?:1y'f=<2j2B9><5G20`8m03=831dmi4?::a54?=83<1<7>t$c:921=O:;;0D??m;%7b>4d<a<<1<75f5683>>o203:17d;6:188k0b=831dmi4?::a540=8391<7>t$c:924=O:;;0D??m;%7b>7><a<<1<75f5683>>i2l3:17pl>7483>3<729q/n5494:J164=O:8h0(8o5269j13<722c>;7>5;h7;>5<<a<31<75`5e83>>ifl3:17pl>1983>3<729q/n5494:J164=O:8h0(8o5279j13<722c>;7>5;h7;>5<<a<31<75`5e83>>ifl3:17pl>6283>0<729q/n5495:J164=O:8h0(8o54:k62?6=3`?<6=44i4:94?=n=00;66a:d;29?xd6;o0;684?:1y'f=<1=2B9><5G20`8 0g=:01b9;4?::k63?6=3`?36=44i4;94?=h=m0;66sm13394?3=83:p(o65649K677<@;;i7);n:3d8m00=831b9:4?::k6<?6=3`?26=44o4f94?=z{;hj6=49{_0ae>;6;;0>463>3886=>;6;<0>563>2d862>;6:m0>:6s|22094?7dsW8886P=289]6f4<V;i;7S<=8:\1fa=Y:1n0R?m>;_0;a>X51l1U>>?4^313?[45n2T9>h5Q23f897452<901??>:53897612=;01???:538976a2=;01?>j:538977>2=;01??7:538947e2k901<?l:c18947c2k901<?j:c18947a2k90q~<mc;297~X5jj16><?5b29>650=j:1v?6;:181[4?<27:?:4m4:p6f`=839pR?mi;<3;5?3134;=87;9;|q1e`<72<>pR?oj;<03<?5>348;;7=6;<032?5>348:<7=6;<03b?5>348;i7=6;<30f?5>34;:n7=6;<32g?5>34;:h7=6;<32a?5>34;:j7=6;<363?5>34;>57=6;<36f?5>34;>h7=6;<37b?5>34;>>7=6;<364?5>34;>=7=6;<d1>6?<5o;1?452f180=>;bn39270??d;1:?877k39270??b;1:?877i39270??5;1:?877<39270??3;1:?877:39270j8:2;89a0=;016h84<9:?g0?5>34;8?7=6;<304?5>34;8m7=6;<303?5>34;8:7=6;<3e6?5>34;m?7=6;<3e`?5>34;mi7=6;<3eb?5>348;<7=6;<035?5>348;>7=6;<037?5>348;87=6;<3e0?5>34;m97=6;<3e2?5>34;m;7=6;<3e<?5>34;m57=6;<3ee?5>34;mn7=6;<3eg?5>34;i<7=6;<3bb?5>34;ji7=6;<3b`?5>34;jo7=6;<3bf?5>34;jm7=6;<3b=?5>34;j47=6;<3a<?5>34;i;7=6;<3a2?5>34;i97=6;<3a0?5>34;i?7=6;<3a6?5>34;i=7=6;<3b3?5>34;j:7=6;<36g?5>34;>i7=6;<36<?5>34;>m7=6;|q1<d<72;qU>5o4=042>g2<uz8h?7>53gy]6f5<5;;86>74=332>6?<5;;96>74=33:>6?<5;;36>74=042>6?<58<;6>74=0;f>6?<58k;6>74=0c1>6?<58k86>74=0;:>6?<58336>74=0;4>6?<583=6>74=05:>6?<58=j6>74=05a>6?<58=h6>74=05g>6?<582n6>74=0:e>6?<583;6>74=0;2>6?<5ji1?452cc80=>;di39270m6:2;89`1=;016i;4<9:?f1?5>34o?6>74=ed97<=:ll08563kd;1:?8bd2:301kj5389>bf<4127mn7=6;<db>6?<58i>6??j;<3a=?46m27:o94=1d9>5f0=:8o01<m8:33f?87di38:i63>c9815`=:9j31><k4=0aa>77b34;im7<>e:?2fa<59l16=ol520g894dd2;;n70?me;02a>;6jo09=h521b2964c<58i:6??j;<3`6?46m27:o>4=1d9>5d2=;016=4h5389>5d7=;01v?mj:181[4d027:;i4m4:p6fe=838pR?m8;<34g?d33ty9oo4?:3y]6f0<58=i6o:4}r0`e?6=:rT9o85216c9f1=z{;i26=4={_0`0>;6?00i86s|26;94?4|V;<=70?m0;`7?xu5?>0;6?uQ277894ga2k>0q~<86;296~X5>=16=lk5b59~w7122909wS<93:?2ea<e<2wx>::50;0xZ70534;jo7l;;|q136<72;qU>;?4=0ca>g2<uz8<>7>52z\125=:9hk1n95rs352>5<5sW8>j63>a88a0>{t:>:1<7<t^37f?87f03h?7p}=8383>7}Y:?o01<l7:c68yv4?93:1>vP=6e9>5g1=j=1v?6?:181[41k27:n;4m4:p62`=838pR?8m;<3a1?d33ty9;h4?:3y]63g<58h?6o:4}r04`?6=:rT9:4521c19f1=z{;=h6=4={_05<>;6j;0i86s|26`94?4|V;<<70?m1;`7?xu5?h0;6?uQ24f894g02k>0q~<9f;296~X5=j16=l85b59~w7d>2909wS<m3:?25c<e<2wx>o950;0xZ7d534;:i7l;;|q1f3<72;qU>o?4=03g>g2<uz8i97>52z\1f5=:98i1n95rs3`7>5<5sW8jj63>1c8a0>{t:<81<7<t^31e?87d;3>:7p}=5183>7}Y::o01<m=:538yv43n3:1>vP=3e9>5f7=<81v?:j:181[44k27:o=4;1:p61b=838pR?=m;<3ab?263ty98n4?:3y]66g<58hn69?4}r07f?6=:rT9?4521cf904=z{;>j6=4={_00<>;6jj0?=6s|25;94?4|V;9<70?mb;62?xu5=k0;6?uQ255894df2=;0q~<:a;296~X5<?16=nl5409~w73>2909wS<;5:?2gd<392wx>8650;0xZ72334;h57:>;|q112<72;qU>9=4=0a;>17<uz8>:7>52z\107=:9j=18<5rs376>5<5sW8?=63>c7875>{t:<>1<7<t^363?87d=3>:7p}=5283>7}Y::<01<m;:538yv4303:1>vP=349>5g?=<81v?>8:18084703>:70<?7;`7?847>39i7p}=0983>7}::921n95221c913=z{;;96=4<{<027?26348:=7=m;<026?d33ty9=>4?:3y>645=j=16><;5579~w7612908w0<?7;62?847>3h?70<?a;74?xu5980;6>u22039f1=::8818<52207912=z{;:26=4;{<024?d4348;j7l<;<03a?d4348;m7ok;|q14a<728ip1???:c68945e2k901<?m:2f8947d2:n01<?k:2f8947b2:n01<?i:2f894302:n01<;6:2f8943e2:n01<;k:2f8942a2k901<;=:2f894372:n01<;>:2f894542:n01<=?:2f8945f2:n01<=8:c1894512k901<<;:458944d2<=01<<<:4;894472<=01<;l:2f8943b2:n01<;7:2f8943f2:n0q~<?c;2954}::9l1n952f380`>;a939o70h?:2f89``=;m16==j53e9>55e=;m16==l53e9>55g=;m16==;53e9>552=;m16===53e9>554=;m16h:4<d:?g2?5c34n>6>j4=e697a=z{;:i6=4=7z?14`<e<27:j?4<d:?2b6<4l27:ji4<d:?2b`<4l27:jk4<d:?145<4l279<<4<d:?147<4l279<>4<d:?141<4l27:j94<d:?2b0<4l27:j;4<d:?2b2<4l27:j54<d:?2b<<4l27:jl4<d:?2bg<4l27:jn4<d:?2f5<4l27:mk4<d:?2e`<4l27:mi4<d:?2ef<4l27:mo4<d:?2ed<4l27:m44<d:?2e=<4l27:n54<d:?2f2<4l27:n;4<d:?2f0<4l27:n94<d:?2f6<4l27:n?4<d:?2f4<4l27:m:4<d:?2e3<4l2wx><:50;1x977>2k901??7:c1897722hn0q~<>7;2952}::831n9521739f6=:9?:1n>5218g97a=:9h:1?i521`097a=:9h91?i5218;97a=:9021?i5218597a=:90<1n>5216;97a=:9>k1?i5216`97a=:9>i1?i5216f97a=:91o1?i5219d9f6=:90:1?i5218397a=:9h>1?i5218d97a=:9h;1?i5rs335>5<69r79=54m4:?`g?5c34ii6>j4=bc97a=:k008h63j7;1g?8c12:n01h;53e9>a1<4l27oj7=k;<ff>6b<5mn1?i52db80`>;al39o70hl:2f89cd=;m16jl4<d:p56e=838p1<=m:538945b2hn0q~?<b;297~;6;k0i863>34862>;6:m0>;6s|13294?4|58;i69?4=003>db<uz;9>7>52z?25f<3927:>94nd:p573=838p1<?k:53894412hn0q~?=7;296~;69l0?=63>298b`>{t9;k1<7<t=03e>17<588i6lj4}r36b?6=:8q6=8953c9>50?=;k16=8l53c9>50b=;k16=9h53c9>504=;k16=8>53c9>507=;k16=k<53c9>5c5=;k16=kj53c9>5cc=;k16=kh53c9>656=;k16>=?53c9>654=;k16>==53c9>652=;k16=k:53c9>5c3=;k16=k853c9>5c1=;k16=k653c9>5c?=;k16=ko53c9>5cd=;k16=km53c9>57b=im16=>k5599>50e=;k16=8k53c9>50>=;k16=8o53c9~w42e2903w0?:7;62?873n3h?70?;8;74?87313?370?;a;7;?87393?=70?:8;62?873?3?>7p}>5283>40|58?<6o:4=0a6>13<58h269;4=0a7>13<58i=69;4=0a4>13<58ij69;4=0a;>13<58i269;4=0aa>13<58hj69;4=0`g>13<58hi69;4=0``>13<58hn69;4=0`e>13<58i;69;4=0a2>13<58i969;4=0a0>13<5ko19:5213391<=z{8>h6=48{<36=?2634;><7l;;<37<?3134;?57;8;<37e?3034;8h7;7;<36e?263ty:994?:04x943>2k>01<m::54894d>2=<01<m;:54894e12=<01<m8:54894ef2=<01<m7:54894e>2=<01<mm:54894df2=<01<lk:54894de2=<01<ll:54894db2=<01<li:54894e72=<01<m>:54894e52=<01<m<:5489gc==?16ni4:7:p51b=83<p1<;m:53894362k>01<:6:448942f2<301<=k:448943d2=;0q~?:5;295=}:9<h1n9521b7902=:9k318:521b6902=:9j<18:521b5902=:9jk18:521b:902=:9j318:521b`902=:9kk18:521cf902=:9kh18:521ca902=:9ko18:521cd902=:9j:18:521b3902=:9j818:521b1902=:jm0>:63mc;74?876i3?<70?=9;74?xu6<l0;68u214f904=:9<81n95215c913=:9=;1955214g904=z{8?=6=4>8z?21a<e<27o;7:>;<3`1?2?34;i57:7;<3`0?2?34;h:7:7;<3`3?2?34;hm7:7;<3`<?2?34;h57:7;<3`f?2?34;im7:7;<3a`?2?34;in7:7;<3ag?2?34;ii7:7;<3ab?2?34;h<7:7;<3`5?2?34;h>7:7;<3`7?2?34hh6884=00;>01<589m6894}r356?6=;r7::<4;1:?225<3927::84nd:p536=839p1<8?:c6894>62<=01<8<:458yv7f=3:1>>u218g97g=:9h:1?o521`097g=:9h91?o5218;97g=:9021?o5218597g=:90<1?o5219g97g=:91l1?o5218297g=:90;1?o521b7964`<58h26??i;<3`0?46n27:o;4=1g9>5f1=:8l01<mn:33e?87d038:j63>c8815c=:9jh1><h4=0`b>77a34;ih7<>f:?2fg<59o16=om520d894db2;;m70?mf;02b>;6k909=k521b3964`<58i96??i;<3`7?46n27:4<4nd:?2e1<4j27:5k4<b:?2e4<4j2wx=4<50;6x94?b2=;01<79:c6894012<201<7i:538yv7>i3:1=5u218g9f1=:9j?1?=521c;975=:9j>1?=521b4975=:9j=1?=521bc975=:9j21?=521b;975=:9jh1?=521cc975=:9kn1?=521c`975=:9ki1?=521cg975=:9kl1?=521b2975=:9j;1?=521b0975=:9j91?=52164913=:k=0>;63>7686=>;6>m0>56s|18194?2|58k;69?4=0;4>g2<58<=6884=0c2>17<uz;2n7>519y>5d6=j=16=n;5309>5g?=;816=n:5309>5f0=;816=n95309>5fg=;816=n65309>5f?=;816=nl5309>5gg=;816=oj5309>5gd=;816=om5309>5gc=;816=oh5309>5f6=;816=n?5309>5f4=;816=n=5309>g1<2>27h?7;8;<343?3?34;=h7;8;|q2=1<72:q6=l<5409>5<>=j=16=;95599~w4?d290:mv3>a38a0>;6k<08>63>b8806>;6k=08>63>c7806>;6k>08>63>c`806>;6k108>63>c8806>;6kk08>63>b`806>;6jm08>63>bc806>;6jj08>63>bd806>;6jo08>63>c1806>;6k808>63>c3806>;6k:08>63l3;75?8e52<=01<8j:458940d2<=01<9?:4;894162<30q~?65;290~;6i:0?=63>988a0>;6>>0>:63>a5875>{t90n1<7?7{<3b7?d334lo69?4=0a6>65<58h26>=4=0a7>65<58i=6>=4=0a4>65<58ij6>=4=0a;>65<58i26>=4=0aa>65<58hj6>=4=0`g>65<58hi6>=4=0``>65<58hn6>=4=0`e>65<58i;6>=4=0a2>65<58i96>=4=0a0>65<5j819;5216291==:9>;1955rs0:g>5<3s4;257:>;<3:5?d334;357;9;<35<?313ty:4n4?:4y>5<>=<816=4>5b59>5=>==?16=575599>535==?1v<6m:18587>?3>:70?7f;`7?87??3?=70?78;74?87?13?270?98;7;?xu60h0;6:u2184904=:91o1n952195912=:9121955219;912=:9?>19:52194910=z{8=36=4={<34=?2634;<:7ok;|q23`<72;q6=:o5409>53b=im1v<9i:181870j3>:70?9e;cg?xu6090;6?u216a904=:9?l1mi5rs04b>5<5s4;<h7:>;<35f?gc3ty:4?4?:3y>5=c=<816=585ae9~w4>42909w0?7f;62?87??3ko7p}>8583>7}:90:18<5219:9ea=z{82>6=4={<3:5?2634;357ok;|q206<72;q6=9h5409>511=im1v<:9:181872:3>:70?;a;cg?xu6<=0;6?u2142904=:9=21mi5rs066>5<5s4;>=7:>;<37=?gc3tyn?7>55z?`g?2634o<6o:4=c;912=:jh0>;63mb;74?xud03:1:v3lc;`7?870;3?<70?97;74?87103?<70?80;75?87093?=7p}ld;296~;dj3>:70l6:`f8yve0290<w0mm:c6894002<301<8j:448940d2<<01<9?:45894162<=01<8<:4:8yveb2909w0mn:5389gg=im1vn850;4x9fg=j=16=:95579>530==>16=;65589>53b==?16=:;5599~wf`=838p1n75409>fg<fl2wxo84?:6y>g<<e<27:;;4:7:?232<2?27::;4:9:?221<2027::i4:8:?230<212wx==750;7x9c4=<816==j5b59>fc<2?27h<7;8;<a2>01<uzon6=4:{<d1>g2<58>:6874=00;>00<58;=6894=01e>00<uzl86=4={<d2>17<5kl1mi5rsdf94?3|5o;1n952106912=:98k19;5212f912=:9;319;5rsg694?4|5o:18<52c18b`>{tmj0;68u2f18a0>;6<90>463>3e86=>;6900>463>19862>{tn<0;6?u2eg875>;d93ko7p}jb;292~;bn3h?70?;0;7:?87393?<70?>9;7:?87603?<70?=1;7;?xu6880;6?u211f904=:99?1n95rs023>5<5s4;;o7:>;<330?d33ty:<54?:5y>55e=j=16nk4:6:?`4?3134i:6884}rde>5<5s4;;n7:>;<337?d33ty:<:4?:2y>55d=j=16o=4:8:?`5?3?3tymi7>52z?24d<3927:<?4m4:p550=838p1<>n:c689f7==01vil50;0x9`1=<816hk4m4:p`d<72;q6i;4;1:?ga?d33tyn>7>54z?f2?d334h26884=cc913=:jk0>:6s|d883>7}:m<0?=63kd;`7?xub93:1?v3j5;`7?8df2<201ol5599~wa>=838p1h:5409>`f<e<2wxi=4?:3y>a1<e<27in7;6;|qe=?6=:r7:<84;1:?e`?d33tym47>52z?241<3927mo7l;;|qe3?6=:r7:<>4;1:?ef?d33tym:7>52z?247<3927mm7l;;|qg7?6=:r7oj7:>;<f4>g2<uzn96=4={<ff>17<5m<1n95rse394?4|5mn18<52d48a0>{tl90;6?u2db875>;c<3h?7p}j8;296~;c>3>:70ll:`f8yvc>2909w0j::5389gb=im1vho50;0x9a2=<816nh4nd:p55c=838p1km5409>g7<fl2wx==h50;0x9cd=<816o>4nd:p546=838p1ko5409>g1<fl2wx=>:50;0x94542=;01<=::`f8yv74;3:15v3>328a0>;6;;0>;63>3886<>;6;<0>463>2d86<>;6:m0>563>2g863>;6::0>;63>20863>{t9:;1<7=t=013>17<589j69?4=011>db<uz;8<7>59z?275<e<27:??4:6:?27<<2?27:?84:7:?26`<2?27:>i4:8:?26c<2>27:>>4:6:?264<2>2wx=>o50;7x945f2k>01<<;:448944d2<<01<<<:4:894472<<0q~?<8;297~;6;>0?=63>37875>;6;00jh6s|12494?4|589=6o:4=01:>00<uz;ho7>52z?2b7<3927:n44;4:p5a`=838p1<h=:c6894g12=;0q~?k6;296~;6n:0?=63>c5870>{t9l31<7<t=0d0>g2<58k<69?4}r3g3?6=:r7:ji4;1:?2g0<3<2wx=ho50;0x94`c2k>01<l>:538yv7c03:1>v3>fd875>;6k?0?86s|1d`94?4|58ln6o:4=0`1>17<uz;o57>52z?2bc<3927:o:4;4:p5`e=838p1<hi:c6894d42=;0q~?ka;296~;5890?=63>c9870>{t9ln1<7<t=323>g2<58h?69?4}r3gf?6=:r79<<4;1:?2g<<3<2wx=hk50;0x97662k>01<l::538yv7ck3:1>v3=03875>;6kh0?86s|1dd94?4|5;:96o:4=0`5>17<uz;oh7>52z?146<3927:oo4;4:p5c6=838p1?><:c6894d02=;0q~?ke;296~;58=0?=63>b`870>{t9o;1<7<t=327>g2<58h369?4}r3``?6=:r7:j94;1:?2fg<3<2wx=h>50;0x94`32k>01<o7:538yv7dm3:1>v3>f4875>;6jj0?86s|1d394?4|58l>6o:4=0c:>17<uz;hj7>52z?2b3<3927:ni4;4:p5`4=838p1<h9:c6894gf2=;0q~?k0;296~;6n>0?=63>bd870>{t9l91<7<t=0d4>g2<58ki69?4}r3g5?6=:r7:j54;1:?2fc<3<2wx=h:50;0x94`?2k>01<ol:538yv7c:3:1>v3>f8875>;6k90?86s|1d794?4|58l26o:4=0cg>17<uz;o?7>52z?2bd<3927:o<4;4:p5`0=838p1<hn:c6894gb2=;0q~?k4;296~;6nk0?=63>c3870>{t9l=1<7<t=0da>g2<58km69?4}r3g1?6=:r7:jn4;1:?2g6<3<2wx=h650;0x94`d2k>01<l?:538yv47=3:1=9u21c297g=:9hl1?o521`g97g=:9hn1?o521`a97g=:9hh1?o521`c97g=:9h31?o521`:97g=:9k21?o521c597g=:9k<1?o521c797g=:9k>1?o521c197g=:9k81?o521c397g=:9h=1?o521`497g=:9;o1mi5rs04:>5<3s4;<;7ok;<35a?3>34;=n7;9;<35b?3>3ty:8?4?:2y>57`=im16=?:5599>57d==?1v<o;:181870;3?=70?n4;`7?xu6?;0;6?u21619ea=:9?i1955rs07`>5<5s4;:87;9;<36g?d33ty:=>4?:5y>542=im16=?85579>57e==116=>h5599~w4722909w0?>a;7;?876>3?o7p}>1683>1}:98k1945213491==:9;31955210:9ea=z{8;:6=4={<32e?gc34;9n7;6;|q21=<72=q6=9>5579>50>=j=16=<75569>54>==11v<;n:18787383?<70?:a;`7?87613?=70?>8;7:?xu6<90;6?u21529ea=:9:l1945rs062>5<5s4;?=7ok;<30a?303ty::;4?:3y>530=im16=;;5579~w4002909w0?97;cg?871=3?<7p}>6983>7}:9?21mi5217791==z{8<86=4={<351?3>34;=?7;k;|q4<?6=:r7:?i4nd:?27`<2>2wx=::50;1x940b2<201<8i:44894122hn0q~?>2;290~;6:=0>563>27863>;6:k0>;63>188b`>{t>00;6>u213491<=:9;91mi5213:91==z{191<7<t=00`>0?<58;368j4}r5:>5<5s4;9o7ok;<31f?3?3ty3>7>52z?22f<2127:;84:d:p3d<72;q6=;m5ae9>53d==>1v:l50;0x94172hn01<8i:4:8yv1d2909w0?81;cg?871n3?<7p}8d;296~;6>=0jh63>6286=>{t?l0;6?u212g91<=:9:l19i5rs9394?4|58826874=03:>0b<uz=m6=4={<31=?gc34;947;6;|q;4?6=:r7:>=4:8:?264<2l2wx=4h50;0x94?a2k>01<9::448yv7f93:1>v3>a08a0>;6?<0>;6s|14g94?4|58?n6o:4=035>00<uty99?4?:3y]66`<5:=1>>h4$33b>=?<uz8><7>52z\17`=:;>09?h5+20c9=5=z{;>m6=4={_00`>;4?388h6*=1`8:f>{t:=o1<7<t^31`?8502;9h7)<>a;c1?xu5<m0;6?uQ22`8961=::h0(??n:7;8yv43k3:1>vP=3`9>72<5;h1/><o56c9~w72e2909wS<<9:?03?4412.9=l49c:p61g=838pR?=7;<14>75?3-8:m78k;|q10<<72;qU>>94=259661<,;;j6;k4}r06f?6=:rT98:52368102=#:8k1:k5rs37b>5<5sW8?:63<7;072>"59h0<<6s|24;94?4|V;>>70=8:366?!46i3=:7p}=5983>7}Y:=>01>952568 77f2>80q~<:7;296~X5<:16?:4=429'64g=?:1v?;9:181[43:278;7<;2:&15d<0<2wx>8;50;0xZ726349<6?:>;%02e?123ty9994?:3y]616<5:=1>9>4$33b>20<uz8>?7>52z\173=:;>09?;5+20c932=z{;>36=4={_001>;4?38896*=1`84<>{t:ho1<7<t^3cf?8502;kn7)<>a;:7?xu5jh0;6?uQ2cc8961=:kk0(??n:978yv4ek3:1>vP=bb9>72<5jj1/><o5879~w7e42909wS<l3:?03?4d;2.9=l477:p6f`=838pR?mi;<14>7ea3-8:m767;|q13<<72;qU>;84=259630<,;;j65o4}r043?6=:rT9:852368120=#:8k14o5rs355>5<5sW8=863<7;050>"59h03o6s|26794?4|V;<870=8:340?!46i32o7p}=7583>7}Y:?801>952708 77f21o0q~<83;296~X5>816?:4=609'64g=0o1v?9=:181[418278;7<90:&15d<>92wx>:?50;0xZ73a349<6?;i;%02e??53ty9;=4?:3y]60c<5:=1>8k4$33b><5<uz83>7>52z\12`=:;>09:h5+20c9=1=z{;2:6=4={_05`>;4?38=h6*=1`8:1>{t:1:1<7<t^34`?8502;<h7)<>a;;5?xu5?o0;6?uQ27`8961=:?h0(??n:858yv40m3:1>vP=6`9>72<5>h1/><o5999~w71c2909wS<99:?03?4112.9=l469:p62e=838pR?87;<14>70?3-8:m77n;|q13g<72;qU>;94=259631<,;;j64m4}r04e?6=:rT99i5236811a=#:8k15i5rs34e>5<5sW8>o63<7;06g>"59h02i6s|29694?4|V;2?70=8:3:7?!46i33m7p}=8`83>7}Y:1k01>9529c8 77f2h:0q~<m9;296~X5j:16?:4=b29'64g=i81v?l8:181[4e:278;7<m2:&15d<f;2wx>o850;0xZ7d6349<6?l>;%02e?g33ty9n84?:3y]6g6<5:=1>o>4$33b>d3<uz8i87>52z\1ec=:;>09mk5+20c9e3=z{;in6=4={_0`<>;4?38h46*=1`8b3>{t:ji1<7<t^3a4?8502;i<7)<>a;c;?xu5kk0;6?uQ2b48961=:j<0(??n:`;8yv4di3:1>vP=c49>72<5k<1/><o5a`9~w7e>2909wS<l4:?03?4d<2.9=l49a:~j3d22909wE<>b:m2g0=838pD??m;|l5f2<72;qC><l4}o4a<?6=:rB9=o5rn7`:>5<5sA8:n6sa6cc94?4|@;;i7p`9bc83>7}O:8h0qc8mc;296~N59k1vb;lk:181M46j2we:ok50;0xL77e3td=nk4?:3yK64d<ug<h<7>52zJ15g=zf?i:6=4={I02f>{i>j81<7<tH33a?xh1k:0;6?uG20`8yk0d<3:1>vF=1c9~j3e22909wE<>b:m2f0=838pD??m;|l5g2<72;qC><l4}o4`<?6=:rB9=o5rn7a:>5<5sA8:n6sa6bc94?4|@;;i7p`9cc83>7}O:8h0qc8lc;296~N59k1vb;mk:181M46j2we:nk50;0xL77e3td=ok4?:3yK64d<ug<o<7>52zJ15g=zf?n:6=4={I02f>{i>m81<7<tH33a?xh1l:0;6?uG20`8yk0c<3:1>vF=1c9~j3b22909wE<>b:m2a0=838pD??m;|l5`2<72;qC><l4}o4g<?6=:rB9=o5rn7f:>5<5sA8:n6sa6ec94?4|@;;i7p`9dc83>7}O:8h0qc8kc;296~N59k1vb;jk:181M46j2we:ik50;0xL77e3td=hk4?:3yK64d<ug<n<7>52zJ15g=zf?o:6=4={I02f>{i>l81<7<tH33a?xh1m:0;6?uG20`8yk0b<3:1>vF=1c9~j3c22909wE<>b:m2`0=838pD??m;|l5a2<72;qC><l4}o4f<?6=:rB9=o5rn7g:>5<5sA8:n6sa6dc94?4|@;;i7p`9ec83>7}O:8h0qc;l8;295~N59k1vb8hi:182M46j2we:=>50;3xL77e3td=<<4?:0yK64d<ug<;>7>51zJ15g=zf?:86=4>{I02f>{i>9>1<7?tH33a?xh18<0;6<uG20`8yk07>3:1=vF=1c9~j360290:wE<>b:m25>=83;pD??m;|l54<<728qC><l4}o43e?6=9rB9=o5rn72a>5<6sA8:n6sa61a94?7|@;;i7p`90e83>4}O:8h0qc8?e;295~N59k1vb;>i:182M46j2we:<>50;3xL77e3td==<4?:0yK64d<ug<:>7>51zJ15g=zf?;86=4>{I02f>{i>8>1<7?tH33a?xh19<0;6<uG20`8yk06>3:1=vF=1c9~j370290:wE<>b:m24>=83;pD??m;|l55<<728qC><l4}o42e?6=9rB9=o5rn73a>5<6sA8:n6sa60a94?7|@;;i7p`91e83>4}O:8h0qc8>e;295~N59k1vb;?i:182M46j2we:?>50;3xL77e3td=><4?:0yK64d<ug<9>7>51zJ15g=zf?886=4>{I02f>{i>;>1<7?tH33a?xh1:<0;6<uG20`8yk05>3:1=vF=1c9~j340290:wE<>b:m27>=83;pD??m;|l56<<728qC><l4}o41e?6=9rB9=o5rn70a>5<6sA8:n6sa63a94?7|@;;i7p`92e83>4}O:8h0qc8=e;295~N59k1vb;<i:182M46j2we:>>50;3xL77e3td=?<4?:0yK64d<ug<8>7>51zJ15g=zf?986=4>{I02f>{i>:>1<7?tH33a?xh1;<0;6<uG20`8yk04>3:1=vF=1c9~j350290:wE<>b:m26>=83;pD??m;|l57<<728qC><l4}o40e?6=9rB9=o5rn71a>5<6sA8:n6sa62a94?7|@;;i7p`93e83>4}O:8h0qc8<e;295~N59k1vb;=i:182M46j2we:9>50;3xL77e3td=8<4?:0yK64d<ug<?>7>51zJ15g=zf?>86=4>{I02f>{i>=>1<7?tH33a?xh1<<0;6<uG20`8yk03>3:1=vF=1c9~j320290:wE<>b:m21>=83;pD??m;|l50<<728qC><l4}o47e?6=9rB9=o5rn76a>5<6sA8:n6sa65a94?7|@;;i7p`94e83>4}O:8h0qc8;e;295~N59k1vb;:i:182M46j2we:8>50;3xL77e3td=9<4?:0yK64d<ug<>>7>51zJ15g=zf??86=4>{I02f>{i><>1<7?tH33a?xh1=<0;6<uG20`8yk02>3:1=vF=1c9~j330290:wE<>b:m20>=83;pD??m;|l51<<728qC><l4}o46e?6=9rB9=o5rn77a>5<6sA8:n6sa64a94?7|@;;i7p`95e83>4}O:8h0qc8:e;295~N59k1vb;;i:182M46j2we:;>50;3xL77e3td=:<4?:0yK64d<ug<=>7>51zJ15g=zf?<86=4>{I02f>{i>?>1<7?tH33a?xh1><0;6<uG20`8yk01>3:1=vF=1c9~j300290:wE<>b:m23>=83;pD??m;|l52<<728qC><l4}o45e?6=9rB9=o5rn74a>5<6sA8:n6sa67a94?7|@;;i7p`96e83>4}O:8h0qc89e;295~N59k1vb;8i:182M46j2we::>50;3xL77e3td=;<4?:0yK64d<ug<<>7>51zJ15g=zf?=86=4>{I02f>{i>>>1<7?tH33a?xh1?<0;6<uG20`8yk00>3:1=vF=1c9~j310290:wE<>b:m22>=83;pD??m;|l53<<728qC><l4}o44e?6=9rB9=o5rn75a>5<6sA8:n6sa66a94?7|@;;i7p`97e83>4}O:8h0qc88e;295~N59k1vb;9i:182M46j2we:5>50;3xL77e3td=4<4?:0yK64d<ug<3>7>51zJ15g=zf?286=4>{I02f>{i>1>1<7?tH33a?xh10<0;6<uG20`8yk0?>3:1=vF=1c9~j3>0290:wE<>b:m2=>=83;pD??m;|l5<<<728qC><l4}o4;e?6=9rB9=o5rn7:a>5<6sA8:n6sa69a94?7|@;;i7p`98e83>4}O:8h0qc87e;295~N59k1vb;6i:182M46j2we:4>50;3xL77e3td=5<4?:0yK64d<ug<2>7>51zJ15g=zf?386=4>{I02f>{i>0>1<7?tH33a?xh11<0;6<uG20`8yk0>>3:1=vF=1c9~j3?0290:wE<>b:m2<>=83;pD??m;|l5=<<728qC><l4}o4:e?6=9rB9=o5rn7;a>5<6sA8:n6sa68a94?7|@;;i7p`99e83>4}O:8h0qc86e;295~N59k1vb;7i:182M46j2we:l>50;3xL77e3td=m<4?:0yK64d<ug<j>7>51zJ15g=zf?k86=4>{I02f>{i>h>1<7?tH33a?xh1i<0;6<uG20`8yk0f>3:1=vF=1c9~j3g0290:wE<>b:m2d>=83;pD??m;|l5e<<728qC><l4}o4be?6=9rB9=o5rn7ca>5<6sA8:n6sa6`a94?7|@;;i7p`9ae83>4}O:8h0qc8ne;295~N59k1vb;oi:182M46j2we:o>50;3xL77e3td=n<4?:0yK64d<ug<i>7>51zJ15g=zf?h86=4>{I02f>{i>k>1<7?tH33a?x{zuIJHw:jn:6ffgc05=tJKNv>r@ARxyEF
\ No newline at end of file diff --git a/coregen/fifo_xlnx_16x19_2clk.v b/coregen/fifo_xlnx_16x19_2clk.v new file mode 100644 index 000000000..1d633384b --- /dev/null +++ b/coregen/fifo_xlnx_16x19_2clk.v @@ -0,0 +1,169 @@ +/******************************************************************************* +* This file is owned and controlled by Xilinx and must be used * +* solely for design, simulation, implementation and creation of * +* design files limited to Xilinx devices or technologies. Use * +* with non-Xilinx devices or technologies is expressly prohibited * +* and immediately terminates your license. * +* * +* XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" * +* SOLELY FOR USE IN DEVELOPING PROGRAMS AND SOLUTIONS FOR * +* XILINX DEVICES. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION * +* AS ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION * +* OR STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS * +* IMPLEMENTATION IS FREE FROM ANY CLAIMS OF INFRINGEMENT, * +* AND YOU ARE RESPONSIBLE FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE * +* FOR YOUR IMPLEMENTATION. XILINX EXPRESSLY DISCLAIMS ANY * +* WARRANTY WHATSOEVER WITH RESPECT TO THE ADEQUACY OF THE * +* IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OR * +* REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM CLAIMS OF * +* INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * +* FOR A PARTICULAR PURPOSE. * +* * +* Xilinx products are not intended for use in life support * +* appliances, devices, or systems. Use in such applications are * +* expressly prohibited. * +* * +* (c) Copyright 1995-2007 Xilinx, Inc. * +* All rights reserved. * +*******************************************************************************/ +// The synthesis directives "translate_off/translate_on" specified below are +// supported by Xilinx, Mentor Graphics and Synplicity synthesis +// tools. Ensure they are correct for your synthesis tool(s). + +// You must compile the wrapper file fifo_xlnx_16x19_2clk.v when simulating +// the core, fifo_xlnx_16x19_2clk. When compiling the wrapper file, be sure to +// reference the XilinxCoreLib Verilog simulation library. For detailed +// instructions, please refer to the "CORE Generator Help". + +`timescale 1ns/1ps + +module fifo_xlnx_16x19_2clk( + din, + rd_clk, + rd_en, + rst, + wr_clk, + wr_en, + dout, + empty, + full, + rd_data_count, + wr_data_count); + + +input [18 : 0] din; +input rd_clk; +input rd_en; +input rst; +input wr_clk; +input wr_en; +output [18 : 0] dout; +output empty; +output full; +output [4 : 0] rd_data_count; +output [4 : 0] wr_data_count; + +// synthesis translate_off + + FIFO_GENERATOR_V4_3 #( + .C_COMMON_CLOCK(0), + .C_COUNT_TYPE(0), + .C_DATA_COUNT_WIDTH(5), + .C_DEFAULT_VALUE("BlankString"), + .C_DIN_WIDTH(19), + .C_DOUT_RST_VAL("0"), + .C_DOUT_WIDTH(19), + .C_ENABLE_RLOCS(0), + .C_FAMILY("spartan3"), + .C_FULL_FLAGS_RST_VAL(1), + .C_HAS_ALMOST_EMPTY(0), + .C_HAS_ALMOST_FULL(0), + .C_HAS_BACKUP(0), + .C_HAS_DATA_COUNT(0), + .C_HAS_INT_CLK(0), + .C_HAS_MEMINIT_FILE(0), + .C_HAS_OVERFLOW(0), + .C_HAS_RD_DATA_COUNT(1), + .C_HAS_RD_RST(0), + .C_HAS_RST(1), + .C_HAS_SRST(0), + .C_HAS_UNDERFLOW(0), + .C_HAS_VALID(0), + .C_HAS_WR_ACK(0), + .C_HAS_WR_DATA_COUNT(1), + .C_HAS_WR_RST(0), + .C_IMPLEMENTATION_TYPE(2), + .C_INIT_WR_PNTR_VAL(0), + .C_MEMORY_TYPE(2), + .C_MIF_FILE_NAME("BlankString"), + .C_MSGON_VAL(1), + .C_OPTIMIZATION_MODE(0), + .C_OVERFLOW_LOW(0), + .C_PRELOAD_LATENCY(0), + .C_PRELOAD_REGS(1), + .C_PRIM_FIFO_TYPE("512x36"), + .C_PROG_EMPTY_THRESH_ASSERT_VAL(4), + .C_PROG_EMPTY_THRESH_NEGATE_VAL(5), + .C_PROG_EMPTY_TYPE(0), + .C_PROG_FULL_THRESH_ASSERT_VAL(15), + .C_PROG_FULL_THRESH_NEGATE_VAL(14), + .C_PROG_FULL_TYPE(0), + .C_RD_DATA_COUNT_WIDTH(5), + .C_RD_DEPTH(16), + .C_RD_FREQ(1), + .C_RD_PNTR_WIDTH(4), + .C_UNDERFLOW_LOW(0), + .C_USE_DOUT_RST(1), + .C_USE_ECC(0), + .C_USE_EMBEDDED_REG(0), + .C_USE_FIFO16_FLAGS(0), + .C_USE_FWFT_DATA_COUNT(1), + .C_VALID_LOW(0), + .C_WR_ACK_LOW(0), + .C_WR_DATA_COUNT_WIDTH(5), + .C_WR_DEPTH(16), + .C_WR_FREQ(1), + .C_WR_PNTR_WIDTH(4), + .C_WR_RESPONSE_LATENCY(1)) + inst ( + .DIN(din), + .RD_CLK(rd_clk), + .RD_EN(rd_en), + .RST(rst), + .WR_CLK(wr_clk), + .WR_EN(wr_en), + .DOUT(dout), + .EMPTY(empty), + .FULL(full), + .RD_DATA_COUNT(rd_data_count), + .WR_DATA_COUNT(wr_data_count), + .CLK(), + .INT_CLK(), + .BACKUP(), + .BACKUP_MARKER(), + .PROG_EMPTY_THRESH(), + .PROG_EMPTY_THRESH_ASSERT(), + .PROG_EMPTY_THRESH_NEGATE(), + .PROG_FULL_THRESH(), + .PROG_FULL_THRESH_ASSERT(), + .PROG_FULL_THRESH_NEGATE(), + .RD_RST(), + .SRST(), + .WR_RST(), + .ALMOST_EMPTY(), + .ALMOST_FULL(), + .DATA_COUNT(), + .OVERFLOW(), + .PROG_EMPTY(), + .PROG_FULL(), + .VALID(), + .UNDERFLOW(), + .WR_ACK(), + .SBITERR(), + .DBITERR()); + + +// synthesis translate_on + +endmodule + diff --git a/coregen/fifo_xlnx_16x19_2clk.veo b/coregen/fifo_xlnx_16x19_2clk.veo new file mode 100644 index 000000000..2e9af1efa --- /dev/null +++ b/coregen/fifo_xlnx_16x19_2clk.veo @@ -0,0 +1,53 @@ +/******************************************************************************* +* This file is owned and controlled by Xilinx and must be used * +* solely for design, simulation, implementation and creation of * +* design files limited to Xilinx devices or technologies. Use * +* with non-Xilinx devices or technologies is expressly prohibited * +* and immediately terminates your license. * +* * +* XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" * +* SOLELY FOR USE IN DEVELOPING PROGRAMS AND SOLUTIONS FOR * +* XILINX DEVICES. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION * +* AS ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION * +* OR STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS * +* IMPLEMENTATION IS FREE FROM ANY CLAIMS OF INFRINGEMENT, * +* AND YOU ARE RESPONSIBLE FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE * +* FOR YOUR IMPLEMENTATION. XILINX EXPRESSLY DISCLAIMS ANY * +* WARRANTY WHATSOEVER WITH RESPECT TO THE ADEQUACY OF THE * +* IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OR * +* REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM CLAIMS OF * +* INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * +* FOR A PARTICULAR PURPOSE. * +* * +* Xilinx products are not intended for use in life support * +* appliances, devices, or systems. Use in such applications are * +* expressly prohibited. * +* * +* (c) Copyright 1995-2007 Xilinx, Inc. * +* All rights reserved. * +*******************************************************************************/ +// The following must be inserted into your Verilog file for this +// core to be instantiated. Change the instance name and port connections +// (in parentheses) to your own signal names. + +//----------- Begin Cut here for INSTANTIATION Template ---// INST_TAG +fifo_xlnx_16x19_2clk YourInstanceName ( + .din(din), // Bus [18 : 0] + .rd_clk(rd_clk), + .rd_en(rd_en), + .rst(rst), + .wr_clk(wr_clk), + .wr_en(wr_en), + .dout(dout), // Bus [18 : 0] + .empty(empty), + .full(full), + .rd_data_count(rd_data_count), // Bus [4 : 0] + .wr_data_count(wr_data_count)); // Bus [4 : 0] + +// INST_TAG_END ------ End INSTANTIATION Template --------- + +// You must compile the wrapper file fifo_xlnx_16x19_2clk.v when simulating +// the core, fifo_xlnx_16x19_2clk. When compiling the wrapper file, be sure to +// reference the XilinxCoreLib Verilog simulation library. For detailed +// instructions, please refer to the "CORE Generator Help". + diff --git a/coregen/fifo_xlnx_16x19_2clk.xco b/coregen/fifo_xlnx_16x19_2clk.xco new file mode 100644 index 000000000..d0f638026 --- /dev/null +++ b/coregen/fifo_xlnx_16x19_2clk.xco @@ -0,0 +1,82 @@ +############################################################## +# +# Xilinx Core Generator version K.39 +# Date: Fri Sep 11 04:33:27 2009 +# +############################################################## +# +# This file contains the customisation parameters for a +# Xilinx CORE Generator IP GUI. It is strongly recommended +# that you do not manually alter this file as it may cause +# unexpected and unsupported behavior. +# +############################################################## +# +# BEGIN Project Options +SET addpads = False +SET asysymbol = False +SET busformat = BusFormatAngleBracketNotRipped +SET createndf = False +SET designentry = Verilog +SET device = xc3s2000 +SET devicefamily = spartan3 +SET flowvendor = Other +SET formalverification = False +SET foundationsym = False +SET implementationfiletype = Ngc +SET package = fg456 +SET removerpms = False +SET simulationfiles = Behavioral +SET speedgrade = -5 +SET verilogsim = True +SET vhdlsim = False +# END Project Options +# BEGIN Select +SELECT Fifo_Generator family Xilinx,_Inc. 4.3 +# END Select +# BEGIN Parameters +CSET almost_empty_flag=false +CSET almost_full_flag=false +CSET component_name=fifo_xlnx_16x19_2clk +CSET data_count=false +CSET data_count_width=5 +CSET disable_timing_violations=false +CSET dout_reset_value=0 +CSET empty_threshold_assert_value=4 +CSET empty_threshold_negate_value=5 +CSET enable_ecc=false +CSET enable_int_clk=false +CSET fifo_implementation=Independent_Clocks_Distributed_RAM +CSET full_flags_reset_value=1 +CSET full_threshold_assert_value=15 +CSET full_threshold_negate_value=14 +CSET input_data_width=19 +CSET input_depth=16 +CSET output_data_width=19 +CSET output_depth=16 +CSET overflow_flag=false +CSET overflow_sense=Active_High +CSET performance_options=First_Word_Fall_Through +CSET programmable_empty_type=No_Programmable_Empty_Threshold +CSET programmable_full_type=No_Programmable_Full_Threshold +CSET read_clock_frequency=1 +CSET read_data_count=true +CSET read_data_count_width=5 +CSET reset_pin=true +CSET reset_type=Asynchronous_Reset +CSET underflow_flag=false +CSET underflow_sense=Active_High +CSET use_dout_reset=true +CSET use_embedded_registers=false +CSET use_extra_logic=true +CSET valid_flag=false +CSET valid_sense=Active_High +CSET write_acknowledge_flag=false +CSET write_acknowledge_sense=Active_High +CSET write_clock_frequency=1 +CSET write_data_count=true +CSET write_data_count_width=5 +# END Parameters +GENERATE +# CRC: 60b85dda + diff --git a/coregen/fifo_xlnx_16x19_2clk_fifo_generator_v4_3_xst_1.lso b/coregen/fifo_xlnx_16x19_2clk_fifo_generator_v4_3_xst_1.lso new file mode 100644 index 000000000..f1a6f7899 --- /dev/null +++ b/coregen/fifo_xlnx_16x19_2clk_fifo_generator_v4_3_xst_1.lso @@ -0,0 +1,3 @@ +blkmemdp_v6_2 +blk_mem_gen_v2_6 +fifo_generator_v4_3 diff --git a/coregen/fifo_xlnx_16x19_2clk_fifo_generator_v4_3_xst_1.ngc_xst.xrpt b/coregen/fifo_xlnx_16x19_2clk_fifo_generator_v4_3_xst_1.ngc_xst.xrpt new file mode 100644 index 000000000..ef33fff67 --- /dev/null +++ b/coregen/fifo_xlnx_16x19_2clk_fifo_generator_v4_3_xst_1.ngc_xst.xrpt @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<document OS="lin64" product="ISE" version="10.1.03"> + + <!--The data in this file is primarily intended for consumption by Xilinx tools. + The structure and the elements are likely to change over the next few releases. + This means code written to parse this file will need to be revisited each subsequent release.--> + + <application stringID="Xst" timeStamp="Thu Sep 10 21:33:06 2009"> + <section stringID="XST_HDL_SYNTHESIS_REPORT"> + <item dataType="int" stringID="XST_RAMS" value="1"></item> + <item dataType="int" stringID="XST_ADDERSSUBTRACTORS" value="4"></item> + <item dataType="int" stringID="XST_COUNTERS" value="2"> + <item dataType="int" stringID="XST_4BIT_UP_COUNTER" value="2"/> + </item> + <item dataType="int" stringID="XST_REGISTERS" value="32"> + <item dataType="int" stringID="XST_1BIT_REGISTER" value="15"/> + <item dataType="int" stringID="XST_2BIT_REGISTER" value="1"/> + <item dataType="int" stringID="XST_3BIT_REGISTER" value="1"/> + <item dataType="int" stringID="XST_4BIT_REGISTER" value="11"/> + <item dataType="int" stringID="XST_5BIT_REGISTER" value="2"/> + </item> + <item dataType="int" stringID="XST_XORS" value="28"> + <item dataType="int" stringID="XST_1BIT_XOR2" value="28"/> + </item> + </section> + <section stringID="XST_ADVANCED_HDL_SYNTHESIS_REPORT"> + <item dataType="int" stringID="XST_FSMS" value="1"/> + <item dataType="int" stringID="XST_RAMS" value="1"></item> + <item dataType="int" stringID="XST_ADDERSSUBTRACTORS" value="4"></item> + <item dataType="int" stringID="XST_COUNTERS" value="2"> + <item dataType="int" stringID="XST_4BIT_UP_COUNTER" value="2"/> + </item> + <item dataType="int" stringID="XST_REGISTERS" value="107"> + <item dataType="int" stringID="XST_FLIPFLOPS" value="107"/> + </item> + <item dataType="int" stringID="XST_XORS" value="28"> + <item dataType="int" stringID="XST_1BIT_XOR2" value="28"/> + </item> + </section> + <section stringID="XST_FINAL_REGISTER_REPORT"> + <item dataType="int" stringID="XST_REGISTERS" value="126"> + <item dataType="int" stringID="XST_FLIPFLOPS" value="126"/> + </item> + </section> + <section stringID="XST_PARTITION_REPORT"> + <section stringID="XST_PARTITION_IMPLEMENTATION_STATUS"> + <section stringID="XST_NO_PARTITIONS_WERE_FOUND_IN_THIS_DESIGN"/> + </section> + </section> + <section stringID="XST_FINAL_REPORT"> + <section stringID="XST_FINAL_RESULTS"> + <item stringID="XST_TOP_LEVEL_OUTPUT_FILE_NAME" value="/home/matt/coregen/tmp/_cg/fifo_xlnx_16x19_2clk_fifo_generator_v4_3_xst_1.ngc"/> + <item stringID="XST_OUTPUT_FORMAT" value="NGC"/> + <item stringID="XST_OPTIMIZATION_GOAL" value="SPEED"/> + <item stringID="XST_KEEP_HIERARCHY" value="no"/> + </section> + <section stringID="XST_DESIGN_STATISTICS"> + <item stringID="XST_IOS" value="101"/> + </section> + <section stringID="XST_CELL_USAGE"> + <item dataType="int" stringID="XST_BELS" value="66"> + <item dataType="int" stringID="XST_GND" value="1"/> + <item dataType="int" stringID="XST_INV" value="2"/> + <item dataType="int" stringID="XST_LUT2" value="18"/> + <item dataType="int" stringID="XST_LUT2L" value="1"/> + <item dataType="int" stringID="XST_LUT3" value="8"/> + <item dataType="int" stringID="XST_LUT4" value="30"/> + <item dataType="int" stringID="XST_LUT4D" value="3"/> + <item dataType="int" stringID="XST_LUT4L" value="3"/> + </item> + <item dataType="int" stringID="XST_FLIPFLOPSLATCHES" value="126"> + <item dataType="int" stringID="XST_FD" value="4"/> + <item dataType="int" stringID="XST_FDC" value="40"/> + <item dataType="int" stringID="XST_FDCE" value="62"/> + <item dataType="int" stringID="XST_FDP" value="10"/> + <item dataType="int" stringID="XST_FDPE" value="5"/> + </item> + <item dataType="int" stringID="XST_RAMS" value="19"> + <item dataType="int" stringID="XST_RAM16X1D" value="19"/> + </item> + </section> + </section> + <section stringID="XST_DEVICE_UTILIZATION_SUMMARY"> + <item stringID="XST_SELECTED_DEVICE" value="3s2000fg456-5"/> + <item AVAILABLE="20480" dataType="int" stringID="XST_NUMBER_OF_SLICES" value="96"/> + <item AVAILABLE="40960" dataType="int" stringID="XST_NUMBER_OF_SLICE_FLIP_FLOPS" value="126"/> + <item AVAILABLE="40960" dataType="int" stringID="XST_NUMBER_OF_4_INPUT_LUTS" value="103"/> + <item dataType="int" stringID="XST_NUMBER_USED_AS_LOGIC" value="65"/> + <item dataType="int" stringID="XST_NUMBER_USED_AS_RAMS" value="38"/> + <item dataType="int" stringID="XST_NUMBER_OF_IOS" value="101"/> + <item AVAILABLE="333" dataType="int" stringID="XST_NUMBER_OF_BONDED_IOBS" value="0"/> + </section> + <section stringID="XST_PARTITION_RESOURCE_SUMMARY"> + <section stringID="XST_NO_PARTITIONS_WERE_FOUND_IN_THIS_DESIGN"/> + </section> + <section stringID="XST_ERRORS_STATISTICS"> + <item dataType="int" filtered="0" stringID="XST_NUMBER_OF_ERRORS" value="0"/> + <item dataType="int" filtered="0" stringID="XST_NUMBER_OF_WARNINGS" value="73"/> + <item dataType="int" filtered="0" stringID="XST_NUMBER_OF_INFOS" value="10"/> + </section> + </application> + +</document> diff --git a/coregen/fifo_xlnx_16x19_2clk_flist.txt b/coregen/fifo_xlnx_16x19_2clk_flist.txt new file mode 100644 index 000000000..5e1a6ed35 --- /dev/null +++ b/coregen/fifo_xlnx_16x19_2clk_flist.txt @@ -0,0 +1,8 @@ +# Output products list for <fifo_xlnx_16x19_2clk> +fifo_xlnx_16x19_2clk.ngc +fifo_xlnx_16x19_2clk.v +fifo_xlnx_16x19_2clk.veo +fifo_xlnx_16x19_2clk.xco +fifo_xlnx_16x19_2clk_fifo_generator_v4_3_xst_1.ngc_xst.xrpt +fifo_xlnx_16x19_2clk_flist.txt +fifo_xlnx_16x19_2clk_xmdf.tcl diff --git a/coregen/fifo_xlnx_16x19_2clk_readme.txt b/coregen/fifo_xlnx_16x19_2clk_readme.txt new file mode 100644 index 000000000..1b5976555 --- /dev/null +++ b/coregen/fifo_xlnx_16x19_2clk_readme.txt @@ -0,0 +1,39 @@ +The following files were generated for 'fifo_xlnx_16x19_2clk' in directory +/home/matt/gnuradio.git/usrp2/fpga/coregen/: + +fifo_xlnx_16x19_2clk.ngc: + Binary Xilinx implementation netlist file containing the information + required to implement the module in a Xilinx (R) FPGA. + +fifo_xlnx_16x19_2clk.v: + Verilog wrapper file provided to support functional simulation. + This file contains simulation model customization data that is + passed to a parameterized simulation model for the core. + +fifo_xlnx_16x19_2clk.veo: + VEO template file containing code that can be used as a model for + instantiating a CORE Generator module in a Verilog design. + +fifo_xlnx_16x19_2clk.xco: + CORE Generator input file containing the parameters used to + regenerate a core. + +fifo_xlnx_16x19_2clk_fifo_generator_v4_3_xst_1.ngc_xst.xrpt: + Please see the core data sheet. + +fifo_xlnx_16x19_2clk_flist.txt: + Text file listing all of the output files produced when a customized + core was generated in the CORE Generator. + +fifo_xlnx_16x19_2clk_readme.txt: + Text file indicating the files generated and how they are used. + +fifo_xlnx_16x19_2clk_xmdf.tcl: + ISE Project Navigator interface file. ISE uses this file to determine + how the files output by CORE Generator for the core can be integrated + into your ISE project. + + +Please see the Xilinx CORE Generator online help for further details on +generated files and how to use them. + diff --git a/coregen/fifo_xlnx_16x19_2clk_xmdf.tcl b/coregen/fifo_xlnx_16x19_2clk_xmdf.tcl new file mode 100644 index 000000000..8d633e9c2 --- /dev/null +++ b/coregen/fifo_xlnx_16x19_2clk_xmdf.tcl @@ -0,0 +1,68 @@ +# The package naming convention is <core_name>_xmdf +package provide fifo_xlnx_16x19_2clk_xmdf 1.0 + +# This includes some utilities that support common XMDF operations +package require utilities_xmdf + +# Define a namespace for this package. The name of the name space +# is <core_name>_xmdf +namespace eval ::fifo_xlnx_16x19_2clk_xmdf { +# Use this to define any statics +} + +# Function called by client to rebuild the params and port arrays +# Optional when the use context does not require the param or ports +# arrays to be available. +proc ::fifo_xlnx_16x19_2clk_xmdf::xmdfInit { instance } { +# Variable containg name of library into which module is compiled +# Recommendation: <module_name> +# Required +utilities_xmdf::xmdfSetData $instance Module Attributes Name fifo_xlnx_16x19_2clk +} +# ::fifo_xlnx_16x19_2clk_xmdf::xmdfInit + +# Function called by client to fill in all the xmdf* data variables +# based on the current settings of the parameters +proc ::fifo_xlnx_16x19_2clk_xmdf::xmdfApplyParams { instance } { + +set fcount 0 +# Array containing libraries that are assumed to exist +# Examples include unisim and xilinxcorelib +# Optional +# In this example, we assume that the unisim library will +# be magically +# available to the simulation and synthesis tool +utilities_xmdf::xmdfSetData $instance FileSet $fcount type logical_library +utilities_xmdf::xmdfSetData $instance FileSet $fcount logical_library unisim +incr fcount + +utilities_xmdf::xmdfSetData $instance FileSet $fcount relative_path fifo_xlnx_16x19_2clk.ngc +utilities_xmdf::xmdfSetData $instance FileSet $fcount type ngc +incr fcount + +utilities_xmdf::xmdfSetData $instance FileSet $fcount relative_path fifo_xlnx_16x19_2clk.v +utilities_xmdf::xmdfSetData $instance FileSet $fcount type verilog +incr fcount + +utilities_xmdf::xmdfSetData $instance FileSet $fcount relative_path fifo_xlnx_16x19_2clk.veo +utilities_xmdf::xmdfSetData $instance FileSet $fcount type verilog_template +incr fcount + +utilities_xmdf::xmdfSetData $instance FileSet $fcount relative_path fifo_xlnx_16x19_2clk.xco +utilities_xmdf::xmdfSetData $instance FileSet $fcount type coregen_ip +incr fcount + +utilities_xmdf::xmdfSetData $instance FileSet $fcount relative_path fifo_xlnx_16x19_2clk_fifo_generator_v4_3_xst_1.ngc_xst.xrpt +utilities_xmdf::xmdfSetData $instance FileSet $fcount type AnyView +incr fcount + +utilities_xmdf::xmdfSetData $instance FileSet $fcount relative_path fifo_xlnx_16x19_2clk_xmdf.tcl +utilities_xmdf::xmdfSetData $instance FileSet $fcount type AnyView +incr fcount + +utilities_xmdf::xmdfSetData $instance FileSet $fcount associated_module fifo_xlnx_16x19_2clk +incr fcount + +} + +# ::gen_comp_name_xmdf::xmdfApplyParams diff --git a/eth/bench/verilog/.gitignore b/eth/bench/verilog/.gitignore deleted file mode 100644 index 86fc44f92..000000000 --- a/eth/bench/verilog/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/a.out -/*.vcd -/*.sav -/*.lxt diff --git a/eth/bench/verilog/100m.scr b/eth/bench/verilog/100m.scr deleted file mode 100644 index 0dd59b894..000000000 --- a/eth/bench/verilog/100m.scr +++ /dev/null @@ -1,38 +0,0 @@ -// This tests just runs a few packets at 10/100 Mbps and 1 Gbps instead of only the usual 1 Gbps
-
-// Read from register 24 to confirm that Rx CRC check is enabled
-03 00 18 00 01 ff ff
-
-// Set speed to 1000 Mbps for a starter
-01 00 22 00 04
-
-// Setup Tx and Rx MAC addresses and type field to "IP"
-// Set Tx Data at offset 0, length 14 to 123456789ABC CBA987654321 0800
-10 00 00 00 0E 12 34 56 78 9A BC CB A9 87 65 43 21 08 00
-
-// Transmit a 1000-byte frame 1 time - and expect it to be received again!
-20 03 E8 00 01
-
-// Wait (indefinitely) for missing Rx packets
-22 00 00
-
-// Set speed to 100 Mbps - this is 10x slower!
-01 00 22 00 02
-
-// Transmit a 1000-byte frame 1 time - and expect it to be received again!
-20 03 E8 00 01
-
-// Wait (indefinitely) for missing Rx packets
-22 00 00
-
-// Set speed to 10 Mbps - this is yet another 10x slower!
-01 00 22 00 01
-
-// Transmit a 1000-byte frame 1 time - and expect it to be received again!
-20 03 E8 00 01
-
-// Wait (indefinitely) for missing Rx packets
-22 00 00
-
-// Halt
-FF
diff --git a/eth/bench/verilog/Phy_sim.v b/eth/bench/verilog/Phy_sim.v deleted file mode 100644 index f51ddbd82..000000000 --- a/eth/bench/verilog/Phy_sim.v +++ /dev/null @@ -1,113 +0,0 @@ -//////////////////////////////////////////////////////////////////////
-//// ////
-//// Phy_sim.v ////
-//// ////
-//// This file is part of the Ethernet IP core project ////
-//// http://www.opencores.org/projects.cgi/web/ethernet_tri_mode/////
-//// ////
-//// Author(s): ////
-//// - Jon Gao (gaojon@yahoo.com) ////
-//// ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// Copyright (C) 2001 Authors ////
-//// ////
-//// This source file may be used and distributed without ////
-//// restriction provided that this copyright statement is not ////
-//// removed from the file and that any derivative work contains ////
-//// the original copyright notice and the associated disclaimer. ////
-//// ////
-//// This source file is free software; you can redistribute it ////
-//// and/or modify it under the terms of the GNU Lesser General ////
-//// Public License as published by the Free Software Foundation; ////
-//// either version 2.1 of the License, or (at your option) any ////
-//// later version. ////
-//// ////
-//// This source is distributed in the hope that it will be ////
-//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
-//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-//// PURPOSE. See the GNU Lesser General Public License for more ////
-//// details. ////
-//// ////
-//// You should have received a copy of the GNU Lesser General ////
-//// Public License along with this source; if not, download it ////
-//// from http://www.opencores.org/lgpl.shtml ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//
-// CVS Revision History
-//
-// $Log: Phy_sim.v,v $
-// Revision 1.3 2006/11/17 17:53:07 maverickist
-// no message
-//
-// Revision 1.2 2006/01/19 14:07:50 maverickist
-// verification is complete.
-//
-// Revision 1.1.1.1 2005/12/13 01:51:44 Administrator
-// no message
-//
-
-`timescale 1ns/100ps
-
-module Phy_sim(
- input Gtx_clk, // Used only in GMII mode
- output Rx_clk,
- output Tx_clk, // Used only in MII mode
- input Tx_er,
- input Tx_en,
- input [7:0] Txd,
- output Rx_er,
- output Rx_dv,
- output [7:0] Rxd,
- output Crs,
- output Col,
- input [2:0] Speed,
- input Done
-);
-
-//////////////////////////////////////////////////////////////////////
-// this file used to simulate Phy.
-// generate clk and loop the Tx data to Rx data
-// full duplex mode can be verified on loop mode.
-//////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////
-// internal signals
-//////////////////////////////////////////////////////////////////////
-reg Clk_25m; // Used for 100 Mbps mode
-reg Clk_2_5m; // Used for 10 Mbps mode
-
-//wire Rx_clk;
-//wire Tx_clk; // Used only in MII mode
-
- initial
- begin
- #10;
- while ( !Done )
- begin
- #20 Clk_25m = 0;
- #20 Clk_25m = 1;
- end
- end
-
- initial
- begin
- #10;
- while ( !Done )
- begin
- #200 Clk_2_5m = 0;
- #200 Clk_2_5m = 1;
- end
- end
-
- assign Rx_clk = Speed[2] ? Gtx_clk : Speed[1] ? Clk_25m : Speed[0] ? Clk_2_5m : 0;
- assign Tx_clk = Speed[2] ? Gtx_clk : Speed[1] ? Clk_25m : Speed[0] ? Clk_2_5m : 0;
-
- assign Rx_dv = Tx_en;
- assign Rxd = Txd;
- assign Rx_er = Tx_er;
- assign Crs = Tx_en;
- assign Col = 0;
-
-endmodule
diff --git a/eth/bench/verilog/User_int_sim.v b/eth/bench/verilog/User_int_sim.v deleted file mode 100644 index 3f4aa249b..000000000 --- a/eth/bench/verilog/User_int_sim.v +++ /dev/null @@ -1,230 +0,0 @@ -//////////////////////////////////////////////////////////////////////
-//// ////
-//// User_input_sim.v ////
-//// ////
-//// This file is part of the Ethernet IP core project ////
-//// http://www.opencores.org/projects.cgi/web/ethernet_tri_mode/////
-//// ////
-//// Author(s): ////
-//// - Jon Gao (gaojon@yahoo.com) ////
-//// ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// Copyright (C) 2001 Authors ////
-//// ////
-//// This source file may be used and distributed without ////
-//// restriction provided that this copyright statement is not ////
-//// removed from the file and that any derivative work contains ////
-//// the original copyright notice and the associated disclaimer. ////
-//// ////
-//// This source file is free software; you can redistribute it ////
-//// and/or modify it under the terms of the GNU Lesser General ////
-//// Public License as published by the Free Software Foundation; ////
-//// either version 2.1 of the License, or (at your option) any ////
-//// later version. ////
-//// ////
-//// This source is distributed in the hope that it will be ////
-//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
-//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-//// PURPOSE. See the GNU Lesser General Public License for more ////
-//// details. ////
-//// ////
-//// You should have received a copy of the GNU Lesser General ////
-//// Public License along with this source; if not, download it ////
-//// from http://www.opencores.org/lgpl.shtml ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//
-// CVS Revision History
-//
-// $Log: User_int_sim.v,v $
-// Revision 1.3 2006/11/17 17:53:07 maverickist
-// no message
-//
-// Revision 1.2 2006/01/19 14:07:50 maverickist
-// verification is complete.
-//
-// Revision 1.2 2005/12/13 12:15:35 Administrator
-// no message
-//
-// Revision 1.1.1.1 2005/12/13 01:51:44 Administrator
-// no message
-//
-module User_int_sim (
- Reset,
- Clk_user,
- CPU_init_end,
-
- Rx_mac_ra,
- Rx_mac_rd,
- Rx_mac_data,
- Rx_mac_BE,
- Rx_mac_pa,
- Rx_mac_sop,
- Rx_mac_eop,
-
- Tx_mac_wa,
- Tx_mac_wr,
- Tx_mac_data,
- Tx_mac_BE,
- Tx_mac_sop,
- Tx_mac_eop
-);
-
- input Reset;
- input Clk_user;
- input CPU_init_end;
-
- input Rx_mac_ra;
- output Rx_mac_rd;
- input [31:0] Rx_mac_data;
- input [1:0] Rx_mac_BE;
- input Rx_mac_pa;
- input Rx_mac_sop;
- input Rx_mac_eop;
-
- input Tx_mac_wa;
- output reg Tx_mac_wr;
- output reg [31:0] Tx_mac_data;
- output reg [1:0] Tx_mac_BE; // Big endian
- output reg Tx_mac_sop;
- output reg Tx_mac_eop;
-
-//////////////////////////////////////////////////////////////////////
-// Internal signals
-//////////////////////////////////////////////////////////////////////
-
- reg [4:0] operation;
- reg [31:0] data;
- reg Rx_mac_rd;
- reg Start_tran;
-
-//////////////////////////////////////////////////////////////////////
-//generate Tx user data
-//////////////////////////////////////////////////////////////////////
-
- initial
- begin
- operation = 0;
- data = 0;
- end
-
- task SendPacket;
- input [15:0] Length;
- input [7:0] StartByte;
-
- reg [15:0] Counter;
- reg [7:0] TxData;
-
- begin
- Counter=Length;
- TxData = StartByte;
- Tx_mac_sop = 1; // First time
- while ( Counter>0 )
- begin
- while ( !Tx_mac_wa )
- begin
- Tx_mac_wr = 0;
- @( posedge Clk_user );
- end
-
- Tx_mac_data[31:24] = TxData;
- Tx_mac_data[23:16] = TxData+1;
- Tx_mac_data[15:8] = TxData+2;
- Tx_mac_data[ 7:0] = TxData+3;
- TxData = TxData+4;
- if ( Counter<=4 )
- begin
- // Indicate how many bytes are valid
- if ( Counter==4 )
- Tx_mac_BE = 2'b00;
- else
- Tx_mac_BE = Counter;
- Tx_mac_eop = 1;
- end
- Tx_mac_wr = 1;
-
- if ( Counter >= 4 )
- Counter = Counter - 4;
- else
- Counter = 0;
- @( posedge Clk_user );
- Tx_mac_sop = 0;
- end
-
- Tx_mac_eop = 0;
- Tx_mac_wr = 0;
- Tx_mac_data = 32'h0;
- Tx_mac_BE = 2'b00;
- end
- endtask
-
- always @( posedge Clk_user or posedge Reset )
- if (Reset)
- Start_tran <= 0;
- else if (Tx_mac_eop && !Tx_mac_wa)
- Start_tran <= 0;
- else if (Tx_mac_wa)
- Start_tran <= 1;
-
- always @(posedge Clk_user)
- if (Tx_mac_wa && CPU_init_end)
- /* $ip_32W_gen("../data/config.ini",operation,data); */
- ;
- else
- begin
- operation <= 0;
- data <= 0;
- end
-
- initial
- begin
- Tx_mac_sop = 0;
- Tx_mac_eop = 0;
- Tx_mac_wr = 0;
- Tx_mac_data = 32'h0;
- Tx_mac_BE = 2'b00;
-
- #100;
- while ( Reset )
- @( posedge Clk_user );
-
- @( posedge Clk_user );
-
- while ( !CPU_init_end )
- @( posedge Clk_user );
-
- SendPacket( 64, 8'h11 );
- repeat( 20 )
- @( posedge Clk_user );
- SendPacket( 1500, 8'h12 );
-
- end
-
-// assign Tx_mac_data = data;
-// assign Tx_mac_wr = operation[4];
-// assign Tx_mac_sop = operation[3];
-// assign Tx_mac_eop = operation[2];
-// assign Tx_mac_BE = operation[1:0];
-
-//////////////////////////////////////////////////////////////////////
-//verify Rx user data
-//////////////////////////////////////////////////////////////////////
-
- always @ (posedge Clk_user or posedge Reset)
- if (Reset)
- Rx_mac_rd <= 0;
- else if (Rx_mac_ra)
- Rx_mac_rd <= 1;
- else
- Rx_mac_rd <= 0;
-
- always @ (posedge Clk_user )
- if (Rx_mac_pa)
- /* $ip_32W_check( Rx_mac_data,
- {Rx_mac_sop,Rx_mac_eop,Rx_mac_eop?Rx_mac_BE:2'b0});
- */
- ;
-
-endmodule
diff --git a/eth/bench/verilog/error.scr b/eth/bench/verilog/error.scr deleted file mode 100644 index af42634a8..000000000 --- a/eth/bench/verilog/error.scr +++ /dev/null @@ -1,146 +0,0 @@ -// This tests sends 5 packets, injecting a bit error in two of them
-// to verify the Rx CRC check works. The corresponding RMON statistics
-// counter is finally checked to verify that the error was registered
-
-// Read from register 24 to confirm that Rx CRC check is enabled
-03 00 18 00 01 ff ff
-
-// Set speed to 1000 Mbps
-01 00 22 00 04
-
-// Setup Tx and Rx MAC addresses and type field to "IP"
-// Set Tx Data at offset 0, length 14 to 123456789ABC CBA987654321 0800
-10 00 00 00 0E 12 34 56 78 9A BC CB A9 87 65 43 21 08 00
-
-//--- Packets #0 & 1 --------------------------------------------------------
-
-// Transmit a 200-byte frame 1 time - and expect it to be received again!
-20 00 C8 00 01
-
-// Wait (indefinitely) for missing Rx packets
-22 00 00
-
-// Transmit a 200-byte frame 1 time - but expect to receive it with error!
-25 00 C8 00 01
-
-// Inject a single bit error in the packet (data bit 0) - this will cause a CRC error
-23 00 01
-
-// Wait (indefinitely) for missing Rx packets
-22 00 00
-
-//--- Packets #2 & 3 --------------------------------------------------------
-
-// Transmit a 200-byte frame 1 time - and expect it to be received again!
-20 00 C8 00 01
-
-// Wait (indefinitely) for missing Rx packets
-22 00 00
-
-// Transmit a 200-byte frame 1 time - but expect to receive it with error!
-25 00 C8 00 01
-
-// Inject a single bit error in the packet (data bit 7) - this will cause a CRC error
-23 00 80
-
-// Wait (indefinitely) for missing Rx packets
-22 00 00
-
-//--- Packets #4 & 5 --------------------------------------------------------
-
-// Transmit a 200-byte frame 1 time - and expect it to be received again!
-20 00 C8 00 01
-
-// Wait (indefinitely) for missing Rx packets
-22 00 00
-
-// Transmit a 200-byte frame 1 time - but don't expect it to be received again!
-21 00 C8 00 01
-
-// Inject a single bit error in the packet (RxEn) - this will cause a packet discard!
-// (because it happens early in the packet)
-23 01 00
-
-// Wait (indefinitely) for missing Rx packets
-22 00 00
-
-//--- Packets #6 & 7 --------------------------------------------------------
-
-// Transmit a 200-byte frame 1 time - and expect it to be received again!
-20 00 C8 00 01
-
-// Wait (indefinitely) for missing Rx packets
-22 00 00
-
-// Transmit a 200-byte frame 1 time - but don't expect it to be received again!
-21 00 C8 00 01
-
-// Inject a single bit error in the packet (RxEr)
-23 02 00
-
-// Wait (indefinitely) for missing Rx packets
-22 00 00
-
-//--- Packet #8 -------------------------------------------------------------
-
-// Transmit a 200-byte frame 1 time - and expect it to be received again!
-20 00 C8 00 01
-
-// Wait (indefinitely) for missing Rx packets
-22 00 00
-
-//---------------------------------------------------------------------------
-
-// Set CPU_rd_addr to address RxCRCErrCounter
-01 00 1C 00 05
-
-// Assert CPU_rd_apply
-01 00 1D 00 01
-
-// Kill a little time while waiting for CPU_rd_grant to assert...
-02 00 1E
-02 00 1E
-02 00 1E
-02 00 1E
-
-// Confirm that CPU_rd_grant is asserted
-03 00 1E 00 01 ff ff
-
-// Read & check low part of RxCRCErrCounter (0x0002)
-03 00 1F 00 02 ff ff
-
-// Read & check high part of RxCRCErrCounter (0x0000)
-03 00 20 00 00 ff ff
-
-// Negate CPU_rd_apply
-01 00 1D 00 00
-
-//---------------------------------------------------------------------------
-
-// Set CPU_rd_addr to address RxTooShortTooLongCounter
-01 00 1C 00 07
-
-// Assert CPU_rd_apply
-01 00 1D 00 01
-
-// Kill a little time while waiting for CPU_rd_grant to assert...
-02 00 1E
-02 00 1E
-02 00 1E
-02 00 1E
-
-// Confirm that CPU_rd_grant is asserted
-03 00 1E 00 01 ff ff
-
-// Read & check low part of RxTooShortTooLongCounter (0x0002)
-03 00 1F 00 02 ff ff
-
-// Read & check high part of RxTooShortTooLongCounter (0x0000)
-03 00 20 00 00 ff ff
-
-// Negate CPU_rd_apply
-01 00 1D 00 00
-
-
-// Halt
-FF
diff --git a/eth/bench/verilog/files.lst b/eth/bench/verilog/files.lst deleted file mode 100644 index 6175a4d43..000000000 --- a/eth/bench/verilog/files.lst +++ /dev/null @@ -1,42 +0,0 @@ -../../rtl/verilog/MAC_rx/Broadcast_filter.v
-../../rtl/verilog/MAC_rx/CRC_chk.v
-../../rtl/verilog/MAC_rx/MAC_rx_add_chk.v
-../../rtl/verilog/MAC_rx/MAC_rx_ctrl.v
-../../rtl/verilog/MAC_rx/MAC_rx_FF.v
-
-../../rtl/verilog/MAC_tx/CRC_gen.v
-../../rtl/verilog/MAC_tx/flow_ctrl.v
-../../rtl/verilog/MAC_tx/MAC_tx_addr_add.v
-../../rtl/verilog/MAC_tx/MAC_tx_ctrl.v
-../../rtl/verilog/MAC_tx/MAC_tx_FF.v
-../../rtl/verilog/MAC_tx/Ramdon_gen.v
-
-../../rtl/verilog/miim/eth_clockgen.v
-../../rtl/verilog/miim/eth_outputcontrol.v
-../../rtl/verilog/miim/eth_shiftreg.v
-
-../../rtl/verilog/RMON/RMON_addr_gen.v
-../../rtl/verilog/RMON/RMON_ctrl.v
-../../rtl/verilog/RMON/RMON_dpram.v
-
-../../rtl/verilog/TECH/duram.v
-../../rtl/verilog/TECH/eth_clk_div2.v
-../../rtl/verilog/TECH/eth_clk_switch.v
-
-../../rtl/verilog/TECH/xilinx/BUFGMUX.v
-../../rtl/verilog/TECH/xilinx/RAMB16_S36_S36.v
-
-../../rtl/verilog/Clk_ctrl.v
-../../rtl/verilog/eth_miim.v
-../../rtl/verilog/MAC_rx.v
-../../rtl/verilog/MAC_top.v
-../../rtl/verilog/MAC_tx.v
-../../rtl/verilog/Phy_int.v
-../../rtl/verilog/Reg_int.v
-../../rtl/verilog/RMON.v
-
-../../bench/verilog/Phy_sim.v
-../../bench/verilog/User_int_sim.v
-../../bench/verilog/host_sim.v
-../../bench/verilog/xlnx_glbl.v
-../../bench/verilog/tb_top.v
diff --git a/eth/bench/verilog/host_sim.v b/eth/bench/verilog/host_sim.v deleted file mode 100644 index 55abb8508..000000000 --- a/eth/bench/verilog/host_sim.v +++ /dev/null @@ -1,82 +0,0 @@ -module host_sim(
- input Reset,
- input Clk_reg,
- output reg CSB,
- output reg WRB,
- output reg CPU_init_end,
- output reg [15:0] CD_in,
- input [15:0] CD_out,
- output reg [7:0] CA
-);
-
-////////////////////////////////////////
-
-task CPU_init;
- begin
- CA = 0;
- CD_in = 0;
- WRB = 1;
- CSB = 1;
- end
-endtask
-
-////////////////////////////////////////
-
-task CPU_wr;
- input [6:0] Addr;
- input [15:0] Data;
- begin
- CA = {Addr,1'b0};
- CD_in = Data;
- WRB = 0;
- CSB = 0;
- #20;
- CA = 0;
- CD_in = 0;
- WRB = 1;
- CSB = 1;
- #20;
- end
-endtask
-
-/////////////////////////////////////////
-
-task CPU_rd;
- input [6:0] Addr;
- begin
- CA = {Addr,1'b0};
- WRB = 1;
- CSB = 0;
- #20;
- CA = 0;
- WRB = 1;
- CSB = 1;
- #20;
- end
-endtask
-
-/////////////////////////////////////////
-
-integer i;
-
-reg [31:0] CPU_data [255:0];
-reg [7:0] write_times;
-reg [7:0] write_add;
-reg [15:0] write_data;
-
-initial
- begin
- CPU_init;
- CPU_init_end=0;
- //$readmemh("../data/CPU.vec",CPU_data);
- //{write_times,write_add,write_data}=CPU_data[0];
- {write_times,write_add,write_data}='b0;
- #90;
- for (i=0;i<write_times;i=i+1)
- begin
- {write_times,write_add,write_data}=CPU_data[i];
- CPU_wr(write_add[6:0],write_data);
- end
- CPU_init_end=1;
- end
-endmodule
diff --git a/eth/bench/verilog/icomp.bat b/eth/bench/verilog/icomp.bat deleted file mode 100644 index 11e221e08..000000000 --- a/eth/bench/verilog/icomp.bat +++ /dev/null @@ -1 +0,0 @@ -iverilog -I ..\..\rtl\verilog -c files.lst
diff --git a/eth/bench/verilog/isim.bat b/eth/bench/verilog/isim.bat deleted file mode 100644 index e77969659..000000000 --- a/eth/bench/verilog/isim.bat +++ /dev/null @@ -1 +0,0 @@ -vvp a.out %*
diff --git a/eth/bench/verilog/jumbo_err.scr b/eth/bench/verilog/jumbo_err.scr deleted file mode 100644 index b0177f474..000000000 --- a/eth/bench/verilog/jumbo_err.scr +++ /dev/null @@ -1,40 +0,0 @@ -// This test performs transmission & reception of several Jumbo-frame of ~2Kbytes
-// In one of the frames an error is injected to allow analysis of how the
-// MAC Rx interface reacts to errors in long packets
-
-// Read from register 24 to confirm that Rx CRC check is enabled
-03 00 18 00 01 ff ff
-
-// Set speed to 1000 Mbps
-01 00 22 00 04
-
-// Setup Tx and Rx MAC addresses and type field to "IP"
-// Set Tx Data at offset 0, length 14 to 123456789ABC CBA987654321 0800
-10 00 00 00 0E 12 34 56 78 9A BC CB A9 87 65 43 21 08 00
-
-// Transmit a 2049-byte frame 2 times - and expect them to be received again!
-20 08 02 00 02
-
-// Wait (indefinitely) for missing Rx packets
-22 00 00
-
-// Transmit a 2049-byte frame 1 time - but expect to receive it with error!
-25 08 02 00 01
-
-// Delay 256 NOPs to time the error injection to be late in the packet
-0F 01 00
-
-// Inject a single bit error in the packet (data bit 0)
-23 01 00
-
-// Wait (indefinitely) for missing Rx packets
-22 00 00
-
-// Transmit a 2049-byte frame 2 times - and expect them to be received again!
-20 08 01 00 02
-
-// Wait (indefinitely) for missing Rx packets
-22 00 00
-
-// Halt
-FF
diff --git a/eth/bench/verilog/jumbos.scr b/eth/bench/verilog/jumbos.scr deleted file mode 100644 index f48870bd5..000000000 --- a/eth/bench/verilog/jumbos.scr +++ /dev/null @@ -1,27 +0,0 @@ -// This test performs transmission & reception of several Jumbo-frames of ~2Kbytes each
-// At the same time it demonstrates the wire-speed capabilities of the core
-
-// Read from register 24 to confirm that Rx CRC check is enabled
-03 00 18 00 01 ff ff
-
-// Set speed to 1000 Mbps
-01 00 22 00 04
-
-// Setup Tx and Rx MAC addresses and type field to "IP"
-// Set Tx Data at offset 0, length 14 to 123456789ABC CBA987654321 0800
-10 00 00 00 0E 12 34 56 78 9A BC CB A9 87 65 43 21 08 00
-
-// Transmit a 2047-byte frame 3 times - and expect them to be received again!
-20 07 ff 00 03
-// Transmit a 2048-byte frame 3 times - and expect them to be received again!
-20 08 00 00 03
-// Transmit a 2049-byte frame 3 times - and expect them to be received again!
-20 08 01 00 03
-// Transmit a 2050-byte frame 3 times - and expect them to be received again!
-20 08 02 00 03
-
-// Wait (indefinitely) for missing Rx packets
-22 00 00
-
-// Halt
-FF
diff --git a/eth/bench/verilog/mdio.scr b/eth/bench/verilog/mdio.scr deleted file mode 100644 index 8ad9969b9..000000000 --- a/eth/bench/verilog/mdio.scr +++ /dev/null @@ -1,52 +0,0 @@ -// Read from register 24 to confirm that Rx CRC check is enabled
-03 00 18 00 01 ff ff
-
-// Set speed to 1000 Mbps
-01 00 22 00 04
-
-// Set MDIO clock (MDC) divider to 4 to speed up test
-01 00 23 00 04
-03 00 23 00 04 ff ff
-
-// Check default (reset) values in new (added) MDIO registers
-//03 00 23 00 64 ff ff
-03 00 24 00 00 ff ff
-03 00 25 00 00 ff ff
-03 00 26 00 00 ff ff
-03 00 27 00 00 ff ff
-03 00 28 00 00 ff ff
-
-// Set RGAD=0x00 (all zeroes), FIAD=0x1f (all ones), check it
-// - these values allows easy recognition in the waveform
-01 00 25 00 1f
-03 00 25 00 1f ff ff
-
-// Now start the read operation by writing a 1 to the MIICOMMAND[1] - RSTAT
-01 00 24 00 02
-03 00 24 00 02 ff ff
-
-// Delay for 768 NOP
-0F 03 00
-
-// Check that the read operation has completed
-03 00 28 00 00 ff ff
-
-// Set RGAD=0x1f (all ones), FIAD=0x00 (all zeroes), check it
-// - these values allows easy recognition in the waveform
-01 00 25 1f 00
-03 00 25 1f 00 ff ff
-// Set MIITX_DATA = 0xAAAA, check it
-01 00 26 AA AA
-03 00 26 AA AA ff ff
-// Check MIISTATUS - must still be zero
-03 00 28 00 00 ff ff
-
-// Now start the write operation by writing a 1 to the MIICOMMAND[2] - WCTRLDATA
-01 00 24 00 04
-03 00 24 00 04 ff ff
-
-// Delay for 768 NOP
-0F 03 00
-
-// Check that the write operation has completed
-03 00 28 00 00 ff ff
diff --git a/eth/bench/verilog/miim_model.v b/eth/bench/verilog/miim_model.v deleted file mode 100644 index 936d99a80..000000000 --- a/eth/bench/verilog/miim_model.v +++ /dev/null @@ -1,14 +0,0 @@ - -// Skeleton PHY interface simulator - -module miim_model(input mdc_i, - inout mdio, - input phy_resetn_i, - input phy_clk_i, - output phy_intn_o, - output [2:0] speed_o); - - assign phy_intn_o = 1; // No interrupts - assign speed_o = 3'b100; // 1G mode - -endmodule // miim_model diff --git a/eth/bench/verilog/misc.scr b/eth/bench/verilog/misc.scr deleted file mode 100644 index 092362964..000000000 --- a/eth/bench/verilog/misc.scr +++ /dev/null @@ -1,92 +0,0 @@ -// Read from register 24 to confirm that Rx CRC check is enabled
-03 00 18 00 01 ff ff
-
-// Set speed to 1000 Mbps
-01 00 22 00 04
-
-// Write MAC address 12 35 56 78 9A BC to Rx Address buffer
-01 00 10 00 00
-01 00 0f 00 12
-01 00 11 00 01
-01 00 11 00 00
-01 00 10 00 01
-01 00 0f 00 34
-01 00 11 00 01
-01 00 11 00 00
-01 00 10 00 02
-01 00 0f 00 56
-01 00 11 00 01
-01 00 11 00 00
-01 00 10 00 03
-01 00 0f 00 78
-01 00 11 00 01
-01 00 11 00 00
-01 00 10 00 04
-01 00 0f 00 9A
-01 00 11 00 01
-01 00 11 00 00
-01 00 10 00 05
-01 00 0f 00 BC
-01 00 11 00 01
-01 00 11 00 00
-
-// Write 1 to register 14, MAC_rx_add_chk_en
-// This turns on the Rx Destination MAC address filter
-01 00 0e 00 01
-
-// Setup Tx and Rx MAC addresses and type field to "IP"
-// Set Tx Data at offset 0, length 14 to 123456789ABC CBA987654321 0800
-// (i.e. Destination MAC address is 123456789ABC matching the above)
-10 00 00 00 0E 12 34 56 78 9A BC CB A9 87 65 43 21 08 00
-
-// Transmit a 60-byte frame 1 time - and expect it to be received again!
-20 00 3C 00 01
-// Transmit a 61-byte frame 1 time - and expect it to be received again!
-20 00 3D 00 01
-// Transmit a 62-byte frame 1 time - and expect it to be received again!
-20 00 3E 00 01
-// Transmit a 63-byte frame 1 time - and expect it to be received again!
-20 00 3F 00 01
-// Transmit a 64-byte frame 1 time - and expect it to be received again!
-20 00 40 00 01
-
-// Transmit a 500-byte frame 1 time - and expect it to be received again!
-20 01 4C 00 01
-
-// Transmit a 1500-byte frame 1 time - and expect it to be received again!
-20 05 DC 00 01
-
-// Transmit a 1514-byte frame 1 time - and expect it to be received again!
-20 05 EA 00 01
-
-// Transmit a 60-byte frame 3 times - and expect them to be received again!
-20 00 3C 00 03
-// Transmit a 61-byte frame 3 times - and expect them to be received again!
-20 00 3D 00 03
-// Transmit a 62-byte frame 3 times - and expect them to be received again!
-20 00 3E 00 03
-// Transmit a 63-byte frame 3 times - and expect them to be received again!
-20 00 3F 00 03
-// Transmit a 64-byte frame 3 times - and expect them to be received again!
-20 00 40 00 03
-
-// Transmit a 1510-byte frame 1 time - and expect it to be received again!
-20 05 E6 00 01
-
-// Wait (indefinitely) for missing Rx packets
-22 00 00
-
-// Change Tx MAC to something different - we won't receive frames with this ID
-10 00 00 00 06 11 22 33 44 55 66
-
-// Transmit a 60 byte frame 3 times - but don't expect them to be received!
-21 00 3C 00 03
-
-//// Change Tx MAC back to 12 34 56 78 9A BC
-10 00 00 00 06 12 34 56 78 9A BC
-
-// Transmit a 60 byte frame 3 times - and expect them to be received again!
-20 00 3C 00 03
-
-// Wait (indefinitely) for missing Rx packets
-22 00 00
diff --git a/eth/bench/verilog/pause.scr b/eth/bench/verilog/pause.scr deleted file mode 100644 index be74027e3..000000000 --- a/eth/bench/verilog/pause.scr +++ /dev/null @@ -1,45 +0,0 @@ -// This test demonstrates the ability to transmit a PAUSE frame, and the effect of
-// a PAUSE frame on the receiver
-
-// Read from register 24 to confirm that Rx CRC check is enabled
-03 00 18 00 01 ff ff
-
-// Set speed to 1000 Mbps
-01 00 22 00 04
-
-// Setup Tx and Rx MAC addresses and type field to "IP"
-// Set Tx Data at offset 0, length 14 to 123456789ABC CBA987654321 0800
-10 00 00 00 0E 12 34 56 78 9A BC CB A9 87 65 43 21 08 00
-
-// Set PAUSE quanta to 256 - corresponding to a pause of 256x512 = 128Kb = 16KB
-01 00 03 01 00
-
-// Enable the transmitter to send a PAUSE frame
-01 00 02 00 01
-
-// Enable the transmitter to react to received PAUSE frames
-01 00 0b 00 01
-
-// Expect to receive a PAUSE frame with quanta 256
-24 01 00
-
-// Transmit a 512-byte frame 1 time - and expect it to be received again!
-20 02 00 00 01
-
-// Request the transmission of a PAUSE frame - it will loopback to ourselves and delay
-// further transmission for a period of 16 KB, causing a significant (visible) delay
-// between first and second 512-byte frame!
-01 00 0c 00 01
-
-// - now this second time, we will experience a delay
-// Transmit a 512-byte frame 1 time - and expect it to be received again!
-20 02 00 00 01
-// - and a final 3rd time
-// Transmit a 512-byte frame 1 time - and expect it to be received again!
-20 02 00 00 01
-
-// Wait (indefinitely) for missing Rx packets
-22 00 00
-
-// Halt
-FF
diff --git a/eth/bench/verilog/tb_top.v b/eth/bench/verilog/tb_top.v deleted file mode 100644 index e54bc201b..000000000 --- a/eth/bench/verilog/tb_top.v +++ /dev/null @@ -1,1057 +0,0 @@ -`timescale 1 ns / 1 ps
-
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// tb_top.v ////
-//// ////
-//// This file is part of the Ethernet IP core project ////
-//// http://www.opencores.org/projects.cgi/web/ethernet_tri_mode/////
-//// ////
-//// Author(s): ////
-//// - Jon Gao (gaojon@yahoo.com) ////
-//// ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// Copyright (C) 2001 Authors ////
-//// ////
-//// This source file may be used and distributed without ////
-//// restriction provided that this copyright statement is not ////
-//// removed from the file and that any derivative work contains ////
-//// the original copyright notice and the associated disclaimer. ////
-//// ////
-//// This source file is free software; you can redistribute it ////
-//// and/or modify it under the terms of the GNU Lesser General ////
-//// Public License as published by the Free Software Foundation; ////
-//// either version 2.1 of the License, or (at your option) any ////
-//// later version. ////
-//// ////
-//// This source is distributed in the hope that it will be ////
-//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
-//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-//// PURPOSE. See the GNU Lesser General Public License for more ////
-//// details. ////
-//// ////
-//// You should have received a copy of the GNU Lesser General ////
-//// Public License along with this source; if not, download it ////
-//// from http://www.opencores.org/lgpl.shtml ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//
-// CVS Revision History
-//
-// $Log: tb_top.v,v $
-// Revision 1.3 2006/01/19 14:07:51 maverickist
-// verification is complete.
-//
-// Revision 1.2 2005/12/16 06:44:13 Administrator
-// replaced tab with space.
-// passed 9.6k length frame test.
-//
-// Revision 1.1.1.1 2005/12/13 01:51:44 Administrator
-// no message
-//
-
-module tb_top;
-
- //-------------------- Instantiate Xilinx glbl module ----------------------
- // - this is needed to get ModelSim to work because e.g. I/O buffer models
- // refer directly to glbl.GTS and similar signals
-
- wire GSR;
- wire GTS;
- xlnx_glbl glbl( .GSR( GSR ), .GTS( GTS ) );
-
- reg VLOG_ExitSignal = 0;
- reg Done = 0;
- reg Error = 0;
-
- //-------------------------------------------------------------------------
-
- // System signals
- wire Reset;
- reg Clk_125M;
- reg Clk_user;
-
- reg RST_I;
- reg CLK_I;
- reg STB_I;
- reg CYC_I;
- reg [6:0] ADR_I;
- reg WE_I;
- reg [15:0] DAT_I;
- wire [15:0] DAT_O;
- wire ACK_O;
-
- // User interface (Rx)
- wire Rx_mac_ra;
- reg Rx_mac_rd = 0;
- wire [31:0] Rx_mac_data;
- wire [1:0] Rx_mac_BE;
- wire Rx_mac_pa;
- wire Rx_mac_sop;
- wire Rx_mac_err;
- wire Rx_mac_eop;
-
- // User interface (Tx)
- wire Tx_mac_wa;
- reg Tx_mac_wr = 0;
- reg [31:0] Tx_mac_data = 32'bx;
- reg [1:0] Tx_mac_BE = 2'bx;
- reg Tx_mac_sop = 1'bx;
- reg Tx_mac_eop = 1'bx;
-
- // PHY interface (GMII/MII)
- wire Gtx_clk;
- wire Rx_clk;
- wire Tx_clk;
- wire Tx_er;
- wire Tx_en;
- wire [7:0] Txd;
- wire Rx_er;
- wire Rx_dv;
- wire [7:0] Rxd;
- wire Crs;
- wire Col;
-
- // PHY int host interface
-
- wire Line_loop_en;
- wire [2:0] Speed;
-
- // MDIO interface
- wire Mdio; // MII Management Data In
- wire Mdc; // MII Management Data Clock
-
- //-------------------------------------------------------------------------
-
- // Generate generic reset signal from Wishbone specific one
- assign Reset = RST_I;
-
- MAC_top U_MAC_top(
- // System signals
- .Clk_125M ( Clk_125M ),
- .Clk_user ( Clk_user ),
- .Speed ( Speed ),
-
- // Wishbone compliant core host interface
- .RST_I ( RST_I ),
- .CLK_I ( CLK_I ),
- .STB_I ( STB_I ),
- .CYC_I ( CYC_I ),
- .ADR_I ( ADR_I ),
- .WE_I ( WE_I ),
- .DAT_I ( DAT_I ),
- .DAT_O ( DAT_O ),
- .ACK_O ( ACK_O ),
-
- // User (packet) interface
- .Rx_mac_ra ( Rx_mac_ra ),
- .Rx_mac_rd ( Rx_mac_rd ),
- .Rx_mac_data( Rx_mac_data ),
- .Rx_mac_BE ( Rx_mac_BE ),
- .Rx_mac_pa ( Rx_mac_pa ),
- .Rx_mac_sop ( Rx_mac_sop ),
- .Rx_mac_err ( Rx_mac_err ),
- .Rx_mac_eop ( Rx_mac_eop ),
-
- .Tx_mac_wa ( Tx_mac_wa ),
- .Tx_mac_wr ( Tx_mac_wr ),
- .Tx_mac_data( Tx_mac_data ),
- .Tx_mac_BE ( Tx_mac_BE ),
- .Tx_mac_sop ( Tx_mac_sop ),
- .Tx_mac_eop ( Tx_mac_eop ),
-
- // PHY interface (GMII/MII)
- .Gtx_clk ( Gtx_clk ),
- .Rx_clk ( Rx_clk ),
- .Tx_clk ( Tx_clk ),
- .Tx_er ( Tx_er ),
- .Tx_en ( Tx_en ),
- .Txd ( Txd ),
- .Rx_er ( Rx_er ),
- .Rx_dv ( Rx_dv ),
- .Rxd ( Rxd ),
- .Crs ( Crs ),
- .Col ( Col ),
-
- // MDIO interface (to PHY)
- .Mdio ( Mdio ),
- .Mdc ( Mdc )
- );
-
- reg [15:0] InjectError;
- reg InjectErrorDone;
- reg [15:0] TxError;
- wire Tx_er_Modified;
- wire Tx_en_Modified;
- wire [7:0] Txd_Modified;
-
- Phy_sim U_Phy_sim(
- .Gtx_clk( Gtx_clk ),
- .Rx_clk ( Rx_clk ),
- .Tx_clk ( Tx_clk ),
- .Tx_er ( Tx_er_Modified ),
- .Tx_en ( Tx_en_Modified ),
- .Txd ( Txd_Modified ),
- .Rx_er ( Rx_er ),
- .Rx_dv ( Rx_dv ),
- .Rxd ( Rxd ),
- .Crs ( Crs ),
- .Col ( Col ),
- .Speed ( Speed ),
- .Done ( Done )
- );
-
- integer TxTrackPreAmble;
-
- always @( posedge Reset or posedge Tx_clk )
- if ( Reset )
- TxTrackPreAmble <= 0;
- else
- if ( ~Tx_en )
- TxTrackPreAmble <= 0;
- else
- TxTrackPreAmble <= TxTrackPreAmble + 1;
-
- // Asserted after the Destination MAC address in the packet
- wire TxInPayload = Tx_en & (TxTrackPreAmble > (7+6));
- assign Tx_er_Modified = Tx_er ^ ( TxError[9] & TxInPayload );
- assign Tx_en_Modified = Tx_en ^ ( TxError[8] & TxInPayload );
- assign Txd_Modified = Txd ^ ( TxError[7:0] & {8{TxInPayload}} );
-
- always @( posedge Reset or posedge Tx_clk )
- if ( Reset )
- begin
- InjectError <= 0;
- InjectErrorDone <= 0;
- TxError <= 'b0;
- end
- else
- if ( InjectError )
- begin
- TxError <= InjectError;
- InjectError <= 0;
- InjectErrorDone <= TxInPayload;
- end
- else if ( TxInPayload || InjectErrorDone )
- begin
- TxError <= 8'h00;
- InjectErrorDone <= 0;
- end
-
- //-------------------------------------------------------------------------
- // Track pause on Tx interface
-
- reg TxEnSeenOnce;
- integer TxTrackPause;
-
- always @( posedge Reset or posedge Tx_clk )
- if ( Reset )
- begin
- TxEnSeenOnce <= 0;
- TxTrackPause <= 0;
- end
- else
- if ( Tx_en )
- begin
- if ( TxEnSeenOnce && (TxTrackPause >= 64) ) // 512 bits
- $display( "IDLE period on Tx interface ended after %0d Tx clocks (%0d bits, tick ~ %0d)",
- TxTrackPause,
- (Speed == 4) ? TxTrackPause*8 : TxTrackPause*4,
- (Speed == 4) ? TxTrackPause*8/512 : TxTrackPause*4/512 );
- TxEnSeenOnce <= 1;
- TxTrackPause <= 0;
- end
- else
- TxTrackPause <= TxTrackPause + 1;
-
- //-------------------------------------------------------------------------
- // Host access routines (register read & write)
- //-------------------------------------------------------------------------
-
- task HostInit;
- begin
- RST_I <= 1;
-
- STB_I <= 0;
- CYC_I <= 0;
- ADR_I <= 'b0;
- WE_I <= 0;
- DAT_I <= 'b0;
-
- #100 RST_I <= 0;
-
- // Wait a couple of clock edges before continuing to allow
- // internal logic to get out of reset
- repeat( 2 )
- @( posedge CLK_I );
- end
- endtask
-
- task HostWriteReg;
- input [6:0] Addr;
- input [15:0] Data;
- begin
- @( posedge CLK_I );
- ADR_I <= Addr;
- DAT_I <= Data;
- WE_I <= 1;
- STB_I <= 1;
- CYC_I <= 1;
-
- @( posedge CLK_I );
-
- while ( ~ACK_O )
- @( posedge CLK_I );
-
- STB_I <= 0;
- CYC_I <= 0;
- end
- endtask
-
- task HostReadReg;
- input [6:0] Addr;
- output [15:0] Data;
- begin
- @( posedge CLK_I );
- ADR_I <= Addr;
- WE_I <= 0;
- STB_I <= 1;
- CYC_I <= 1;
-
- @( posedge CLK_I );
-
- while ( ~ACK_O )
- @( posedge CLK_I );
-
- Data = DAT_O;
- STB_I <= 0;
- CYC_I <= 0;
- end
- endtask
-
- //-------------------------------------------------------------------------
- // User interface access routines (packet Tx and Rx)
- //-------------------------------------------------------------------------
-
- `define FIFOSIZE 10000
-
- integer FIFO_WrPtr = 0;
- integer FIFO_RdPtr = 0;
- integer FIFO_ElementCount = 0;
- reg [35:0] FIFO_Data[0:`FIFOSIZE];
-
- function FIFO_Empty;
- input Dummy;
- begin
- if ( FIFO_ElementCount > 0 )
- FIFO_Empty = 0;
- else
- FIFO_Empty = 1;
- end
- endfunction
-
- function FIFO_Full;
- input Dummy;
- begin
- if ( FIFO_ElementCount < `FIFOSIZE )
- FIFO_Full = 0;
- else
- FIFO_Full = 1;
- end
- endfunction
-
- task FIFO_Wr;
- input [35:0] Data;
-
- begin
- if ( !FIFO_Full(0) )
- begin
- FIFO_Data[ FIFO_WrPtr ] = Data;
- FIFO_WrPtr = (FIFO_WrPtr + 1) % `FIFOSIZE;
- FIFO_ElementCount = FIFO_ElementCount + 1;
- end
- else
- begin
- $display( "ERROR: FIFO_Wr() - FIFO overflow!" );
- Error = 1;
- $finish;
- end
- end
- endtask
-
- task FIFO_Rd;
- output [35:0] Data;
-
- begin
- if ( !FIFO_Empty(0) )
- begin
- Data = FIFO_Data[ FIFO_RdPtr ];
- FIFO_RdPtr = (FIFO_RdPtr + 1) % `FIFOSIZE;
- FIFO_ElementCount = FIFO_ElementCount - 1;
- end
- else
- begin
- $display( "ERROR: FIFO_Rd() - Reading from empty FIFO!" );
- Error = 1;
- $finish;
- end
- end
- endtask
-
- //-------------------------------------------------------------------------
-
- `define TXDATALEN 8000
- reg [7:0] TxData[0:`TXDATALEN-1];
- reg [7:0] TxAltData[0:`TXDATALEN-1];
-
- // By default change payload after Ethernet Header
- reg [15:0] TxHeaderLength = 14;
-
- real TxStartTime;
- integer TxPacketCount = 0;
- integer TxByteCount;
-
- task SendPacket;
- input [15:0] Length;
- // 0: Don't write to FIFO, 1: Write to FIFO, 2: Write Alternate to FIFO, 3: Write IGNORE to FIFO
- input [1:0] Wr2FIFO;
-
- reg [15:0] Counter;
- integer TxIndex;
- integer i;
-
- reg [31:0] Tx_fifo_data;
-
- begin
- @( posedge Clk_user ); #1;
-
- TxPacketCount = TxPacketCount + 1;
- TxByteCount = TxByteCount + Length;
-
- Counter=Length;
- TxIndex = 0;
- Tx_mac_sop = 1; // First time
-
- if ( TxStartTime == 0 )
- TxStartTime = $realtime;
-
- while ( Counter>0 )
- begin
- while ( !Tx_mac_wa )
- begin
- Tx_mac_wr = 0;
- @( posedge Clk_user ); #1;
- end
-
- Tx_mac_data[31:24] = TxData[ TxIndex ];
- Tx_mac_data[23:16] = TxData[ TxIndex+1 ];
- Tx_mac_data[15:8] = TxData[ TxIndex+2 ];
- Tx_mac_data[ 7:0] = TxData[ TxIndex+3 ];
-
- // Default take data from regular tx buffer
- Tx_fifo_data = Tx_mac_data;
- if ( Wr2FIFO==2 )
- begin
- // Put content of Alternate Tx buffer on Rx expectancy queue
- if ( (TxIndex+0)<TxHeaderLength )
- Tx_fifo_data[31:24] = TxAltData[ TxIndex ];
- if ( (TxIndex+1)<TxHeaderLength )
- Tx_fifo_data[23:16] = TxAltData[ TxIndex+1 ];
- if ( (TxIndex+2)<TxHeaderLength )
- Tx_fifo_data[15:8] = TxAltData[ TxIndex+2 ];
- if ( (TxIndex+3)<TxHeaderLength )
- Tx_fifo_data[ 7:0] = TxAltData[ TxIndex+3 ];
- end
-
- for ( i=0; i<4; i=i+1 )
- begin
- if ( TxIndex >= TxHeaderLength )
- TxData[ TxIndex ] = TxData[ TxIndex ] + 1;
- TxIndex = TxIndex+1;
- end
-
- if ( Counter<=4 )
- begin
- // Indicate how many bytes are valid
- if ( Counter==4 )
- Tx_mac_BE = 2'b00;
- else
- Tx_mac_BE = Counter;
- Tx_mac_eop = 1;
- end
- else
- begin
- Tx_mac_BE = 2'b00;
- Tx_mac_eop = 0;
- end
-
- casez ( Wr2FIFO )
- 1,
- 2: FIFO_Wr( { Tx_mac_sop, Tx_mac_eop, Tx_mac_BE, Tx_fifo_data } );
- 3: // Ignore
- begin
- FIFO_Wr( { 2'b11, 2'b00, 32'h00000000 } );
- Wr2FIFO = 0;
- end
- endcase
-
- Tx_mac_wr = 1;
-
- if ( Counter >= 4 )
- Counter = Counter - 4;
- else
- Counter = 0;
- @( posedge Clk_user ); #1;
- Tx_mac_sop = 0;
- end
-
- Tx_mac_sop = 1'bx;
- Tx_mac_eop = 1'bx;
- Tx_mac_wr = 0;
- Tx_mac_data = 32'bx;
- Tx_mac_BE = 2'bx;
- end
- endtask
-
- //-------------------------------------------------------------------------
-
- reg Negate_Rx_mac_rd;
-
- always @( posedge Clk_user or posedge Reset )
- if ( Reset )
- Rx_mac_rd <= 0;
- else if ( Rx_mac_ra & ~Negate_Rx_mac_rd )
- Rx_mac_rd <= 1;
- else
- Rx_mac_rd <= 0;
-
- real RxStartTime;
- integer RxPacketCount;
- integer RxByteCount;
-
- reg InPacket;
- integer RxPacketLength;
- reg IgnoreUntilNextERR;
-
- always @( posedge Clk_user or posedge Reset )
- if ( Reset )
- begin
- InPacket = 0;
- RxPacketCount = 0;
- Negate_Rx_mac_rd <= 0;
- IgnoreUntilNextERR = 0;
- end
- else
- begin
- Negate_Rx_mac_rd <= 0;
-
- if ( Rx_mac_pa )
- begin : RxWord
- reg [35:0] RxData;
- reg [35:0] Expected;
- reg [35:0] Mask;
-
- RxData = { Rx_mac_sop, Rx_mac_eop, Rx_mac_BE, Rx_mac_data };
- casez ( Rx_mac_BE )
- 2'b01: Mask = 36'hfff000000;
- 2'b10: Mask = 36'hfffff0000;
- 2'b11: Mask = 36'hfffffff00;
- default: Mask = 36'hfffffffff;
- endcase
-
- // Retrieve expected packet data
-
- if ( !IgnoreUntilNextERR )
- begin
- FIFO_Rd( Expected );
- if ( Expected[35] & Expected[34] )
- begin
- // Both SOP & EOP are asserted in expectancy data
- // - this means that we should ignore all data received until next EOP
- $display( "The payload of this packet will be IGNORED - and an ERROR must be signalled!" );
- IgnoreUntilNextERR = 1;
- end
- end
- if ( IgnoreUntilNextERR )
- Mask = 36'h000000000;
-
- //$display( "DEBUG: RxData=0x%0x, Expected=0x%0x", RxData, Expected );
-
- if ( (RxData & Mask) !== (Expected & Mask) )
- begin
- $display( "ERROR: Receiving unexpected packet data: Got 0x%0x, expected 0x%0x (Mask=0x%0x)",
- RxData, Expected, Mask );
- Error = 1;
- end
-
- if ( InPacket )
- begin
- if ( Rx_mac_eop )
- begin
- // Ensure Rx_mac_rd is negated for one clock
- Negate_Rx_mac_rd <= 1;
- if ( Rx_mac_BE==2'b00 )
- RxPacketLength = RxPacketLength + 4;
- else
- RxPacketLength = RxPacketLength + Rx_mac_BE;
- $display( "Rx packet #%0d of length %0d ends",
- RxPacketCount,
- RxPacketLength );
- RxPacketCount = RxPacketCount + 1;
- RxByteCount = RxByteCount + RxPacketLength;
- InPacket = 0;
- end
- else
- RxPacketLength = RxPacketLength + 4;
- end
- else
- begin
- if ( Rx_mac_sop )
- begin
- RxPacketLength = 4;
- $display( "Rx packet #%0d begins: 0x%08x", RxPacketCount, Rx_mac_data );
- InPacket = 1;
- if ( RxStartTime == 0 )
- RxStartTime = $realtime;
- end
- else
- begin
- $display( "ERROR: Unexpectedly reading from Rx FIFO while not receiving a packet!" );
- Error = 1;
- end
- end
-
- if ( Rx_mac_err )
- begin
- if ( !Rx_mac_eop )
- begin
- $display( "ERROR: Rx_mac_err was asserted without Rx_mac_eop also being asserted!" );
- Error = 1;
- end
- if ( IgnoreUntilNextERR )
- $display( "Info: Rx_mac_err was asserted as expected!" );
- else
- begin
- $display( "ERROR: Rx_mac_err was unexpectedly asserted!" );
- Error = 1;
- end
- IgnoreUntilNextERR = 0;
- end
- end
- end
-
- //-------------------------------------------------------------------------
- // Script handling
- //-------------------------------------------------------------------------
-
- integer PC;
-
- task ScriptWriteReg;
- input [15:0] Addr;
- input [15:0] Data;
-
- begin
- $display( "WriteReg( 0x%04x, 0x%04x )", Addr, Data );
- HostWriteReg( Addr, Data );
- end
- endtask
-
- task ScriptReadReg;
- input [15:0] Addr;
-
- reg [15:0] Data;
-
- begin
- $write( "ReadReg( 0x%04x ): ", Addr );
- HostReadReg( Addr, Data );
- $display( "0x%04x", Data );
- end
- endtask
-
- task ScriptReadRegAndMatch;
- input [15:0] Addr;
- input [15:0] Data;
- input [15:0] Mask;
-
- reg [15:0] Read;
-
- begin
- $write( "ReadRegAndMatch( 0x%04x, 0x%04x, 0x%04x ): ", Addr, Data, Mask );
-
- HostReadReg( Addr, Read );
- $display( "0x%04x, masked=0x%04x", Read, Read & Mask );
-
- if ( Data !== (Read & Mask) )
- begin
- $display( "Error: Unexpected data read" );
- Error = 1;
- end
- end
- endtask
-
- integer RxExpectPacketCount = 0;
-
- task ScriptSendPacket;
- input [15:0] Length;
- // 0: Don't receive, 1: Receive & match, 2: Receive & match alternate, 3: Receive & ignore
- input [1:0] ExpectToRx;
-
- begin
- $display( "ScriptSendPacket( 0x%04x, %0d )", Length, ExpectToRx );
- SendPacket( Length, ExpectToRx );
- if ( ExpectToRx != 0 )
- RxExpectPacketCount = RxExpectPacketCount + 1;
- end
- endtask
-
- `define SCRIPTLEN 10000
- integer i;
- reg [7:0] Script[0:`SCRIPTLEN-1];
-
- function [15:0] Get16bit;
- input Dummy;
-
- reg [15:0] Data;
-
- begin
- Data[15:8] = Script[PC];
- Data[7:0] = Script[PC+1];
- PC = PC+2;
-
- Get16bit = Data;
- end
- endfunction
-
- task ExecuteScript;
-
- reg [7:0] OpCode;
- reg [15:0] Addr;
- reg [15:0] Data;
- reg [15:0] Length;
- reg [15:0] Count;
- reg [15:0] Mask;
-
- reg ScriptDone;
-
- begin
- ScriptDone = 0;
- Error = 0;
- PC = 0;
-
- while ( !ScriptDone )
- begin
- OpCode = Script[PC];
- //$write( "PC=%0d, OpCode=%02x: ", PC, OpCode );
- PC = PC+1;
-
- casez ( OpCode )
- 8'h00: // NOP
- begin
-// $display( "NOP" );
- #10;
- end
- 8'h01: // Write
- begin
- Addr = Get16bit(i);
- Data = Get16bit(i);
- ScriptWriteReg( Addr, Data );
- end
- 8'h02: // Read
- begin
- Addr = Get16bit(i);
- ScriptReadReg( Addr );
- end
- 8'h03: // Read & match
- begin
- Addr = Get16bit(i);
- Data = Get16bit(i);
- Mask = Get16bit(i);
- ScriptReadRegAndMatch( Addr, Data, Mask );
- end
-
- 8'h0f: // Delay
- begin
- Count = Get16bit(i);
- $display( "Delay %0d", Count );
- while ( Count > 0 )
- begin
- #10;
- Count = Count - 1;
- end
- end
-
- 8'h10: // Setup Tx Data
- begin
- Addr = Get16bit(i);
- Length = Get16bit(i);
- $write( "TxData( 0x%04x ), length=%0d: ", Addr, Length );
- while ( Length != 0 )
- begin
- TxData[Addr] = Script[PC];
- $write( " 0x%02x", Script[PC] );
- PC = PC + 1;
- Addr = Addr + 1;
- Length = Length - 1;
- end
- $display( "" );
- end
-
- 8'h11: // Setup Alternative Tx Data
- begin
- Addr = Get16bit(i);
- Length = Get16bit(i);
- $write( "TxAltData( 0x%04x ), length=%0d: ", Addr, Length );
- while ( Length != 0 )
- begin
- TxAltData[Addr] = Script[PC];
- $write( " 0x%02x", Script[PC] );
- PC = PC + 1;
- Addr = Addr + 1;
- Length = Length - 1;
- end
- $display( "" );
- end
-
- 8'h20: // Transmit packet - and put it on Rx expectancy queue
- begin
- Length = Get16bit(i); // Length in bytes
- Count = Get16bit(i); // Number of times
- while ( Count != 0 )
- begin
- ScriptSendPacket( Length, 1 );
- Count = Count - 1;
- end
- end
-
- 8'h21: // Transmit packet - but DON'T put it on Rx expectancy queue
- begin
- Length = Get16bit(i); // Length in bytes
- Count = Get16bit(i); // Number of times
- while ( Count != 0 )
- begin
- ScriptSendPacket( Length, 0 );
- Count = Count - 1;
- end
- end
-
- 8'h22: // Wait
- begin : OpCode22
- reg NoTimeOut;
- Count = Get16bit(i); // Timeout in ns
- if ( Count==0 )
- NoTimeOut = 1;
- else
- NoTimeOut = 0;
-
- $display( "Waiting for # of Rx packets = # of Tx packets..." );
- $display( "Timeout = %0d ns - Current # Rx =%0d, Expected=%0d",
- Count, RxPacketCount, RxExpectPacketCount );
-
- while( (NoTimeOut || (Count != 0)) && ( RxExpectPacketCount != RxPacketCount ) && !Error )
- begin
- #1;
- if ( !NoTimeOut )
- Count = Count - 1;
- //$display( "NoTimeOut=%0d, Count=%0d", NoTimeOut, Count );
- end
-
- if ( !Error )
- if ( RxExpectPacketCount != RxPacketCount )
- begin
- $display( "ERROR: Timeout waiting for Rx packet(s)!" );
- ScriptDone = 1;
- Error = 1;
- end
- else
- $display( "...Done waiting (time remaining = %0d ns)!", Count );
- end
-
- 8'h23: // Inject bit error in Tx packet
- begin
- InjectError = Get16bit(i); // Get bit error pattern
- $display( "Injecting a single bit-error in Tx packet: TxEr=%0d, TxEn=%0d, TxD=0x%02h (0x%03h)",
- InjectError[9], InjectError[8], InjectError[7:0], InjectError );
- end
-
- 8'h24: // Store internally generated PAUSE frame in Rx expect queue
- begin
- Count = Get16bit(i); // Timeout in ns
- $display( "Generating PAUSE frame (tick=%0d) on Rx expect queue", Count );
- RxExpectPacketCount = RxExpectPacketCount + 1;
- FIFO_Wr( { 1'b1, 1'b0, 2'b00, 32'h0180c200 } );
- FIFO_Wr( { 1'b0, 1'b0, 2'b00, 16'h0001, 16'h0000 } );
- FIFO_Wr( { 1'b0, 1'b0, 2'b00, 32'h00000000 } );
- FIFO_Wr( { 1'b0, 1'b0, 2'b00, 32'h88080001 } );
- FIFO_Wr( { 1'b0, 1'b0, 2'b00, Count, 16'h0000 } );
- FIFO_Wr( { 1'b0, 1'b0, 2'b00, 32'h00000000 } );
- FIFO_Wr( { 1'b0, 1'b0, 2'b00, 32'h00000000 } );
- FIFO_Wr( { 1'b0, 1'b0, 2'b00, 32'h00000000 } );
- FIFO_Wr( { 1'b0, 1'b0, 2'b00, 32'h00000000 } );
- FIFO_Wr( { 1'b0, 1'b0, 2'b00, 32'h00000000 } );
- FIFO_Wr( { 1'b0, 1'b0, 2'b00, 32'h00000000 } );
- FIFO_Wr( { 1'b0, 1'b0, 2'b00, 32'h00000000 } );
- FIFO_Wr( { 1'b0, 1'b0, 2'b00, 32'h00000000 } );
- FIFO_Wr( { 1'b0, 1'b0, 2'b00, 32'h00000000 } );
- FIFO_Wr( { 1'b0, 1'b1, 2'b00, 32'h00000000 } );
- end
-
- 8'h25: // Transmit packet - and indicate that it must be IGNORED upon reception
- begin
- Length = Get16bit(i); // Length in bytes
- Count = Get16bit(i); // Number of times
- while ( Count != 0 )
- begin
- ScriptSendPacket( Length, 3 );
- Count = Count - 1;
- end
- end
-
- 8'h26: // Transmit packet - and put it on expectancy queue with Alternate header!
- begin
- Length = Get16bit(i); // Length in bytes
- Count = Get16bit(i); // Number of times
- while ( Count != 0 )
- begin
- ScriptSendPacket( Length, 2 );
- Count = Count - 1;
- end
- end
-
- 8'hff: // Halt
- begin
- $display( "HALT" );
- ScriptDone = 1;
- Done = 1;
- end
-
- default: // Unknown opcode
- begin
- $display( "Unknown instruction encountered @ PC=%0d: OpCode=0x%02x", PC-1, OpCode );
- Error = 1;
- end
-
- endcase
-
- if ( Error )
- begin
- ScriptDone = 1;
- Done = 1;
- end
- end
-
- if ( Error )
- $display( "ERROR: Test failed!");
- else
- begin : ScriptSuccess
- real TxTimeElapsed;
- real RxTimeElapsed;
- real ReferenceTime;
-
- ReferenceTime = $realtime;
- #1;
- ReferenceTime = $realtime - ReferenceTime;
-
- TxTimeElapsed = $realtime - TxStartTime;
- RxTimeElapsed = $realtime - RxStartTime;
-
- $display( "TxStartTime=%0e, Now=%0e", TxStartTime, $realtime );
- $display( "RxStartTime=%0e, Now=%0e", RxStartTime, $realtime );
-
- $display( "Tx stats: %0d packet(s) send, total of %0d bytes in %0e ns ~ %1.2f Mbps",
- TxPacketCount, TxByteCount, TxTimeElapsed, TxByteCount*8*1e3/TxTimeElapsed );
- $display( "Rx stats: %0d packet(s) received, total of %0d bytes in %0e ns ~ %1.2f Mbps",
- RxPacketCount, RxByteCount, RxTimeElapsed, RxByteCount*8*1e3/RxTimeElapsed );
- $display( "Test succeeded!");
- end
-
- end
- endtask
-
- //-------------------------------------------------------------------------
- // Generate all clocks
- //-------------------------------------------------------------------------
-
- // GMII master clock (125 MHz)
- initial
- begin
- #10;
- while ( !Done )
- begin
- #4 Clk_125M = 0;
- #4 Clk_125M = 1;
- end
- end
-
- // User (packet) interface clock (100 MHz)
- initial
- begin
- #10;
- while ( !Done )
- begin
- #5 Clk_user = 0;
- #5 Clk_user = 1;
- end
- end
-
- // Wishbone host interface clock (50 MHz)
- initial
- begin
- #10;
- while ( !Done )
- begin
- #10 CLK_I = 0;
- #10 CLK_I = 1;
- end
- end
-
- //-------------------------------------------------------------------------
-
- initial
- begin
- if ( $test$plusargs( "vcd" ) )
- begin
- $display( "Turning VCD data dump on" );
- $dumpfile();
- $dumpvars( 0 ); // Dump all signals in entire design
- end
- end
-
- //-------------------------------------------------------------------------
-
- reg [1023:0] ScriptFile;
-
- initial
- begin
- HostInit;
-
- TxStartTime = 0;
- RxStartTime = 0;
- TxByteCount = 0;
- RxByteCount = 0;
-
- for ( i=0; i<`TXDATALEN; i=i+1 )
- TxData[i] = (i & 8'hff);
-
- // Fill script memory with HALTs
- for ( i=0; i<`SCRIPTLEN; i=i+1 )
- Script[i] = 8'hff;
-
- if ( !$value$plusargs( "script=%s", ScriptFile ) )
- begin
- $display( "Using default script file" );
- ScriptFile = "test.scr";
- end
-
- $readmemh( ScriptFile, Script );
-
-// for ( i=0; i<40; i=i+1 )
-// $display( "Script[%0d]=0x%02x", i, Script[i] );
-
- #10;
-
- ExecuteScript;
- end
-
-endmodule
diff --git a/eth/bench/verilog/test.scr b/eth/bench/verilog/test.scr deleted file mode 100644 index 2ad127d31..000000000 --- a/eth/bench/verilog/test.scr +++ /dev/null @@ -1,23 +0,0 @@ -// This tests just runs trough a couple of different packet lengths
-
-// Read from register 24 to confirm that Rx CRC check is enabled
-03 00 18 00 01 ff ff
-
-// Set speed to 1000 Mbps
-01 00 22 00 04
-
-// Setup Tx and Rx MAC addresses and type field to "IP"
-// Set Tx Data at offset 0, length 14 to 123456789ABC CBA987654321 0800
-10 00 00 00 0E 12 34 56 78 9A BC CB A9 87 65 43 21 08 00
-
-// Transmit a 320-byte frame 1 time - and expect it to be received again!
-20 01 40 00 01
-
-// Transmit a 80-byte frame 1 time - and expect it to be received again!
-20 00 50 00 01
-
-// Wait (indefinitely) for missing Rx packets
-22 00 00
-
-// Halt
-FF
diff --git a/eth/bench/verilog/txmac.scr b/eth/bench/verilog/txmac.scr deleted file mode 100644 index caa7db594..000000000 --- a/eth/bench/verilog/txmac.scr +++ /dev/null @@ -1,93 +0,0 @@ -// Read from register 24 to confirm that Rx CRC check is enabled
-03 00 18 00 01 ff ff
-
-// Set speed to 1000 Mbps
-01 00 22 00 04
-
-// Write MAC address 12 35 56 78 9A BC to Rx Address buffer
-01 00 10 00 00
-01 00 0f 00 12
-01 00 11 00 01
-01 00 11 00 00
-01 00 10 00 01
-01 00 0f 00 34
-01 00 11 00 01
-01 00 11 00 00
-01 00 10 00 02
-01 00 0f 00 56
-01 00 11 00 01
-01 00 11 00 00
-01 00 10 00 03
-01 00 0f 00 78
-01 00 11 00 01
-01 00 11 00 00
-01 00 10 00 04
-01 00 0f 00 9A
-01 00 11 00 01
-01 00 11 00 00
-01 00 10 00 05
-01 00 0f 00 BC
-01 00 11 00 01
-01 00 11 00 00
-
-// Write 1 to register 14, MAC_rx_add_chk_en
-// This turns on the Rx Destination MAC address filter
-01 00 0e 00 01
-
-// Setup Tx and Rx MAC addresses and type field to "IP"
-// Set Tx Data at offset 0, length 14 to 123456789ABC CBA987654321 0800
-// (i.e. Destination MAC address is 123456789ABC matching the above)
-10 00 00 00 0E 12 34 56 78 9A BC CB A9 87 65 43 21 08 00
-
-// Setup Alternate Tx and Rx MAC addresses and type field to "IP"
-// Set Tx Data at offset 0, length 14 to 123456789ABC 112233445566 0800
-// (i.e. Destination MAC address is 123456789ABC matching the above)
-11 00 00 00 0E 12 34 56 78 9A BC 11 22 33 44 55 66 08 00
-
-// Transmit a 60-byte frame 3 times - and expect them to be received again!
-20 00 3C 00 03
-
-// Wait (indefinitely) for missing Rx packets
-22 00 00
-
-// Write MAC address 11 22 33 44 55 66 to Tx MAC Source Address buffer
-01 00 09 00 00
-01 00 08 00 11
-01 00 0a 00 01
-01 00 0a 00 00
-01 00 09 00 01
-01 00 08 00 22
-01 00 0a 00 01
-01 00 0a 00 00
-01 00 09 00 02
-01 00 08 00 33
-01 00 0a 00 01
-01 00 0a 00 00
-01 00 09 00 03
-01 00 08 00 44
-01 00 0a 00 01
-01 00 0a 00 00
-01 00 09 00 04
-01 00 08 00 55
-01 00 0a 00 01
-01 00 0a 00 00
-01 00 09 00 05
-01 00 08 00 66
-01 00 0a 00 01
-01 00 0a 00 00
-
-// Transmit a 60 byte frame 3 times - and expect them to be received again!
-20 00 3C 00 03
-
-// Wait (indefinitely) for missing Rx packets
-22 00 00
-
-// Write 1 to register 7, MAC_tx_add_en
-// This turns on the Tx Source MAC address replacement mechanism
-01 00 07 00 01
-
-// Transmit a 60 byte frame 3 times - and expect them to be received again with Alternate header!
-26 00 3C 00 03
-
-// Wait (indefinitely) for missing Rx packets
-22 00 00
diff --git a/eth/bench/verilog/xlnx_glbl.v b/eth/bench/verilog/xlnx_glbl.v deleted file mode 100644 index 662a60e35..000000000 --- a/eth/bench/verilog/xlnx_glbl.v +++ /dev/null @@ -1,29 +0,0 @@ -module xlnx_glbl
-(
- GSR,
- GTS
-);
-
- //--------------------------------------------------------------------------
- // Parameters
- //--------------------------------------------------------------------------
-
- //--------------------------------------------------------------------------
- // IO declarations
- //--------------------------------------------------------------------------
-
- output GSR;
- output GTS;
-
- //--------------------------------------------------------------------------
- // Local declarations
- //--------------------------------------------------------------------------
-
- //--------------------------------------------------------------------------
- // Internal declarations
- //--------------------------------------------------------------------------
-
- assign GSR = 0;
- assign GTS = 0;
-
-endmodule
diff --git a/eth/demo/verilog/RAMB16_S1_S2.v b/eth/demo/verilog/RAMB16_S1_S2.v deleted file mode 100644 index 758760b95..000000000 --- a/eth/demo/verilog/RAMB16_S1_S2.v +++ /dev/null @@ -1,1535 +0,0 @@ -// $Header: /devl/xcs/repo/env/Databases/CAEInterfaces/verunilibs/data/unisims/RAMB16_S1_S2.v,v 1.10 2005/03/14 22:54:41 wloo Exp $ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 1995/2005 Xilinx, Inc. -// All Right Reserved. -/////////////////////////////////////////////////////////////////////////////// -// ____ ____ -// / /\/ / -// /___/ \ / Vendor : Xilinx -// \ \ \/ Version : 8.1i (I.13) -// \ \ Description : Xilinx Functional Simulation Library Component -// / / 16K-Bit Data and 2K-Bit Parity Dual Port Block RAM -// /___/ /\ Filename : RAMB16_S1_S2.v -// \ \ / \ Timestamp : Thu Mar 10 16:43:35 PST 2005 -// \___\/\___\ -// -// Revision: -// 03/23/04 - Initial version. -// End Revision - -`ifdef legacy_model - -`timescale 1 ps / 1 ps - -module RAMB16_S1_S2 (DOA, DOB, ADDRA, ADDRB, CLKA, CLKB, DIA, DIB, ENA, ENB, SSRA, SSRB, WEA, WEB); - - parameter INIT_A = 1'h0; - parameter INIT_B = 2'h0; - parameter SRVAL_A = 1'h0; - parameter SRVAL_B = 2'h0; - parameter WRITE_MODE_A = "WRITE_FIRST"; - parameter WRITE_MODE_B = "WRITE_FIRST"; - parameter SIM_COLLISION_CHECK = "ALL"; - localparam SETUP_ALL = 1000; - localparam SETUP_READ_FIRST = 3000; - - parameter INIT_00 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_01 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_02 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_03 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_04 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_05 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_06 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_07 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_08 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_09 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_0A = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_0B = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_0C = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_0D = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_0E = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_0F = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_10 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_11 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_12 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_13 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_14 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_15 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_16 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_17 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_18 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_19 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_1A = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_1B = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_1C = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_1D = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_1E = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_1F = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_20 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_21 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_22 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_23 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_24 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_25 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_26 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_27 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_28 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_29 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_2A = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_2B = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_2C = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_2D = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_2E = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_2F = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_30 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_31 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_32 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_33 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_34 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_35 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_36 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_37 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_38 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_39 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_3A = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_3B = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_3C = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_3D = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_3E = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_3F = 256'h0000000000000000000000000000000000000000000000000000000000000000; - - output [0:0] DOA; - reg [0:0] doa_out; - wire doa_out0; - - input [13:0] ADDRA; - input [0:0] DIA; - input ENA, CLKA, WEA, SSRA; - - output [1:0] DOB; - reg [1:0] dob_out; - wire dob_out0, dob_out1; - - input [12:0] ADDRB; - input [1:0] DIB; - input ENB, CLKB, WEB, SSRB; - - reg [18431:0] mem; - reg [8:0] count; - reg [1:0] wr_mode_a, wr_mode_b; - - reg [5:0] dmi, dbi; - reg [5:0] pmi, pbi; - - wire [13:0] addra_int; - reg [13:0] addra_reg; - wire [0:0] dia_int; - wire ena_int, clka_int, wea_int, ssra_int; - reg ena_reg, wea_reg, ssra_reg; - wire [12:0] addrb_int; - reg [12:0] addrb_reg; - wire [1:0] dib_int; - wire enb_int, clkb_int, web_int, ssrb_int; - reg display_flag; - reg enb_reg, web_reg, ssrb_reg; - - time time_clka, time_clkb; - time time_clka_clkb; - time time_clkb_clka; - - reg setup_all_a_b; - reg setup_all_b_a; - reg setup_zero; - reg setup_rf_a_b; - reg setup_rf_b_a; - reg [1:0] data_collision, data_collision_a_b, data_collision_b_a; - reg memory_collision, memory_collision_a_b, memory_collision_b_a; - reg address_collision, address_collision_a_b, address_collision_b_a; - reg change_clka; - reg change_clkb; - - wire [14:0] data_addra_int; - wire [14:0] data_addra_reg; - wire [14:0] data_addrb_int; - wire [14:0] data_addrb_reg; - wire [15:0] parity_addra_int; - wire [15:0] parity_addra_reg; - wire [15:0] parity_addrb_int; - wire [15:0] parity_addrb_reg; - - tri0 GSR = glbl.GSR; - - always @(GSR) - if (GSR) begin - assign doa_out = INIT_A[0:0]; - assign dob_out = INIT_B[1:0]; - end - else begin - deassign doa_out; - deassign dob_out; - end - - buf b_doa_out0 (doa_out0, doa_out[0]); - buf b_dob_out0 (dob_out0, dob_out[0]); - buf b_dob_out1 (dob_out1, dob_out[1]); - - buf b_doa0 (DOA[0], doa_out0); - buf b_dob0 (DOB[0], dob_out0); - buf b_dob1 (DOB[1], dob_out1); - - buf b_addra_0 (addra_int[0], ADDRA[0]); - buf b_addra_1 (addra_int[1], ADDRA[1]); - buf b_addra_2 (addra_int[2], ADDRA[2]); - buf b_addra_3 (addra_int[3], ADDRA[3]); - buf b_addra_4 (addra_int[4], ADDRA[4]); - buf b_addra_5 (addra_int[5], ADDRA[5]); - buf b_addra_6 (addra_int[6], ADDRA[6]); - buf b_addra_7 (addra_int[7], ADDRA[7]); - buf b_addra_8 (addra_int[8], ADDRA[8]); - buf b_addra_9 (addra_int[9], ADDRA[9]); - buf b_addra_10 (addra_int[10], ADDRA[10]); - buf b_addra_11 (addra_int[11], ADDRA[11]); - buf b_addra_12 (addra_int[12], ADDRA[12]); - buf b_addra_13 (addra_int[13], ADDRA[13]); - buf b_dia_0 (dia_int[0], DIA[0]); - buf b_ena (ena_int, ENA); - buf b_clka (clka_int, CLKA); - buf b_ssra (ssra_int, SSRA); - buf b_wea (wea_int, WEA); - buf b_addrb_0 (addrb_int[0], ADDRB[0]); - buf b_addrb_1 (addrb_int[1], ADDRB[1]); - buf b_addrb_2 (addrb_int[2], ADDRB[2]); - buf b_addrb_3 (addrb_int[3], ADDRB[3]); - buf b_addrb_4 (addrb_int[4], ADDRB[4]); - buf b_addrb_5 (addrb_int[5], ADDRB[5]); - buf b_addrb_6 (addrb_int[6], ADDRB[6]); - buf b_addrb_7 (addrb_int[7], ADDRB[7]); - buf b_addrb_8 (addrb_int[8], ADDRB[8]); - buf b_addrb_9 (addrb_int[9], ADDRB[9]); - buf b_addrb_10 (addrb_int[10], ADDRB[10]); - buf b_addrb_11 (addrb_int[11], ADDRB[11]); - buf b_addrb_12 (addrb_int[12], ADDRB[12]); - buf b_dib_0 (dib_int[0], DIB[0]); - buf b_dib_1 (dib_int[1], DIB[1]); - buf b_enb (enb_int, ENB); - buf b_clkb (clkb_int, CLKB); - buf b_ssrb (ssrb_int, SSRB); - buf b_web (web_int, WEB); - - initial begin - for (count = 0; count < 256; count = count + 1) begin - mem[count] <= INIT_00[count]; - mem[256 * 1 + count] <= INIT_01[count]; - mem[256 * 2 + count] <= INIT_02[count]; - mem[256 * 3 + count] <= INIT_03[count]; - mem[256 * 4 + count] <= INIT_04[count]; - mem[256 * 5 + count] <= INIT_05[count]; - mem[256 * 6 + count] <= INIT_06[count]; - mem[256 * 7 + count] <= INIT_07[count]; - mem[256 * 8 + count] <= INIT_08[count]; - mem[256 * 9 + count] <= INIT_09[count]; - mem[256 * 10 + count] <= INIT_0A[count]; - mem[256 * 11 + count] <= INIT_0B[count]; - mem[256 * 12 + count] <= INIT_0C[count]; - mem[256 * 13 + count] <= INIT_0D[count]; - mem[256 * 14 + count] <= INIT_0E[count]; - mem[256 * 15 + count] <= INIT_0F[count]; - mem[256 * 16 + count] <= INIT_10[count]; - mem[256 * 17 + count] <= INIT_11[count]; - mem[256 * 18 + count] <= INIT_12[count]; - mem[256 * 19 + count] <= INIT_13[count]; - mem[256 * 20 + count] <= INIT_14[count]; - mem[256 * 21 + count] <= INIT_15[count]; - mem[256 * 22 + count] <= INIT_16[count]; - mem[256 * 23 + count] <= INIT_17[count]; - mem[256 * 24 + count] <= INIT_18[count]; - mem[256 * 25 + count] <= INIT_19[count]; - mem[256 * 26 + count] <= INIT_1A[count]; - mem[256 * 27 + count] <= INIT_1B[count]; - mem[256 * 28 + count] <= INIT_1C[count]; - mem[256 * 29 + count] <= INIT_1D[count]; - mem[256 * 30 + count] <= INIT_1E[count]; - mem[256 * 31 + count] <= INIT_1F[count]; - mem[256 * 32 + count] <= INIT_20[count]; - mem[256 * 33 + count] <= INIT_21[count]; - mem[256 * 34 + count] <= INIT_22[count]; - mem[256 * 35 + count] <= INIT_23[count]; - mem[256 * 36 + count] <= INIT_24[count]; - mem[256 * 37 + count] <= INIT_25[count]; - mem[256 * 38 + count] <= INIT_26[count]; - mem[256 * 39 + count] <= INIT_27[count]; - mem[256 * 40 + count] <= INIT_28[count]; - mem[256 * 41 + count] <= INIT_29[count]; - mem[256 * 42 + count] <= INIT_2A[count]; - mem[256 * 43 + count] <= INIT_2B[count]; - mem[256 * 44 + count] <= INIT_2C[count]; - mem[256 * 45 + count] <= INIT_2D[count]; - mem[256 * 46 + count] <= INIT_2E[count]; - mem[256 * 47 + count] <= INIT_2F[count]; - mem[256 * 48 + count] <= INIT_30[count]; - mem[256 * 49 + count] <= INIT_31[count]; - mem[256 * 50 + count] <= INIT_32[count]; - mem[256 * 51 + count] <= INIT_33[count]; - mem[256 * 52 + count] <= INIT_34[count]; - mem[256 * 53 + count] <= INIT_35[count]; - mem[256 * 54 + count] <= INIT_36[count]; - mem[256 * 55 + count] <= INIT_37[count]; - mem[256 * 56 + count] <= INIT_38[count]; - mem[256 * 57 + count] <= INIT_39[count]; - mem[256 * 58 + count] <= INIT_3A[count]; - mem[256 * 59 + count] <= INIT_3B[count]; - mem[256 * 60 + count] <= INIT_3C[count]; - mem[256 * 61 + count] <= INIT_3D[count]; - mem[256 * 62 + count] <= INIT_3E[count]; - mem[256 * 63 + count] <= INIT_3F[count]; - end - address_collision <= 0; - address_collision_a_b <= 0; - address_collision_b_a <= 0; - change_clka <= 0; - change_clkb <= 0; - data_collision <= 0; - data_collision_a_b <= 0; - data_collision_b_a <= 0; - memory_collision <= 0; - memory_collision_a_b <= 0; - memory_collision_b_a <= 0; - setup_all_a_b <= 0; - setup_all_b_a <= 0; - setup_zero <= 0; - setup_rf_a_b <= 0; - setup_rf_b_a <= 0; - end - - assign data_addra_int = addra_int * 1; - assign data_addra_reg = addra_reg * 1; - assign data_addrb_int = addrb_int * 2; - assign data_addrb_reg = addrb_reg * 2; - - - initial begin - - display_flag = 1; - - case (SIM_COLLISION_CHECK) - - "NONE" : begin - assign setup_all_a_b = 1'b0; - assign setup_all_b_a = 1'b0; - assign setup_zero = 1'b0; - assign setup_rf_a_b = 1'b0; - assign setup_rf_b_a = 1'b0; - assign display_flag = 0; - end - "WARNING_ONLY" : begin - assign data_collision = 2'b00; - assign data_collision_a_b = 2'b00; - assign data_collision_b_a = 2'b00; - assign memory_collision = 1'b0; - assign memory_collision_a_b = 1'b0; - assign memory_collision_b_a = 1'b0; - end - "GENERATE_X_ONLY" : begin - assign display_flag = 0; - end - "ALL" : ; - default : begin - $display("Attribute Syntax Error : The Attribute SIM_COLLISION_CHECK on RAMB16_S1_S2 instance %m is set to %s. Legal values for this attribute are ALL, NONE, WARNING_ONLY or GENERATE_X_ONLY.", SIM_COLLISION_CHECK); - $finish; - end - - endcase // case(SIM_COLLISION_CHECK) - - end // initial begin - - - always @(posedge clka_int) begin - time_clka = $time; - #0 time_clkb_clka = time_clka - time_clkb; - change_clka = ~change_clka; - end - - always @(posedge clkb_int) begin - time_clkb = $time; - #0 time_clka_clkb = time_clkb - time_clka; - change_clkb = ~change_clkb; - end - - always @(change_clkb) begin - if ((0 < time_clka_clkb) && (time_clka_clkb < SETUP_ALL)) - setup_all_a_b = 1; - if ((0 < time_clka_clkb) && (time_clka_clkb < SETUP_READ_FIRST)) - setup_rf_a_b = 1; - end - - always @(change_clka) begin - if ((0 < time_clkb_clka) && (time_clkb_clka < SETUP_ALL)) - setup_all_b_a = 1; - if ((0 < time_clkb_clka) && (time_clkb_clka < SETUP_READ_FIRST)) - setup_rf_b_a = 1; - end - - always @(change_clkb or change_clka) begin - if ((time_clkb_clka == 0) && (time_clka_clkb == 0)) - setup_zero = 1; - end - - always @(posedge setup_zero) begin - if ((ena_int == 1) && (wea_int == 1) && - (enb_int == 1) && (web_int == 1) && - (data_addra_int[14:1] == data_addrb_int[14:1])) - memory_collision <= 1; - end - - always @(posedge setup_all_a_b or posedge setup_rf_a_b) begin - if ((ena_reg == 1) && (wea_reg == 1) && - (enb_int == 1) && (web_int == 1) && - (data_addra_reg[14:1] == data_addrb_int[14:1])) - memory_collision_a_b <= 1; - end - - always @(posedge setup_all_b_a or posedge setup_rf_b_a) begin - if ((ena_int == 1) && (wea_int == 1) && - (enb_reg == 1) && (web_reg == 1) && - (data_addra_int[14:1] == data_addrb_reg[14:1])) - memory_collision_b_a <= 1; - end - - always @(posedge setup_all_a_b) begin - if (data_addra_reg[14:1] == data_addrb_int[14:1]) begin - if ((ena_reg == 1) && (enb_int == 1)) begin - case ({wr_mode_a, wr_mode_b, wea_reg, web_int}) - 6'b000011 : begin data_collision_a_b <= 2'b11; display_wa_wb; end - 6'b000111 : begin data_collision_a_b <= 2'b11; display_wa_wb; end - 6'b001011 : begin data_collision_a_b <= 2'b10; display_wa_wb; end -// 6'b010011 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b010111 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b011011 : begin data_collision_a_b <= 2'b00; display_wa_wb; end - 6'b100011 : begin data_collision_a_b <= 2'b01; display_wa_wb; end - 6'b100111 : begin data_collision_a_b <= 2'b01; display_wa_wb; end - 6'b101011 : begin display_wa_wb; end - 6'b000001 : begin data_collision_a_b <= 2'b10; display_ra_wb; end -// 6'b000101 : begin data_collision_a_b <= 2'b00; display_ra_wb; end - 6'b001001 : begin data_collision_a_b <= 2'b10; display_ra_wb; end - 6'b010001 : begin data_collision_a_b <= 2'b10; display_ra_wb; end -// 6'b010101 : begin data_collision_a_b <= 2'b00; display_ra_wb; end - 6'b011001 : begin data_collision_a_b <= 2'b10; display_ra_wb; end - 6'b100001 : begin data_collision_a_b <= 2'b10; display_ra_wb; end -// 6'b100101 : begin data_collision_a_b <= 2'b00; display_ra_wb; end - 6'b101001 : begin data_collision_a_b <= 2'b10; display_ra_wb; end - 6'b000010 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - 6'b000110 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - 6'b001010 : begin data_collision_a_b <= 2'b01; display_wa_rb; end -// 6'b010010 : begin data_collision_a_b <= 2'b00; display_wa_rb; end -// 6'b010110 : begin data_collision_a_b <= 2'b00; display_wa_rb; end -// 6'b011010 : begin data_collision_a_b <= 2'b00; display_wa_rb; end - 6'b100010 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - 6'b100110 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - 6'b101010 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - endcase - end - end - setup_all_a_b <= 0; - end - - - always @(posedge setup_all_b_a) begin - if (data_addra_int[14:1] == data_addrb_reg[14:1]) begin - if ((ena_int == 1) && (enb_reg == 1)) begin - case ({wr_mode_a, wr_mode_b, wea_int, web_reg}) - 6'b000011 : begin data_collision_b_a <= 2'b11; display_wa_wb; end -// 6'b000111 : begin data_collision_b_a <= 2'b00; display_wa_wb; end - 6'b001011 : begin data_collision_b_a <= 2'b10; display_wa_wb; end - 6'b010011 : begin data_collision_b_a <= 2'b11; display_wa_wb; end -// 6'b010111 : begin data_collision_b_a <= 2'b00; display_wa_wb; end - 6'b011011 : begin data_collision_b_a <= 2'b10; display_wa_wb; end - 6'b100011 : begin data_collision_b_a <= 2'b01; display_wa_wb; end - 6'b100111 : begin data_collision_b_a <= 2'b01; display_wa_wb; end - 6'b101011 : begin display_wa_wb; end - 6'b000001 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b000101 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b001001 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b010001 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b010101 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b011001 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b100001 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b100101 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b101001 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b000010 : begin data_collision_b_a <= 2'b01; display_wa_rb; end - 6'b000110 : begin data_collision_b_a <= 2'b01; display_wa_rb; end - 6'b001010 : begin data_collision_b_a <= 2'b01; display_wa_rb; end -// 6'b010010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b010110 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b011010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end - 6'b100010 : begin data_collision_b_a <= 2'b01; display_wa_rb; end - 6'b100110 : begin data_collision_b_a <= 2'b01; display_wa_rb; end - 6'b101010 : begin data_collision_b_a <= 2'b01; display_wa_rb; end - endcase - end - end - setup_all_b_a <= 0; - end - - - always @(posedge setup_zero) begin - if (data_addra_int[14:1] == data_addrb_int[14:1]) begin - if ((ena_int == 1) && (enb_int == 1)) begin - case ({wr_mode_a, wr_mode_b, wea_int, web_int}) - 6'b000011 : begin data_collision <= 2'b11; display_wa_wb; end - 6'b000111 : begin data_collision <= 2'b11; display_wa_wb; end - 6'b001011 : begin data_collision <= 2'b10; display_wa_wb; end - 6'b010011 : begin data_collision <= 2'b11; display_wa_wb; end - 6'b010111 : begin data_collision <= 2'b11; display_wa_wb; end - 6'b011011 : begin data_collision <= 2'b10; display_wa_wb; end - 6'b100011 : begin data_collision <= 2'b01; display_wa_wb; end - 6'b100111 : begin data_collision <= 2'b01; display_wa_wb; end - 6'b101011 : begin display_wa_wb; end - 6'b000001 : begin data_collision <= 2'b10; display_ra_wb; end -// 6'b000101 : begin data_collision <= 2'b00; display_ra_wb; end - 6'b001001 : begin data_collision <= 2'b10; display_ra_wb; end - 6'b010001 : begin data_collision <= 2'b10; display_ra_wb; end -// 6'b010101 : begin data_collision <= 2'b00; display_ra_wb; end - 6'b011001 : begin data_collision <= 2'b10; display_ra_wb; end - 6'b100001 : begin data_collision <= 2'b10; display_ra_wb; end -// 6'b100101 : begin data_collision <= 2'b00; display_ra_wb; end - 6'b101001 : begin data_collision <= 2'b10; display_ra_wb; end - 6'b000010 : begin data_collision <= 2'b01; display_wa_rb; end - 6'b000110 : begin data_collision <= 2'b01; display_wa_rb; end - 6'b001010 : begin data_collision <= 2'b01; display_wa_rb; end -// 6'b010010 : begin data_collision <= 2'b00; display_wa_rb; end -// 6'b010110 : begin data_collision <= 2'b00; display_wa_rb; end -// 6'b011010 : begin data_collision <= 2'b00; display_wa_rb; end - 6'b100010 : begin data_collision <= 2'b01; display_wa_rb; end - 6'b100110 : begin data_collision <= 2'b01; display_wa_rb; end - 6'b101010 : begin data_collision <= 2'b01; display_wa_rb; end - endcase - end - end - setup_zero <= 0; - end - - task display_ra_wb; - begin - if (display_flag) - $display("Memory Collision Error on RAMB16_S1_S2:%m at simulation time %.3f ns\nA read was performed on address %h (hex) of Port A while a write was requested to the same address on Port B. The write will be successful however the read value on Port A is unknown until the next CLKA cycle.", $time/1000.0, addra_int); - end - endtask - - task display_wa_rb; - begin - if (display_flag) - $display("Memory Collision Error on RAMB16_S1_S2:%m at simulation time %.3f ns\nA read was performed on address %h (hex) of Port B while a write was requested to the same address on Port A. The write will be successful however the read value on Port B is unknown until the next CLKB cycle.", $time/1000.0, addrb_int); - end - endtask - - task display_wa_wb; - begin - if (display_flag) - $display("Memory Collision Error on RAMB16_S1_S2:%m at simulation time %.3f ns\nA write was requested to the same address simultaneously at both Port A and Port B of the RAM. The contents written to the RAM at address location %h (hex) of Port A and address location %h (hex) of Port B are unknown.", $time/1000.0, addra_int, addrb_int); - end - endtask - - - always @(posedge setup_rf_a_b) begin - if (data_addra_reg[14:1] == data_addrb_int[14:1]) begin - if ((ena_reg == 1) && (enb_int == 1)) begin - case ({wr_mode_a, wr_mode_b, wea_reg, web_int}) -// 6'b000011 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b000111 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b001011 : begin data_collision_a_b <= 2'b00; display_wa_wb; end - 6'b010011 : begin data_collision_a_b <= 2'b11; display_wa_wb; end - 6'b010111 : begin data_collision_a_b <= 2'b11; display_wa_wb; end - 6'b011011 : begin data_collision_a_b <= 2'b10; display_wa_wb; end -// 6'b100011 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b100111 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b101011 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b000001 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b000101 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b001001 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b010001 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b010101 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b011001 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b100001 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b100101 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b101001 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b000010 : begin data_collision_a_b <= 2'b00; display_wa_rb; end -// 6'b000110 : begin data_collision_a_b <= 2'b00; display_wa_rb; end -// 6'b001010 : begin data_collision_a_b <= 2'b00; display_wa_rb; end - 6'b010010 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - 6'b010110 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - 6'b011010 : begin data_collision_a_b <= 2'b01; display_wa_rb; end -// 6'b100010 : begin data_collision_a_b <= 2'b00; display_wa_rb; end -// 6'b100110 : begin data_collision_a_b <= 2'b00; display_wa_rb; end -// 6'b101010 : begin data_collision_a_b <= 2'b00; display_wa_rb; end - endcase - end - end - setup_rf_a_b <= 0; - end - - - always @(posedge setup_rf_b_a) begin - if (data_addra_int[14:1] == data_addrb_reg[14:1]) begin - if ((ena_int == 1) && (enb_reg == 1)) begin - case ({wr_mode_a, wr_mode_b, wea_int, web_reg}) -// 6'b000011 : begin data_collision_b_a <= 2'b00; display_wa_wb; end - 6'b000111 : begin data_collision_b_a <= 2'b11; display_wa_wb; end -// 6'b001011 : begin data_collision_b_a <= 2'b00; display_wa_wb; end -// 6'b010011 : begin data_collision_b_a <= 2'b00; display_wa_wb; end - 6'b010111 : begin data_collision_b_a <= 2'b11; display_wa_wb; end -// 6'b011011 : begin data_collision_b_a <= 2'b00; display_wa_wb; end -// 6'b100011 : begin data_collision_b_a <= 2'b00; display_wa_wb; end - 6'b100111 : begin data_collision_b_a <= 2'b01; display_wa_wb; end -// 6'b101011 : begin data_collision_b_a <= 2'b00; display_wa_wb; end -// 6'b000001 : begin data_collision_b_a <= 2'b00; display_ra_wb; end - 6'b000101 : begin data_collision_b_a <= 2'b10; display_ra_wb; end -// 6'b001001 : begin data_collision_b_a <= 2'b00; display_ra_wb; end -// 6'b010001 : begin data_collision_b_a <= 2'b00; display_ra_wb; end - 6'b010101 : begin data_collision_b_a <= 2'b10; display_ra_wb; end -// 6'b011001 : begin data_collision_b_a <= 2'b00; display_ra_wb; end -// 6'b100001 : begin data_collision_b_a <= 2'b00; display_ra_wb; end - 6'b100101 : begin data_collision_b_a <= 2'b10; display_ra_wb; end -// 6'b101001 : begin data_collision_b_a <= 2'b00; display_ra_wb; end -// 6'b000010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b000110 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b001010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b010010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b010110 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b011010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b100010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b100110 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b101010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end - endcase - end - end - setup_rf_b_a <= 0; - end - - - always @(posedge clka_int) begin - addra_reg <= addra_int; - ena_reg <= ena_int; - ssra_reg <= ssra_int; - wea_reg <= wea_int; - end - - always @(posedge clkb_int) begin - addrb_reg <= addrb_int; - enb_reg <= enb_int; - ssrb_reg <= ssrb_int; - web_reg <= web_int; - end - - // Data - always @(posedge memory_collision) begin - for (dmi = 0; dmi < 1; dmi = dmi + 1) begin - mem[data_addra_int + dmi] <= 1'bX; - end - memory_collision <= 0; - end - - always @(posedge memory_collision_a_b) begin - for (dmi = 0; dmi < 1; dmi = dmi + 1) begin - mem[data_addra_reg + dmi] <= 1'bX; - end - memory_collision_a_b <= 0; - end - - always @(posedge memory_collision_b_a) begin - for (dmi = 0; dmi < 1; dmi = dmi + 1) begin - mem[data_addra_int + dmi] <= 1'bX; - end - memory_collision_b_a <= 0; - end - - always @(posedge data_collision[1]) begin - if (ssra_int == 0) begin - doa_out <= 1'bX; - end - data_collision[1] <= 0; - end - - always @(posedge data_collision[0]) begin - if (ssrb_int == 0) begin - for (dbi = 0; dbi < 1; dbi = dbi + 1) begin - dob_out[data_addra_int[0 : 0] + dbi] <= 1'bX; - end - end - data_collision[0] <= 0; - end - - always @(posedge data_collision_a_b[1]) begin - if (ssra_reg == 0) begin - doa_out <= 1'bX; - end - data_collision_a_b[1] <= 0; - end - - always @(posedge data_collision_a_b[0]) begin - if (ssrb_int == 0) begin - for (dbi = 0; dbi < 1; dbi = dbi + 1) begin - dob_out[data_addra_reg[0 : 0] + dbi] <= 1'bX; - end - end - data_collision_a_b[0] <= 0; - end - - always @(posedge data_collision_b_a[1]) begin - if (ssra_int == 0) begin - doa_out <= 1'bX; - end - data_collision_b_a[1] <= 0; - end - - always @(posedge data_collision_b_a[0]) begin - if (ssrb_reg == 0) begin - for (dbi = 0; dbi < 1; dbi = dbi + 1) begin - dob_out[data_addra_int[0 : 0] + dbi] <= 1'bX; - end - end - data_collision_b_a[0] <= 0; - end - - - initial begin - case (WRITE_MODE_A) - "WRITE_FIRST" : wr_mode_a <= 2'b00; - "READ_FIRST" : wr_mode_a <= 2'b01; - "NO_CHANGE" : wr_mode_a <= 2'b10; - default : begin - $display("Attribute Syntax Error : The Attribute WRITE_MODE_A on RAMB16_S1_S2 instance %m is set to %s. Legal values for this attribute are WRITE_FIRST, READ_FIRST or NO_CHANGE.", WRITE_MODE_A); - $finish; - end - endcase - end - - initial begin - case (WRITE_MODE_B) - "WRITE_FIRST" : wr_mode_b <= 2'b00; - "READ_FIRST" : wr_mode_b <= 2'b01; - "NO_CHANGE" : wr_mode_b <= 2'b10; - default : begin - $display("Attribute Syntax Error : The Attribute WRITE_MODE_B on RAMB16_S1_S2 instance %m is set to %s. Legal values for this attribute are WRITE_FIRST, READ_FIRST or NO_CHANGE.", WRITE_MODE_B); - $finish; - end - endcase - end - - // Port A - always @(posedge clka_int) begin - if (ena_int == 1'b1) begin - if (ssra_int == 1'b1) begin - doa_out[0] <= SRVAL_A[0]; - end - else begin - if (wea_int == 1'b1) begin - if (wr_mode_a == 2'b00) begin - doa_out <= dia_int; - end - else if (wr_mode_a == 2'b01) begin - doa_out[0] <= mem[data_addra_int + 0]; - end - end - else begin - doa_out[0] <= mem[data_addra_int + 0]; - end - end - end - end - - always @(posedge clka_int) begin - if (ena_int == 1'b1 && wea_int == 1'b1) begin - mem[data_addra_int + 0] <= dia_int[0]; - end - end - - // Port B - always @(posedge clkb_int) begin - if (enb_int == 1'b1) begin - if (ssrb_int == 1'b1) begin - dob_out[0] <= SRVAL_B[0]; - dob_out[1] <= SRVAL_B[1]; - end - else begin - if (web_int == 1'b1) begin - if (wr_mode_b == 2'b00) begin - dob_out <= dib_int; - end - else if (wr_mode_b == 2'b01) begin - dob_out[0] <= mem[data_addrb_int + 0]; - dob_out[1] <= mem[data_addrb_int + 1]; - end - end - else begin - dob_out[0] <= mem[data_addrb_int + 0]; - dob_out[1] <= mem[data_addrb_int + 1]; - end - end - end - end - - always @(posedge clkb_int) begin - if (enb_int == 1'b1 && web_int == 1'b1) begin - mem[data_addrb_int + 0] <= dib_int[0]; - mem[data_addrb_int + 1] <= dib_int[1]; - end - end - - specify - (CLKA *> DOA) = (100, 100); - (CLKB *> DOB) = (100, 100); - endspecify - -endmodule - -`else - -// $Header: /devl/xcs/repo/env/Databases/CAEInterfaces/verunilibs/data/unisims/RAMB16_S1_S2.v,v 1.10 2005/03/14 22:54:41 wloo Exp $ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 1995/2005 Xilinx, Inc. -// All Right Reserved. -/////////////////////////////////////////////////////////////////////////////// -// ____ ____ -// / /\/ / -// /___/ \ / Vendor : Xilinx -// \ \ \/ Version : 8.1i (I.13) -// \ \ Description : Xilinx Timing Simulation Library Component -// / / 16K-Bit Data and 2K-Bit Parity Dual Port Block RAM -// /___/ /\ Filename : RAMB16_S1_S2.v -// \ \ / \ Timestamp : Thu Mar 10 16:44:01 PST 2005 -// \___\/\___\ -// -// Revision: -// 03/23/04 - Initial version. -// 03/10/05 - Initialized outputs. -// End Revision - -`timescale 1 ps/1 ps - -module RAMB16_S1_S2 (DOA, DOB, ADDRA, ADDRB, CLKA, CLKB, DIA, DIB, ENA, ENB, SSRA, SSRB, WEA, WEB); - - parameter INIT_A = 1'h0; - parameter INIT_B = 2'h0; - parameter SRVAL_A = 1'h0; - parameter SRVAL_B = 2'h0; - parameter WRITE_MODE_A = "WRITE_FIRST"; - parameter WRITE_MODE_B = "WRITE_FIRST"; - parameter SIM_COLLISION_CHECK = "ALL"; - localparam SETUP_ALL = 1000; - localparam SETUP_READ_FIRST = 3000; - - parameter INIT_00 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_01 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_02 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_03 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_04 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_05 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_06 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_07 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_08 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_09 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_0A = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_0B = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_0C = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_0D = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_0E = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_0F = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_10 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_11 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_12 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_13 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_14 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_15 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_16 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_17 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_18 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_19 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_1A = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_1B = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_1C = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_1D = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_1E = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_1F = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_20 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_21 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_22 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_23 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_24 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_25 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_26 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_27 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_28 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_29 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_2A = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_2B = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_2C = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_2D = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_2E = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_2F = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_30 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_31 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_32 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_33 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_34 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_35 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_36 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_37 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_38 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_39 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_3A = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_3B = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_3C = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_3D = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_3E = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_3F = 256'h0000000000000000000000000000000000000000000000000000000000000000; - - output [0:0] DOA; - output [1:0] DOB; - - input [13:0] ADDRA; - input [0:0] DIA; - input ENA, CLKA, WEA, SSRA; - input [12:0] ADDRB; - input [1:0] DIB; - input ENB, CLKB, WEB, SSRB; - - reg [0:0] doa_out = INIT_A[0:0]; - reg [1:0] dob_out = INIT_B[1:0]; - - reg [1:0] mem [8191:0]; - - reg [8:0] count, countp; - reg [1:0] wr_mode_a, wr_mode_b; - - reg [5:0] dmi, dbi; - reg [5:0] pmi, pbi; - - wire [13:0] addra_int; - reg [13:0] addra_reg; - wire [0:0] dia_int; - wire ena_int, clka_int, wea_int, ssra_int; - reg ena_reg, wea_reg, ssra_reg; - wire [12:0] addrb_int; - reg [12:0] addrb_reg; - wire [1:0] dib_int; - wire enb_int, clkb_int, web_int, ssrb_int; - reg display_flag, output_flag; - reg enb_reg, web_reg, ssrb_reg; - - time time_clka, time_clkb; - time time_clka_clkb; - time time_clkb_clka; - - reg setup_all_a_b; - reg setup_all_b_a; - reg setup_zero; - reg setup_rf_a_b; - reg setup_rf_b_a; - reg [1:0] data_collision, data_collision_a_b, data_collision_b_a; - reg memory_collision, memory_collision_a_b, memory_collision_b_a; - reg change_clka; - reg change_clkb; - - wire [14:0] data_addra_int; - wire [14:0] data_addra_reg; - wire [14:0] data_addrb_int; - wire [14:0] data_addrb_reg; - - wire dia_enable = ena_int && wea_int; - wire dib_enable = enb_int && web_int; - - tri0 GSR = glbl.GSR; - wire gsr_int; - - buf b_gsr (gsr_int, GSR); - - buf b_doa [0:0] (DOA, doa_out); - buf b_addra [13:0] (addra_int, ADDRA); - buf b_dia [0:0] (dia_int, DIA); - buf b_ena (ena_int, ENA); - buf b_clka (clka_int, CLKA); - buf b_ssra (ssra_int, SSRA); - buf b_wea (wea_int, WEA); - - buf b_dob [1:0] (DOB, dob_out); - buf b_addrb [12:0] (addrb_int, ADDRB); - buf b_dib [1:0] (dib_int, DIB); - buf b_enb (enb_int, ENB); - buf b_clkb (clkb_int, CLKB); - buf b_ssrb (ssrb_int, SSRB); - buf b_web (web_int, WEB); - - - always @(gsr_int) - if (gsr_int) begin - assign {doa_out} = INIT_A; - assign {dob_out} = INIT_B; - end - else begin - deassign doa_out; - deassign dob_out; - end - - - initial begin - - for (count = 0; count < 128; count = count + 1) begin - mem[count] = INIT_00[(count * 2) +: 2]; - mem[128 * 1 + count] = INIT_01[(count * 2) +: 2]; - mem[128 * 2 + count] = INIT_02[(count * 2) +: 2]; - mem[128 * 3 + count] = INIT_03[(count * 2) +: 2]; - mem[128 * 4 + count] = INIT_04[(count * 2) +: 2]; - mem[128 * 5 + count] = INIT_05[(count * 2) +: 2]; - mem[128 * 6 + count] = INIT_06[(count * 2) +: 2]; - mem[128 * 7 + count] = INIT_07[(count * 2) +: 2]; - mem[128 * 8 + count] = INIT_08[(count * 2) +: 2]; - mem[128 * 9 + count] = INIT_09[(count * 2) +: 2]; - mem[128 * 10 + count] = INIT_0A[(count * 2) +: 2]; - mem[128 * 11 + count] = INIT_0B[(count * 2) +: 2]; - mem[128 * 12 + count] = INIT_0C[(count * 2) +: 2]; - mem[128 * 13 + count] = INIT_0D[(count * 2) +: 2]; - mem[128 * 14 + count] = INIT_0E[(count * 2) +: 2]; - mem[128 * 15 + count] = INIT_0F[(count * 2) +: 2]; - mem[128 * 16 + count] = INIT_10[(count * 2) +: 2]; - mem[128 * 17 + count] = INIT_11[(count * 2) +: 2]; - mem[128 * 18 + count] = INIT_12[(count * 2) +: 2]; - mem[128 * 19 + count] = INIT_13[(count * 2) +: 2]; - mem[128 * 20 + count] = INIT_14[(count * 2) +: 2]; - mem[128 * 21 + count] = INIT_15[(count * 2) +: 2]; - mem[128 * 22 + count] = INIT_16[(count * 2) +: 2]; - mem[128 * 23 + count] = INIT_17[(count * 2) +: 2]; - mem[128 * 24 + count] = INIT_18[(count * 2) +: 2]; - mem[128 * 25 + count] = INIT_19[(count * 2) +: 2]; - mem[128 * 26 + count] = INIT_1A[(count * 2) +: 2]; - mem[128 * 27 + count] = INIT_1B[(count * 2) +: 2]; - mem[128 * 28 + count] = INIT_1C[(count * 2) +: 2]; - mem[128 * 29 + count] = INIT_1D[(count * 2) +: 2]; - mem[128 * 30 + count] = INIT_1E[(count * 2) +: 2]; - mem[128 * 31 + count] = INIT_1F[(count * 2) +: 2]; - mem[128 * 32 + count] = INIT_20[(count * 2) +: 2]; - mem[128 * 33 + count] = INIT_21[(count * 2) +: 2]; - mem[128 * 34 + count] = INIT_22[(count * 2) +: 2]; - mem[128 * 35 + count] = INIT_23[(count * 2) +: 2]; - mem[128 * 36 + count] = INIT_24[(count * 2) +: 2]; - mem[128 * 37 + count] = INIT_25[(count * 2) +: 2]; - mem[128 * 38 + count] = INIT_26[(count * 2) +: 2]; - mem[128 * 39 + count] = INIT_27[(count * 2) +: 2]; - mem[128 * 40 + count] = INIT_28[(count * 2) +: 2]; - mem[128 * 41 + count] = INIT_29[(count * 2) +: 2]; - mem[128 * 42 + count] = INIT_2A[(count * 2) +: 2]; - mem[128 * 43 + count] = INIT_2B[(count * 2) +: 2]; - mem[128 * 44 + count] = INIT_2C[(count * 2) +: 2]; - mem[128 * 45 + count] = INIT_2D[(count * 2) +: 2]; - mem[128 * 46 + count] = INIT_2E[(count * 2) +: 2]; - mem[128 * 47 + count] = INIT_2F[(count * 2) +: 2]; - mem[128 * 48 + count] = INIT_30[(count * 2) +: 2]; - mem[128 * 49 + count] = INIT_31[(count * 2) +: 2]; - mem[128 * 50 + count] = INIT_32[(count * 2) +: 2]; - mem[128 * 51 + count] = INIT_33[(count * 2) +: 2]; - mem[128 * 52 + count] = INIT_34[(count * 2) +: 2]; - mem[128 * 53 + count] = INIT_35[(count * 2) +: 2]; - mem[128 * 54 + count] = INIT_36[(count * 2) +: 2]; - mem[128 * 55 + count] = INIT_37[(count * 2) +: 2]; - mem[128 * 56 + count] = INIT_38[(count * 2) +: 2]; - mem[128 * 57 + count] = INIT_39[(count * 2) +: 2]; - mem[128 * 58 + count] = INIT_3A[(count * 2) +: 2]; - mem[128 * 59 + count] = INIT_3B[(count * 2) +: 2]; - mem[128 * 60 + count] = INIT_3C[(count * 2) +: 2]; - mem[128 * 61 + count] = INIT_3D[(count * 2) +: 2]; - mem[128 * 62 + count] = INIT_3E[(count * 2) +: 2]; - mem[128 * 63 + count] = INIT_3F[(count * 2) +: 2]; - end - - - change_clka <= 0; - change_clkb <= 0; - data_collision <= 0; - data_collision_a_b <= 0; - data_collision_b_a <= 0; - memory_collision <= 0; - memory_collision_a_b <= 0; - memory_collision_b_a <= 0; - setup_all_a_b <= 0; - setup_all_b_a <= 0; - setup_zero <= 0; - setup_rf_a_b <= 0; - setup_rf_b_a <= 0; - end - - assign data_addra_int = addra_int * 1; - assign data_addra_reg = addra_reg * 1; - assign data_addrb_int = addrb_int * 2; - assign data_addrb_reg = addrb_reg * 2; - - - initial begin - - display_flag = 1; - output_flag = 1; - - case (SIM_COLLISION_CHECK) - - "NONE" : begin - output_flag = 0; - display_flag = 0; - end - "WARNING_ONLY" : output_flag = 0; - "GENERATE_ONLY" : display_flag = 0; - "ALL" : ; - - default : begin - $display("Attribute Syntax Error : The Attribute SIM_COLLISION_CHECK on RAMB16_S1_S2 instance %m is set to %s. Legal values for this attribute are ALL, NONE, WARNING_ONLY or GENERATE_ONLY.", SIM_COLLISION_CHECK); - $finish; - end - - endcase // case(SIM_COLLISION_CHECK) - - end // initial begin - - - always @(posedge clka_int) begin - if ((output_flag || display_flag)) begin - time_clka = $time; - #0 time_clkb_clka = time_clka - time_clkb; - change_clka = ~change_clka; - end - end - - always @(posedge clkb_int) begin - if ((output_flag || display_flag)) begin - time_clkb = $time; - #0 time_clka_clkb = time_clkb - time_clka; - change_clkb = ~change_clkb; - end - end - - always @(change_clkb) begin - if ((0 < time_clka_clkb) && (time_clka_clkb < SETUP_ALL)) - setup_all_a_b = 1; - if ((0 < time_clka_clkb) && (time_clka_clkb < SETUP_READ_FIRST)) - setup_rf_a_b = 1; - end - - always @(change_clka) begin - if ((0 < time_clkb_clka) && (time_clkb_clka < SETUP_ALL)) - setup_all_b_a = 1; - if ((0 < time_clkb_clka) && (time_clkb_clka < SETUP_READ_FIRST)) - setup_rf_b_a = 1; - end - - always @(change_clkb or change_clka) begin - if ((time_clkb_clka == 0) && (time_clka_clkb == 0)) - setup_zero = 1; - end - - always @(posedge setup_zero) begin - if ((ena_int == 1) && (wea_int == 1) && - (enb_int == 1) && (web_int == 1) && - (data_addra_int[14:1] == data_addrb_int[14:1])) - memory_collision <= 1; - end - - always @(posedge setup_all_a_b or posedge setup_rf_a_b) begin - if ((ena_reg == 1) && (wea_reg == 1) && - (enb_int == 1) && (web_int == 1) && - (data_addra_reg[14:1] == data_addrb_int[14:1])) - memory_collision_a_b <= 1; - end - - always @(posedge setup_all_b_a or posedge setup_rf_b_a) begin - if ((ena_int == 1) && (wea_int == 1) && - (enb_reg == 1) && (web_reg == 1) && - (data_addra_int[14:1] == data_addrb_reg[14:1])) - memory_collision_b_a <= 1; - end - - always @(posedge setup_all_a_b) begin - if (data_addra_reg[14:1] == data_addrb_int[14:1]) begin - if ((ena_reg == 1) && (enb_int == 1)) begin - case ({wr_mode_a, wr_mode_b, wea_reg, web_int}) - 6'b000011 : begin data_collision_a_b <= 2'b11; display_wa_wb; end - 6'b000111 : begin data_collision_a_b <= 2'b11; display_wa_wb; end - 6'b001011 : begin data_collision_a_b <= 2'b10; display_wa_wb; end -// 6'b010011 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b010111 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b011011 : begin data_collision_a_b <= 2'b00; display_wa_wb; end - 6'b100011 : begin data_collision_a_b <= 2'b01; display_wa_wb; end - 6'b100111 : begin data_collision_a_b <= 2'b01; display_wa_wb; end - 6'b101011 : begin display_wa_wb; end - 6'b000001 : begin data_collision_a_b <= 2'b10; display_ra_wb; end -// 6'b000101 : begin data_collision_a_b <= 2'b00; display_ra_wb; end - 6'b001001 : begin data_collision_a_b <= 2'b10; display_ra_wb; end - 6'b010001 : begin data_collision_a_b <= 2'b10; display_ra_wb; end -// 6'b010101 : begin data_collision_a_b <= 2'b00; display_ra_wb; end - 6'b011001 : begin data_collision_a_b <= 2'b10; display_ra_wb; end - 6'b100001 : begin data_collision_a_b <= 2'b10; display_ra_wb; end -// 6'b100101 : begin data_collision_a_b <= 2'b00; display_ra_wb; end - 6'b101001 : begin data_collision_a_b <= 2'b10; display_ra_wb; end - 6'b000010 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - 6'b000110 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - 6'b001010 : begin data_collision_a_b <= 2'b01; display_wa_rb; end -// 6'b010010 : begin data_collision_a_b <= 2'b00; display_wa_rb; end -// 6'b010110 : begin data_collision_a_b <= 2'b00; display_wa_rb; end -// 6'b011010 : begin data_collision_a_b <= 2'b00; display_wa_rb; end - 6'b100010 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - 6'b100110 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - 6'b101010 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - endcase - end - end - setup_all_a_b <= 0; - end - - - always @(posedge setup_all_b_a) begin - if (data_addra_int[14:1] == data_addrb_reg[14:1]) begin - if ((ena_int == 1) && (enb_reg == 1)) begin - case ({wr_mode_a, wr_mode_b, wea_int, web_reg}) - 6'b000011 : begin data_collision_b_a <= 2'b11; display_wa_wb; end -// 6'b000111 : begin data_collision_b_a <= 2'b00; display_wa_wb; end - 6'b001011 : begin data_collision_b_a <= 2'b10; display_wa_wb; end - 6'b010011 : begin data_collision_b_a <= 2'b11; display_wa_wb; end -// 6'b010111 : begin data_collision_b_a <= 2'b00; display_wa_wb; end - 6'b011011 : begin data_collision_b_a <= 2'b10; display_wa_wb; end - 6'b100011 : begin data_collision_b_a <= 2'b01; display_wa_wb; end - 6'b100111 : begin data_collision_b_a <= 2'b01; display_wa_wb; end - 6'b101011 : begin display_wa_wb; end - 6'b000001 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b000101 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b001001 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b010001 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b010101 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b011001 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b100001 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b100101 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b101001 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b000010 : begin data_collision_b_a <= 2'b01; display_wa_rb; end - 6'b000110 : begin data_collision_b_a <= 2'b01; display_wa_rb; end - 6'b001010 : begin data_collision_b_a <= 2'b01; display_wa_rb; end -// 6'b010010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b010110 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b011010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end - 6'b100010 : begin data_collision_b_a <= 2'b01; display_wa_rb; end - 6'b100110 : begin data_collision_b_a <= 2'b01; display_wa_rb; end - 6'b101010 : begin data_collision_b_a <= 2'b01; display_wa_rb; end - endcase - end - end - setup_all_b_a <= 0; - end - - - always @(posedge setup_zero) begin - if (data_addra_int[14:1] == data_addrb_int[14:1]) begin - if ((ena_int == 1) && (enb_int == 1)) begin - case ({wr_mode_a, wr_mode_b, wea_int, web_int}) - 6'b000011 : begin data_collision <= 2'b11; display_wa_wb; end - 6'b000111 : begin data_collision <= 2'b11; display_wa_wb; end - 6'b001011 : begin data_collision <= 2'b10; display_wa_wb; end - 6'b010011 : begin data_collision <= 2'b11; display_wa_wb; end - 6'b010111 : begin data_collision <= 2'b11; display_wa_wb; end - 6'b011011 : begin data_collision <= 2'b10; display_wa_wb; end - 6'b100011 : begin data_collision <= 2'b01; display_wa_wb; end - 6'b100111 : begin data_collision <= 2'b01; display_wa_wb; end - 6'b101011 : begin display_wa_wb; end - 6'b000001 : begin data_collision <= 2'b10; display_ra_wb; end -// 6'b000101 : begin data_collision <= 2'b00; display_ra_wb; end - 6'b001001 : begin data_collision <= 2'b10; display_ra_wb; end - 6'b010001 : begin data_collision <= 2'b10; display_ra_wb; end -// 6'b010101 : begin data_collision <= 2'b00; display_ra_wb; end - 6'b011001 : begin data_collision <= 2'b10; display_ra_wb; end - 6'b100001 : begin data_collision <= 2'b10; display_ra_wb; end -// 6'b100101 : begin data_collision <= 2'b00; display_ra_wb; end - 6'b101001 : begin data_collision <= 2'b10; display_ra_wb; end - 6'b000010 : begin data_collision <= 2'b01; display_wa_rb; end - 6'b000110 : begin data_collision <= 2'b01; display_wa_rb; end - 6'b001010 : begin data_collision <= 2'b01; display_wa_rb; end -// 6'b010010 : begin data_collision <= 2'b00; display_wa_rb; end -// 6'b010110 : begin data_collision <= 2'b00; display_wa_rb; end -// 6'b011010 : begin data_collision <= 2'b00; display_wa_rb; end - 6'b100010 : begin data_collision <= 2'b01; display_wa_rb; end - 6'b100110 : begin data_collision <= 2'b01; display_wa_rb; end - 6'b101010 : begin data_collision <= 2'b01; display_wa_rb; end - endcase - end - end - setup_zero <= 0; - end - - task display_ra_wb; - begin - if (display_flag) - $display("Memory Collision Error on RAMB16_S1_S2:%m at simulation time %.3f ns\nA read was performed on address %h (hex) of Port A while a write was requested to the same address on Port B. The write will be successful however the read value on Port A is unknown until the next CLKA cycle.", $time/1000.0, addra_int); - end - endtask - - task display_wa_rb; - begin - if (display_flag) - $display("Memory Collision Error on RAMB16_S1_S2:%m at simulation time %.3f ns\nA read was performed on address %h (hex) of Port B while a write was requested to the same address on Port A. The write will be successful however the read value on Port B is unknown until the next CLKB cycle.", $time/1000.0, addrb_int); - end - endtask - - task display_wa_wb; - begin - if (display_flag) - $display("Memory Collision Error on RAMB16_S1_S2:%m at simulation time %.3f ns\nA write was requested to the same address simultaneously at both Port A and Port B of the RAM. The contents written to the RAM at address location %h (hex) of Port A and address location %h (hex) of Port B are unknown.", $time/1000.0, addra_int, addrb_int); - end - endtask - - - always @(posedge setup_rf_a_b) begin - if (data_addra_reg[14:1] == data_addrb_int[14:1]) begin - if ((ena_reg == 1) && (enb_int == 1)) begin - case ({wr_mode_a, wr_mode_b, wea_reg, web_int}) -// 6'b000011 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b000111 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b001011 : begin data_collision_a_b <= 2'b00; display_wa_wb; end - 6'b010011 : begin data_collision_a_b <= 2'b11; display_wa_wb; end - 6'b010111 : begin data_collision_a_b <= 2'b11; display_wa_wb; end - 6'b011011 : begin data_collision_a_b <= 2'b10; display_wa_wb; end -// 6'b100011 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b100111 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b101011 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b000001 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b000101 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b001001 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b010001 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b010101 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b011001 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b100001 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b100101 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b101001 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b000010 : begin data_collision_a_b <= 2'b00; display_wa_rb; end -// 6'b000110 : begin data_collision_a_b <= 2'b00; display_wa_rb; end -// 6'b001010 : begin data_collision_a_b <= 2'b00; display_wa_rb; end - 6'b010010 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - 6'b010110 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - 6'b011010 : begin data_collision_a_b <= 2'b01; display_wa_rb; end -// 6'b100010 : begin data_collision_a_b <= 2'b00; display_wa_rb; end -// 6'b100110 : begin data_collision_a_b <= 2'b00; display_wa_rb; end -// 6'b101010 : begin data_collision_a_b <= 2'b00; display_wa_rb; end - endcase - end - end - setup_rf_a_b <= 0; - end - - - always @(posedge setup_rf_b_a) begin - if (data_addra_int[14:1] == data_addrb_reg[14:1]) begin - if ((ena_int == 1) && (enb_reg == 1)) begin - case ({wr_mode_a, wr_mode_b, wea_int, web_reg}) -// 6'b000011 : begin data_collision_b_a <= 2'b00; display_wa_wb; end - 6'b000111 : begin data_collision_b_a <= 2'b11; display_wa_wb; end -// 6'b001011 : begin data_collision_b_a <= 2'b00; display_wa_wb; end -// 6'b010011 : begin data_collision_b_a <= 2'b00; display_wa_wb; end - 6'b010111 : begin data_collision_b_a <= 2'b11; display_wa_wb; end -// 6'b011011 : begin data_collision_b_a <= 2'b00; display_wa_wb; end -// 6'b100011 : begin data_collision_b_a <= 2'b00; display_wa_wb; end - 6'b100111 : begin data_collision_b_a <= 2'b01; display_wa_wb; end -// 6'b101011 : begin data_collision_b_a <= 2'b00; display_wa_wb; end -// 6'b000001 : begin data_collision_b_a <= 2'b00; display_ra_wb; end - 6'b000101 : begin data_collision_b_a <= 2'b10; display_ra_wb; end -// 6'b001001 : begin data_collision_b_a <= 2'b00; display_ra_wb; end -// 6'b010001 : begin data_collision_b_a <= 2'b00; display_ra_wb; end - 6'b010101 : begin data_collision_b_a <= 2'b10; display_ra_wb; end -// 6'b011001 : begin data_collision_b_a <= 2'b00; display_ra_wb; end -// 6'b100001 : begin data_collision_b_a <= 2'b00; display_ra_wb; end - 6'b100101 : begin data_collision_b_a <= 2'b10; display_ra_wb; end -// 6'b101001 : begin data_collision_b_a <= 2'b00; display_ra_wb; end -// 6'b000010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b000110 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b001010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b010010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b010110 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b011010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b100010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b100110 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b101010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end - endcase - end - end - setup_rf_b_a <= 0; - end - - - always @(posedge clka_int) begin - if ((output_flag || display_flag)) begin - addra_reg <= addra_int; - ena_reg <= ena_int; - ssra_reg <= ssra_int; - wea_reg <= wea_int; - end - end - - always @(posedge clkb_int) begin - if ((output_flag || display_flag)) begin - addrb_reg <= addrb_int; - enb_reg <= enb_int; - ssrb_reg <= ssrb_int; - web_reg <= web_int; - end - end - - - // Data - always @(posedge memory_collision) begin - if ((output_flag || display_flag)) begin - mem[addra_int[13:1]][addra_int[0:0] * 1 +: 1] <= 1'bx; - memory_collision <= 0; - end - - end - - always @(posedge memory_collision_a_b) begin - if ((output_flag || display_flag)) begin - mem[addra_reg[13:1]][addra_reg[0:0] * 1 +: 1] <= 1'bx; - memory_collision_a_b <= 0; - end - end - - always @(posedge memory_collision_b_a) begin - if ((output_flag || display_flag)) begin - mem[addra_int[13:1]][addra_int[0:0] * 1 +: 1] <= 1'bx; - memory_collision_b_a <= 0; - end - end - - always @(posedge data_collision[1]) begin - if (ssra_int == 0 && output_flag) begin - doa_out <= #100 1'bX; - end - data_collision[1] <= 0; - end - - always @(posedge data_collision[0]) begin - if (ssrb_int == 0 && output_flag) begin - dob_out[addra_int[0:0] * 1 +: 1] <= #100 1'bX; - end - data_collision[0] <= 0; - end - - always @(posedge data_collision_a_b[1]) begin - if (ssra_reg == 0 && output_flag) begin - doa_out <= #100 1'bX; - end - data_collision_a_b[1] <= 0; - end - - always @(posedge data_collision_a_b[0]) begin - if (ssrb_int == 0 && output_flag) begin - dob_out[addra_reg[0:0] * 1 +: 1] <= #100 1'bX; - end - data_collision_a_b[0] <= 0; - end - - always @(posedge data_collision_b_a[1]) begin - if (ssra_int == 0 && output_flag) begin - doa_out <= #100 1'bX; - end - data_collision_b_a[1] <= 0; - end - - always @(posedge data_collision_b_a[0]) begin - if (ssrb_reg == 0 && output_flag) begin - dob_out[addra_int[0:0] * 1 +: 1] <= #100 1'bX; - end - data_collision_b_a[0] <= 0; - end - - - initial begin - case (WRITE_MODE_A) - "WRITE_FIRST" : wr_mode_a <= 2'b00; - "READ_FIRST" : wr_mode_a <= 2'b01; - "NO_CHANGE" : wr_mode_a <= 2'b10; - default : begin - $display("Attribute Syntax Error : The Attribute WRITE_MODE_A on RAMB16_S1_S2 instance %m is set to %s. Legal values for this attribute are WRITE_FIRST, READ_FIRST or NO_CHANGE.", WRITE_MODE_A); - $finish; - end - endcase - end - - initial begin - case (WRITE_MODE_B) - "WRITE_FIRST" : wr_mode_b <= 2'b00; - "READ_FIRST" : wr_mode_b <= 2'b01; - "NO_CHANGE" : wr_mode_b <= 2'b10; - default : begin - $display("Attribute Syntax Error : The Attribute WRITE_MODE_B on RAMB16_S1_S2 instance %m is set to %s. Legal values for this attribute are WRITE_FIRST, READ_FIRST or NO_CHANGE.", WRITE_MODE_B); - $finish; - end - endcase - end - - - // Port A - always @(posedge clka_int) begin - - if (ena_int == 1'b1) begin - - if (ssra_int == 1'b1) begin - {doa_out} <= #100 SRVAL_A; - end - else begin - if (wea_int == 1'b1) begin - if (wr_mode_a == 2'b00) begin - doa_out <= #100 dia_int; - end - else if (wr_mode_a == 2'b01) begin - - doa_out <= #100 mem[addra_int[13:1]][addra_int[0:0] * 1 +: 1]; - - end - end - else begin - - doa_out <= #100 mem[addra_int[13:1]][addra_int[0:0] * 1 +: 1]; - - end - end - - // memory - if (wea_int == 1'b1) begin - mem[addra_int[13:1]][addra_int[0:0] * 1 +: 1] <= dia_int; - end - - end - end - - - // Port B - always @(posedge clkb_int) begin - - if (enb_int == 1'b1) begin - - if (ssrb_int == 1'b1) begin - {dob_out} <= #100 SRVAL_B; - end - else begin - if (web_int == 1'b1) begin - if (wr_mode_b == 2'b00) begin - dob_out <= #100 dib_int; - end - else if (wr_mode_b == 2'b01) begin - dob_out <= #100 mem[addrb_int]; - end - end - else begin - dob_out <= #100 mem[addrb_int]; - end - end - - // memory - if (web_int == 1'b1) begin - mem[addrb_int] <= dib_int; - end - - end - end - - -endmodule - -`endif diff --git a/eth/demo/verilog/demo.ucf b/eth/demo/verilog/demo.ucf deleted file mode 100644 index f3562b46b..000000000 --- a/eth/demo/verilog/demo.ucf +++ /dev/null @@ -1,52 +0,0 @@ -NET "Reset_n" LOC = "C15"; // PushButton #4
-NET "Clk_100M" LOC = "B15";
-NET "Clk_125M" LOC = "A16"; // GMII only
-
-NET "RS232_TXD" LOC = "A9";
-NET "RS232_RXD" LOC = "F1";
-
-NET "USB_TXD" LOC = "D1";
-NET "USB_RXD" LOC = "A8";
-
-NET "PHY_RESET_n" LOC = "E25";
-
-NET "PHY_RXC" LOC = "B13";
-NET "PHY_RXD<0>" LOC = "D16";
-NET "PHY_RXD<1>" LOC = "C16";
-NET "PHY_RXD<2>" LOC = "D15";
-NET "PHY_RXD<3>" LOC = "D14";
-NET "PHY_RXD<4>" LOC = "E14";
-NET "PHY_RXD<5>" LOC = "F14";
-NET "PHY_RXD<6>" LOC = "F11";
-NET "PHY_RXD<7>" LOC = "F12";
-NET "PHY_RXDV" LOC = "F13";
-NET "PHY_RXER" LOC = "E13";
-
-NET "PHY_GTX_CLK" LOC = "C26"; // GMII only
-NET "PHY_TXC" LOC = "A10";
-NET "PHY_TXD<0>" LOC = "H26";
-NET "PHY_TXD<1>" LOC = "H24";
-NET "PHY_TXD<2>" LOC = "G26";
-NET "PHY_TXD<3>" LOC = "G24";
-NET "PHY_TXD<4>" LOC = "F26";
-NET "PHY_TXD<5>" LOC = "F24";
-NET "PHY_TXD<6>" LOC = "E26";
-NET "PHY_TXD<7>" LOC = "E24";
-NET "PHY_TXEN" LOC = "D26";
-NET "PHY_TXER" LOC = "D24";
-
-NET "PHY_COL" LOC = "B24";
-NET "PHY_CRS" LOC = "D25";
-
-NET "PHY_MDC" LOC = "G25";
-NET "PHY_MDIO" LOC = "H25";
-
-NET "LED<1>" LOC = "D13"; // LED #1-4
-NET "LED<2>" LOC = "D12";
-NET "LED<3>" LOC = "C11";
-NET "LED<4>" LOC = "D11";
-
-NET "Clk_100M" PERIOD = 10.000 ; # 100 MHz
-NET "Clk_125M" PERIOD = 8.000 ; # 125 MHz
-NET "PHY_RXC" PERIOD = 8.000 ; # 125 MHz
-NET "PHY_TXC" PERIOD = 8.000 ; # 125 MHz
diff --git a/eth/demo/verilog/demo.v b/eth/demo/verilog/demo.v deleted file mode 100644 index 649903c9a..000000000 --- a/eth/demo/verilog/demo.v +++ /dev/null @@ -1,378 +0,0 @@ -module demo(
- Reset_n,
- Clk_100M,
- Clk_125M, // GMII only
-
- RS232_TXD,
- RS232_RXD,
-
- USB_TXD,
- USB_RXD,
-
- //--- 10/100/1000BASE-T Ethernet PHY (MII/GMII)
- PHY_RESET_n,
-
- PHY_RXC,
- PHY_RXD,
- PHY_RXDV,
- PHY_RXER,
-
- PHY_GTX_CLK, // GMII only
- PHY_TXC,
- PHY_TXD,
- PHY_TXEN,
- PHY_TXER,
-
- PHY_COL,
- PHY_CRS,
-
- PHY_MDC,
- PHY_MDIO,
-
- // Misc. I/Os
- LED,
- Button
-);
-
- input Reset_n;
- input Clk_100M;
- input Clk_125M; // GMII
-
- output RS232_TXD;
- input RS232_RXD;
-
- output USB_TXD;
- input USB_RXD;
-
- //--- 10/100/1000BASE-T Ethernet PHY (MII/GMII)
- output PHY_RESET_n;
-
- input PHY_RXC;
- input [7:0] PHY_RXD;
- input PHY_RXDV;
- input PHY_RXER;
-
- output PHY_GTX_CLK; // GMII only
- input PHY_TXC;
- output [7:0] PHY_TXD;
- output PHY_TXEN;
- output PHY_TXER;
-
- input PHY_COL;
- input PHY_CRS;
-
- output PHY_MDC;
- inout PHY_MDIO;
-
- // Misc. I/Os
- output [1:4] LED;
-
- input [1:4] Button;
-
- //-------------------------------------------------------------------------
- // Local declarations
- //-------------------------------------------------------------------------
-
- // Rename to "standard" core clock name
- wire Clk = Clk_100M;
-
- reg [27:0] Counter;
- always @( negedge Reset_n or posedge Clk )
- if ( ~Reset_n )
- Counter <= 0;
- else
- Counter <= Counter + 1;
-
- assign LED[1:4] = Counter[27:24];
-
- //-------------------------------------------------------------------------
- // Instantiation of sub-modules
- //-------------------------------------------------------------------------
-
- //--- UART ----------------------------------------------------------------
-
- wire UART_RXD;
- wire UART_TXD;
- wire UART_RxValid;
- wire [7:0] UART_RxData;
- wire UART_TxReady;
- wire UART_TxValid;
- wire [7:0] UART_TxData;
-
- demo_uart demo_uart(
- .Reset_n( Reset_n ),
- .Clk ( Clk ),
-
- // Interface to UART PHY
- .RXD_i( UART_RXD ),
- .TXD_o( UART_TXD ),
-
- // Clk is divided by (Prescaler+1) to generate 16x the bitrate
-`ifdef EHDL_SIMULATION
- .Prescaler_i( 16'd3 ), // Corresponds to VERY FAST - for simulation only!
-`else
- .Prescaler_i( 16'd650 ), // Corresponds to 9600 baud (assuming 100 MHz clock)
-`endif
-
- // Pulsed when RxData is valid
- .RxValid_o( UART_RxValid ),
- .RxData_o ( UART_RxData ),
-
- // Asserted when ready for a new Tx byte
- .TxReady_o( UART_TxReady ),
-
- // Pulsed when TxData is valid
- .TxValid_i( UART_TxValid ),
- .TxData_i ( UART_TxData )
- );
-
- // Transmit & receive in parallel on either RS232 or USB/RS232 interface
-// assign UART_RXD = RS232_RXD & USB_RXD; // RS232 signals are high when inactive
- assign UART_RXD = RS232_RXD;
-
- assign RS232_TXD = UART_TXD;
- assign USB_TXD = UART_TXD;
-
- //--- UART-to-Wishbone Master ---------------------------------------------
-
- wire WB_STB_ETH;
- wire WB_STB_PDM;
- wire WB_STB_PG;
- wire WB_CYC;
- wire [14:0] WB_ADR;
- wire WB_WE;
- wire [15:0] WB_DAT_Wr;
- wire [15:0] WB_DAT_Rd;
- wire WB_ACK;
-
- demo_wishbone_master demo_wishbone_master(
- .Reset_n( Reset_n ),
- .Clk ( Clk ),
-
- //--- UART interface
-
- // Pulsed when RxData_i is valid
- .RxValid_i( UART_RxValid ),
- .RxData_i ( UART_RxData ),
-
- // Asserted when ready for a new Tx byte
- .TxReady_i( UART_TxReady ),
-
- // Pulsed when TxData_o is valid
- .TxValid_o( UART_TxValid ),
- .TxData_o ( UART_TxData ),
-
- //--- Wishbone interface
- .STB_ETH_O( WB_STB_ETH ),
- .STB_PDM_O( WB_STB_PDM ),
- .STB_PG_O ( WB_STB_PG ),
- .CYC_O ( WB_CYC ),
- .ADR_O ( WB_ADR ),
- .WE_O ( WB_WE ),
- .DAT_O ( WB_DAT_Wr ),
- .DAT_I ( WB_DAT_Rd ),
- .ACK_I ( WB_ACK )
- );
-
- //--- Wishbone clients ----------------------------------------------------
-
- //--- Packet Descriptor Memory --------------------------------------------
-
- wire [15:0] WB_DAT_Rd_PDM;
- wire WB_ACK_PDM;
-
- wire PDM_Rd;
- wire [13:0] PDM_Addr;
- wire [31:0] PDM_RdData;
-
- demo_packet_descriptor_memory demo_packet_descriptor_memory(
- .Reset_n( Reset_n ),
- .Clk ( Clk ),
-
- //--- Wishbone interface
- .STB_I( WB_STB_PDM ),
- .CYC_I( WB_CYC ),
- .ADR_I( WB_ADR ),
- .WE_I ( WB_WE ),
- .DAT_I( WB_DAT_Wr ),
- .DAT_O( WB_DAT_Rd_PDM ),
- .ACK_O( WB_ACK_PDM ),
-
- //--- Packet Generator interface
- // RdData_o is always valid exactly one clock after Addr_i changes
- // and Rd_i is asserted
- .Rd_i ( PDM_Rd ),
- .Addr_i ( PDM_Addr ),
- .RdData_o( PDM_RdData )
- );
-
- //--- Packet Generator ----------------------------------------------------
-
- wire [15:0] WB_DAT_Rd_PG;
- wire WB_ACK_PG;
-
- wire Rx_mac_ra;
- wire Rx_mac_rd;
- wire [31:0] Rx_mac_data;
- wire [1:0] Rx_mac_BE;
- wire Rx_mac_pa;
- wire Rx_mac_sop;
- wire Rx_mac_err;
- wire Rx_mac_eop;
-
- wire Tx_mac_wa;
- wire Tx_mac_wr;
- wire [31:0] Tx_mac_data;
- wire [1:0] Tx_mac_BE;
- wire Tx_mac_sop;
- wire Tx_mac_eop;
-
- demo_packet_generator demo_packet_generator(
- .Reset_n( Reset_n ),
- .Clk ( Clk ),
-
- //--- Wishbone interface
- .STB_I( WB_STB_PG ),
- .CYC_I( WB_CYC ),
- .ADR_I( WB_ADR[1:0] ),
- .WE_I ( WB_WE ),
- .DAT_I( WB_DAT_Wr ),
- .DAT_O( WB_DAT_Rd_PG ),
- .ACK_O( WB_ACK_PG ),
-
- //--- Packet Descriptor Memory interface
- // RdData_i is always valid exactly one clock after Addr_o changes
- // and Rd_o is asserted
- .Rd_o ( PDM_Rd ),
- .Addr_o ( PDM_Addr ),
- .RdData_i( PDM_RdData ),
-
- //--- User (packet) interface
- .Rx_mac_ra ( Rx_mac_ra ),
- .Rx_mac_rd ( Rx_mac_rd ),
- .Rx_mac_data( Rx_mac_data ),
- .Rx_mac_BE ( Rx_mac_BE ),
- .Rx_mac_pa ( Rx_mac_pa ),
- .Rx_mac_sop ( Rx_mac_sop ),
- .Rx_mac_err ( Rx_mac_err ),
- .Rx_mac_eop ( Rx_mac_eop ),
-
- .Tx_mac_wa ( Tx_mac_wa ),
- .Tx_mac_wr ( Tx_mac_wr ),
- .Tx_mac_data( Tx_mac_data ),
- .Tx_mac_BE ( Tx_mac_BE ),
- .Tx_mac_sop ( Tx_mac_sop ),
- .Tx_mac_eop ( Tx_mac_eop )
- );
-
- //--- Simple Wishbone client ----------------------------------------------
-
- reg [15:0] Reg1;
- reg [15:0] Reg2;
-
- reg WB_ACK_Reg;
- reg [15:0] WB_DAT_Reg;
-
- always @( negedge Reset_n or posedge Clk )
- if ( ~Reset_n )
- begin
- WB_ACK_Reg <= 0;
- WB_DAT_Reg <= 'b0;
-
- Reg1 <= 16'h1234;
- Reg2 <= 16'hABCD;
- end
- else
- begin
- WB_ACK_Reg <= 0;
- if ( WB_CYC & ~( WB_STB_ETH | WB_STB_PG | WB_STB_PDM ) )
- begin
- WB_ACK_Reg <= 1;
- if ( WB_WE )
- begin
- if ( WB_ADR[0] )
- Reg2 <= WB_DAT_Wr;
- else
- Reg1 <= WB_DAT_Wr;
- end
- else
- begin
- if ( WB_ADR[0] )
- WB_DAT_Reg <= Reg2;
- else
- WB_DAT_Reg <= Reg1;
- end
- end
- end
-
- //--- DUT - Ethernet Core -------------------------------------------------
-
- wire [15:0] WB_DAT_Rd_ETH;
- wire WB_ACK_ETH;
-
- wire [2:0] Speed;
-
- MAC_top dut(
- // System signals
- .Clk_125M( Clk_125M ),
- .Clk_user( Clk ),
- .Speed ( Speed ),
-
- // Wishbone compliant core host interface
- .RST_I( ~Reset_n ),
- .CLK_I( Clk ),
- .STB_I( WB_STB_ETH ),
- .CYC_I( WB_CYC ),
- .ADR_I( WB_ADR[6:0] ),
- .WE_I ( WB_WE ),
- .DAT_I( WB_DAT_Wr ),
- .DAT_O( WB_DAT_Rd_ETH ),
- .ACK_O( WB_ACK_ETH ),
-
- // User (packet) interface
- .Rx_mac_ra ( Rx_mac_ra ),
- .Rx_mac_rd ( Rx_mac_rd ),
- .Rx_mac_data( Rx_mac_data ),
- .Rx_mac_BE ( Rx_mac_BE ),
- .Rx_mac_pa ( Rx_mac_pa ),
- .Rx_mac_sop ( Rx_mac_sop ),
- .Rx_mac_err ( Rx_mac_err ),
- .Rx_mac_eop ( Rx_mac_eop ),
-
- .Tx_mac_wa ( Tx_mac_wa ),
- .Tx_mac_wr ( Tx_mac_wr ),
- .Tx_mac_data( Tx_mac_data ),
- .Tx_mac_BE ( Tx_mac_BE ),
- .Tx_mac_sop ( Tx_mac_sop ),
- .Tx_mac_eop ( Tx_mac_eop ),
-
- // PHY interface (GMII/MII)
- .Gtx_clk( PHY_GTX_CLK ), // Used only in GMII mode
- .Rx_clk ( PHY_RXC ),
- .Tx_clk ( PHY_TXC ), // Used only in MII mode
- .Tx_er ( PHY_TXER ),
- .Tx_en ( PHY_TXEN ),
- .Txd ( PHY_TXD ),
- .Rx_er ( PHY_RXER ),
- .Rx_dv ( PHY_RXDV ),
- .Rxd ( PHY_RXD ),
- .Crs ( PHY_CRS ),
- .Col ( PHY_COL ),
-
- // MDIO interface (to PHY)
- .Mdio( PHY_MDIO ),
- .Mdc ( PHY_MDC )
- );
-
- //--- Combination of Wishbone read data and acknowledge -------------------
-
- assign WB_DAT_Rd = ({16{WB_ACK_Reg}} & WB_DAT_Reg ) |
- ({16{WB_ACK_PDM}} & WB_DAT_Rd_PDM) |
- ({16{WB_ACK_PG }} & WB_DAT_Rd_PG ) |
- ({16{WB_ACK_ETH}} & WB_DAT_Rd_ETH);
-
- assign WB_ACK = WB_ACK_Reg | WB_ACK_PDM | WB_ACK_PG | WB_ACK_ETH;
-
- assign PHY_RESET_n = Reset_n;
-
-endmodule
diff --git a/eth/demo/verilog/demo_packet_descriptor_memory.v b/eth/demo/verilog/demo_packet_descriptor_memory.v deleted file mode 100644 index a5588a7d1..000000000 --- a/eth/demo/verilog/demo_packet_descriptor_memory.v +++ /dev/null @@ -1,384 +0,0 @@ -module demo_packet_descriptor_memory(
- Reset_n,
- Clk,
-
- //--- Wishbone interface
- STB_I,
- CYC_I,
- ADR_I,
- WE_I,
- DAT_I,
- DAT_O,
- ACK_O,
-
- //--- Packet Generator interface
- // RdData_o is always valid exactly one clock after Addr_i changes
- // and Rd_i is asserted
- Rd_i,
- Addr_i,
- RdData_o
-);
-
- input Reset_n;
- input Clk;
-
- //--- Wishbone interface
- input STB_I;
- input CYC_I;
- input [14:0] ADR_I;
- input WE_I;
- input [15:0] DAT_I;
- output [15:0] DAT_O;
- output ACK_O;
-
- //--- Packet Generator interface
- // RdData_o is always valid exactly one clock after Addr_i changes
- // and Rd_i is asserted
- input Rd_i;
- input [13:0] Addr_i;
- output [31:0] RdData_o;
-
- //-------------------------------------------------------------------------
- // Local declarations
- //-------------------------------------------------------------------------
-
- reg ACK_O;
-
- //-------------------------------------------------------------------------
-
- wire [15:0] WrDataA = DAT_I;
- wire [15:0] RdDataA;
- wire [31:0] RdDataB;
-
- assign DAT_O = RdDataA;
- assign RdData_o = RdDataB;
-
- wire WB_Access = STB_I & CYC_I;
- wire WB_AccessClock1;
- reg WB_AccessClock2;
-
- assign WB_AccessClock1 = WB_Access & ~WB_AccessClock2;
-
- always @( negedge Reset_n or posedge Clk )
- if ( ~Reset_n )
- begin
- WB_AccessClock2 <= 0;
- ACK_O <= 0;
- end
- else
- begin
- WB_AccessClock2 <= WB_Access;
- ACK_O <= WB_AccessClock1;
- end
-
- //-------------------------------------------------------------------------
- // Instantiation of sub-modules
- //-------------------------------------------------------------------------
-
- //--- Instantiation of Xilinx 16 Kbit Dual Port Memory --------------------
-
- RAMB16_S1_S2 RAMB16_S1_S2_bit0 (
- .DOA( RdDataA[0] ),
- .DOB( { RdDataB[0], RdDataB[16+0] } ),
-
- .ADDRA( ADR_I[13:0] ),
- .DIA ( WrDataA[0] ),
- .ENA ( WB_AccessClock1 ),
- .CLKA ( Clk ),
- .WEA ( WE_I ),
- .SSRA ( 1'b0 ),
-
- .ADDRB( Addr_i[12:0] ),
- .DIB ( 2'b00 ),
- .ENB ( Rd_i ),
- .CLKB ( Clk ),
- .WEB ( 1'b0 ),
- .SSRB ( 1'b0 )
- );
-
- RAMB16_S1_S2 RAMB16_S1_S2_bit1 (
- .DOA( RdDataA[1] ),
- .DOB( { RdDataB[1], RdDataB[16+1] } ),
-
- .ADDRA( ADR_I[13:0] ),
- .DIA ( WrDataA[1] ),
- .ENA ( WB_AccessClock1 ),
- .CLKA ( Clk ),
- .WEA ( WE_I ),
- .SSRA ( 1'b0 ),
-
- .ADDRB( Addr_i[12:0] ),
- .DIB ( 2'b00 ),
- .ENB ( Rd_i ),
- .CLKB ( Clk ),
- .WEB ( 1'b0 ),
- .SSRB ( 1'b0 )
- );
-
- RAMB16_S1_S2 RAMB16_S1_S2_bit2 (
- .DOA( RdDataA[2] ),
- .DOB( { RdDataB[2], RdDataB[16+2] } ),
-
- .ADDRA( ADR_I[13:0] ),
- .DIA ( WrDataA[2] ),
- .ENA ( WB_AccessClock1 ),
- .CLKA ( Clk ),
- .WEA ( WE_I ),
- .SSRA ( 1'b0 ),
-
- .ADDRB( Addr_i[12:0] ),
- .DIB ( 2'b00 ),
- .ENB ( Rd_i ),
- .CLKB ( Clk ),
- .WEB ( 1'b0 ),
- .SSRB ( 1'b0 )
- );
-
- RAMB16_S1_S2 RAMB16_S1_S2_bit3 (
- .DOA( RdDataA[3] ),
- .DOB( { RdDataB[3], RdDataB[16+3] } ),
-
- .ADDRA( ADR_I[13:0] ),
- .DIA ( WrDataA[3] ),
- .ENA ( WB_AccessClock1 ),
- .CLKA ( Clk ),
- .WEA ( WE_I ),
- .SSRA ( 1'b0 ),
-
- .ADDRB( Addr_i[12:0] ),
- .DIB ( 2'b00 ),
- .ENB ( Rd_i ),
- .CLKB ( Clk ),
- .WEB ( 1'b0 ),
- .SSRB ( 1'b0 )
- );
-
- RAMB16_S1_S2 RAMB16_S1_S2_bit4 (
- .DOA( RdDataA[4] ),
- .DOB( { RdDataB[4], RdDataB[16+4] } ),
-
- .ADDRA( ADR_I[13:0] ),
- .DIA ( WrDataA[4] ),
- .ENA ( WB_AccessClock1 ),
- .CLKA ( Clk ),
- .WEA ( WE_I ),
- .SSRA ( 1'b0 ),
-
- .ADDRB( Addr_i[12:0] ),
- .DIB ( 2'b00 ),
- .ENB ( Rd_i ),
- .CLKB ( Clk ),
- .WEB ( 1'b0 ),
- .SSRB ( 1'b0 )
- );
-
- RAMB16_S1_S2 RAMB16_S1_S2_bit5 (
- .DOA( RdDataA[5] ),
- .DOB( { RdDataB[5], RdDataB[16+5] } ),
-
- .ADDRA( ADR_I[13:0] ),
- .DIA ( WrDataA[5] ),
- .ENA ( WB_AccessClock1 ),
- .CLKA ( Clk ),
- .WEA ( WE_I ),
- .SSRA ( 1'b0 ),
-
- .ADDRB( Addr_i[12:0] ),
- .DIB ( 2'b00 ),
- .ENB ( Rd_i ),
- .CLKB ( Clk ),
- .WEB ( 1'b0 ),
- .SSRB ( 1'b0 )
- );
-
- RAMB16_S1_S2 RAMB16_S1_S2_bit6 (
- .DOA( RdDataA[6] ),
- .DOB( { RdDataB[6], RdDataB[16+6] } ),
-
- .ADDRA( ADR_I[13:0] ),
- .DIA ( WrDataA[6] ),
- .ENA ( WB_AccessClock1 ),
- .CLKA ( Clk ),
- .WEA ( WE_I ),
- .SSRA ( 1'b0 ),
-
- .ADDRB( Addr_i[12:0] ),
- .DIB ( 2'b00 ),
- .ENB ( Rd_i ),
- .CLKB ( Clk ),
- .WEB ( 1'b0 ),
- .SSRB ( 1'b0 )
- );
-
- RAMB16_S1_S2 RAMB16_S1_S2_bit7 (
- .DOA( RdDataA[7] ),
- .DOB( { RdDataB[7], RdDataB[16+7] } ),
-
- .ADDRA( ADR_I[13:0] ),
- .DIA ( WrDataA[7] ),
- .ENA ( WB_AccessClock1 ),
- .CLKA ( Clk ),
- .WEA ( WE_I ),
- .SSRA ( 1'b0 ),
-
- .ADDRB( Addr_i[12:0] ),
- .DIB ( 2'b00 ),
- .ENB ( Rd_i ),
- .CLKB ( Clk ),
- .WEB ( 1'b0 ),
- .SSRB ( 1'b0 )
- );
-
- RAMB16_S1_S2 RAMB16_S1_S2_bit8 (
- .DOA( RdDataA[8] ),
- .DOB( { RdDataB[8], RdDataB[16+8] } ),
-
- .ADDRA( ADR_I[13:0] ),
- .DIA ( WrDataA[8] ),
- .ENA ( WB_AccessClock1 ),
- .CLKA ( Clk ),
- .WEA ( WE_I ),
- .SSRA ( 1'b0 ),
-
- .ADDRB( Addr_i[12:0] ),
- .DIB ( 2'b00 ),
- .ENB ( Rd_i ),
- .CLKB ( Clk ),
- .WEB ( 1'b0 ),
- .SSRB ( 1'b0 )
- );
-
- RAMB16_S1_S2 RAMB16_S1_S2_bit9 (
- .DOA( RdDataA[9] ),
- .DOB( { RdDataB[9], RdDataB[16+9] } ),
-
- .ADDRA( ADR_I[13:0] ),
- .DIA ( WrDataA[9] ),
- .ENA ( WB_AccessClock1 ),
- .CLKA ( Clk ),
- .WEA ( WE_I ),
- .SSRA ( 1'b0 ),
-
- .ADDRB( Addr_i[12:0] ),
- .DIB ( 2'b00 ),
- .ENB ( Rd_i ),
- .CLKB ( Clk ),
- .WEB ( 1'b0 ),
- .SSRB ( 1'b0 )
- );
-
- RAMB16_S1_S2 RAMB16_S1_S2_bit10 (
- .DOA( RdDataA[10] ),
- .DOB( { RdDataB[10], RdDataB[16+10] } ),
-
- .ADDRA( ADR_I[13:0] ),
- .DIA ( WrDataA[10] ),
- .ENA ( WB_AccessClock1 ),
- .CLKA ( Clk ),
- .WEA ( WE_I ),
- .SSRA ( 1'b0 ),
-
- .ADDRB( Addr_i[12:0] ),
- .DIB ( 2'b00 ),
- .ENB ( Rd_i ),
- .CLKB ( Clk ),
- .WEB ( 1'b0 ),
- .SSRB ( 1'b0 )
- );
-
- RAMB16_S1_S2 RAMB16_S1_S2_bit11 (
- .DOA( RdDataA[11] ),
- .DOB( { RdDataB[11], RdDataB[16+11] } ),
-
- .ADDRA( ADR_I[13:0] ),
- .DIA ( WrDataA[11] ),
- .ENA ( WB_AccessClock1 ),
- .CLKA ( Clk ),
- .WEA ( WE_I ),
- .SSRA ( 1'b0 ),
-
- .ADDRB( Addr_i[12:0] ),
- .DIB ( 2'b00 ),
- .ENB ( Rd_i ),
- .CLKB ( Clk ),
- .WEB ( 1'b0 ),
- .SSRB ( 1'b0 )
- );
-
- RAMB16_S1_S2 RAMB16_S1_S2_bit12 (
- .DOA( RdDataA[12] ),
- .DOB( { RdDataB[12], RdDataB[16+12] } ),
-
- .ADDRA( ADR_I[13:0] ),
- .DIA ( WrDataA[12] ),
- .ENA ( WB_AccessClock1 ),
- .CLKA ( Clk ),
- .WEA ( WE_I ),
- .SSRA ( 1'b0 ),
-
- .ADDRB( Addr_i[12:0] ),
- .DIB ( 2'b00 ),
- .ENB ( Rd_i ),
- .CLKB ( Clk ),
- .WEB ( 1'b0 ),
- .SSRB ( 1'b0 )
- );
-
- RAMB16_S1_S2 RAMB16_S1_S2_bit13 (
- .DOA( RdDataA[13] ),
- .DOB( { RdDataB[13], RdDataB[16+13] } ),
-
- .ADDRA( ADR_I[13:0] ),
- .DIA ( WrDataA[13] ),
- .ENA ( WB_AccessClock1 ),
- .CLKA ( Clk ),
- .WEA ( WE_I ),
- .SSRA ( 1'b0 ),
-
- .ADDRB( Addr_i[12:0] ),
- .DIB ( 2'b00 ),
- .ENB ( Rd_i ),
- .CLKB ( Clk ),
- .WEB ( 1'b0 ),
- .SSRB ( 1'b0 )
- );
-
- RAMB16_S1_S2 RAMB16_S1_S2_bit14 (
- .DOA( RdDataA[14] ),
- .DOB( { RdDataB[14], RdDataB[16+14] } ),
-
- .ADDRA( ADR_I[13:0] ),
- .DIA ( WrDataA[14] ),
- .ENA ( WB_AccessClock1 ),
- .CLKA ( Clk ),
- .WEA ( WE_I ),
- .SSRA ( 1'b0 ),
-
- .ADDRB( Addr_i[12:0] ),
- .DIB ( 2'b00 ),
- .ENB ( Rd_i ),
- .CLKB ( Clk ),
- .WEB ( 1'b0 ),
- .SSRB ( 1'b0 )
- );
-
- RAMB16_S1_S2 RAMB16_S1_S2_bit15 (
- .DOA( RdDataA[15] ),
- .DOB( { RdDataB[15], RdDataB[16+15] } ),
-
- .ADDRA( ADR_I[13:0] ),
- .DIA ( WrDataA[15] ),
- .ENA ( WB_AccessClock1 ),
- .CLKA ( Clk ),
- .WEA ( WE_I ),
- .SSRA ( 1'b0 ),
-
- .ADDRB( Addr_i[12:0] ),
- .DIB ( 2'b00 ),
- .ENB ( Rd_i ),
- .CLKB ( Clk ),
- .WEB ( 1'b0 ),
- .SSRB ( 1'b0 )
- );
-
-endmodule
diff --git a/eth/demo/verilog/demo_packet_generator.v b/eth/demo/verilog/demo_packet_generator.v deleted file mode 100644 index 22ad52b4c..000000000 --- a/eth/demo/verilog/demo_packet_generator.v +++ /dev/null @@ -1,274 +0,0 @@ -module demo_packet_generator(
- Reset_n,
- Clk,
-
- //--- Wishbone interface
- STB_I,
- CYC_I,
- ADR_I,
- WE_I,
- DAT_I,
- DAT_O,
- ACK_O,
-
- //--- Packet Descriptor Memory interface
- // RdData_i is always valid exactly one clock after Addr_o changes
- // and Rd_o is asserted
- Rd_o,
- Addr_o,
- RdData_i,
-
- //--- User (packet) interface
- Rx_mac_ra,
- Rx_mac_rd,
- Rx_mac_data,
- Rx_mac_BE,
- Rx_mac_pa,
- Rx_mac_sop,
- Rx_mac_err,
- Rx_mac_eop,
-
- Tx_mac_wa,
- Tx_mac_wr,
- Tx_mac_data,
- Tx_mac_BE,
- Tx_mac_sop,
- Tx_mac_eop
-);
-
- input Reset_n;
- input Clk;
-
- //--- Wishbone interface
- input STB_I;
- input CYC_I;
- input [1:0] ADR_I;
- input WE_I;
- input [15:0] DAT_I;
- output [15:0] DAT_O;
- output ACK_O;
-
- //--- Packet Generator interface
- // RdData_o is always valid exactly one clock after Addr_o changes
- // and Rd_o is asserted
- output Rd_o;
- output [13:0] Addr_o;
- input [31:0] RdData_i;
-
- //--- User (packet) interface
- input Rx_mac_ra;
- output Rx_mac_rd;
- input [31:0] Rx_mac_data;
- input [1:0] Rx_mac_BE;
- input Rx_mac_pa;
- input Rx_mac_sop;
- input Rx_mac_err;
- input Rx_mac_eop;
-
- input Tx_mac_wa;
- output Tx_mac_wr;
- output [31:0] Tx_mac_data;
- output [1:0] Tx_mac_BE;
- output Tx_mac_sop;
- output Tx_mac_eop;
-
- //-------------------------------------------------------------------------
- // Local declarations
- //-------------------------------------------------------------------------
-
- reg ACK_O;
- reg [15:0] DAT_O;
-
- reg Rd_o;
- reg Tx_mac_wr;
- reg [1:0] Tx_mac_BE;
- reg Tx_mac_sop;
- reg Tx_mac_eop;
-
- //--- Wishbone interface --------------------------------------------------
-
- reg [1:0] PG_CFG;
- wire PG_Enable = PG_CFG[0];
-
- always @( negedge Reset_n or posedge Clk )
- if ( ~Reset_n )
- begin
- ACK_O <= 0;
- DAT_O <= 'b0;
-
- PG_CFG <= 2'h0;
- end
- else
- begin
- ACK_O <= 0;
- if ( CYC_I & STB_I )
- begin
- ACK_O <= ~ACK_O; // Generate single cycle pulse!
- if ( WE_I )
- begin
- PG_CFG <= DAT_I;
- end
- else
- begin
- DAT_O[1:0] <= PG_CFG;
- end
- end
- end
-
- //--- Packet Generator FSM ------------------------------------------------
-
- parameter PG_FSM_STATE_IDLE = 3'h0;
- parameter PG_FSM_STATE_LD_DESC_1 = 3'h1;
- parameter PG_FSM_STATE_LD_DESC_2 = 3'h2;
- parameter PG_FSM_STATE_RD_HEADER = 3'h3;
- parameter PG_FSM_STATE_PAYLOAD_SEQ_NUMBER = 3'h4;
- parameter PG_FSM_STATE_PAYLOAD = 3'h5;
- parameter PG_FSM_STATE_DONE = 3'h6;
- reg [2:0] PG_FSM_State;
-
- reg [9:0] DescHigh; // Selects currente descriptor
- reg [3:0] DescLow; // Index into a single descriptor (16 entries)
-
- reg PDM_CFG1_LAST;
- reg [3:0] PDM_CFG1_REPEAT;
- reg [3:0] PDM_CFG1_HDRLEN;
- reg [15:0] PDM_CFG2_PAYLDLEN;
-
- reg [31:0] Tx_mac_data_reg;
- reg WriteHeader;
- reg [15:0] PayloadRemaining;
- reg [31:0] PacketSequenceNumber;
- reg [31:0] Payload;
-
- always @( negedge Reset_n or posedge Clk )
- if ( ~Reset_n )
- begin
- PG_FSM_State <= PG_FSM_STATE_IDLE;
-
- Rd_o <= 0;
-
- DescHigh <= 10'b0;
- DescLow <= 4'b0;
-
- Tx_mac_wr <= 0;
- Tx_mac_sop <= 0;
- Tx_mac_eop <= 0;
- Tx_mac_BE <= 2'b00;
-
- Tx_mac_data_reg <= 32'b0;
- WriteHeader <= 0;
- PayloadRemaining <= 16'd0;
-
- PacketSequenceNumber <= 32'd0;
- Payload <= 32'h0;
-
- { PDM_CFG1_HDRLEN, PDM_CFG1_REPEAT, PDM_CFG1_LAST, PDM_CFG2_PAYLDLEN } <= 'b0;
- end
- else
- begin
- casez ( PG_FSM_State )
- PG_FSM_STATE_IDLE:
- if ( PG_Enable )
- begin
- PG_FSM_State <= PG_FSM_STATE_LD_DESC_1;
- Rd_o <= 1;
- end
- else
- begin
- DescHigh <= 10'b0;
- DescLow <= 4'b0;
- end
-
- PG_FSM_STATE_LD_DESC_1:
- begin
- PG_FSM_State <= PG_FSM_STATE_LD_DESC_2;
-
- DescLow <= DescLow + 1;
- end
-
- PG_FSM_STATE_LD_DESC_2:
- begin
- PG_FSM_State <= PG_FSM_STATE_RD_HEADER;
-
- { PDM_CFG1_LAST, PDM_CFG1_REPEAT, PDM_CFG1_HDRLEN, PDM_CFG2_PAYLDLEN } <=
- { RdData_i[31], RdData_i[23:20], RdData_i[19:16], RdData_i[15:0] };
- end
-
- PG_FSM_STATE_RD_HEADER:
- begin
- Tx_mac_wr <= 0;
- if ( Tx_mac_wa )
- begin
- // Space in Tx FIFO - write next header word
- DescLow <= DescLow + 1;
- Tx_mac_wr <= 1;
- Tx_mac_sop <= ( DescLow == 1 ); // Assert SOP on first header word
- WriteHeader <= 1;
- if ( DescLow == PDM_CFG1_HDRLEN )
- begin
- // The requested number of header words has been read
- // - proceed to generate packet payload
- PG_FSM_State <= PG_FSM_STATE_PAYLOAD_SEQ_NUMBER;
- PayloadRemaining <= PDM_CFG2_PAYLDLEN;
- end
- end
- end
-
- PG_FSM_STATE_PAYLOAD_SEQ_NUMBER:
- begin
- WriteHeader <= 0;
- Tx_mac_data_reg <= PacketSequenceNumber;
- Tx_mac_wr <= 0;
- Tx_mac_sop <= 0;
- if ( Tx_mac_wa )
- begin
- Tx_mac_wr <= 1;
- PG_FSM_State <= PG_FSM_STATE_PAYLOAD;
- Payload <= 32'h01020304;
- PayloadRemaining <= PayloadRemaining - 4;
- end
- end
-
- PG_FSM_STATE_PAYLOAD:
- begin
- Tx_mac_data_reg <= Payload;
- Tx_mac_wr <= 0;
- if ( Tx_mac_wa )
- begin
- Tx_mac_wr <= 1;
- Tx_mac_data_reg <= Payload;
- Payload[31:24] <= Payload[31:24] + 8'h04;
- Payload[23:16] <= Payload[23:16] + 8'h04;
- Payload[15: 8] <= Payload[15: 8] + 8'h04;
- Payload[ 7: 0] <= Payload[ 7: 0] + 8'h04;
- PayloadRemaining <= PayloadRemaining - 4;
- if ( PayloadRemaining <= 4 )
- begin
- PG_FSM_State <= PG_FSM_STATE_DONE;
-
- Tx_mac_eop <= 1;
- // Indicate how many bytes are valid in this last transfer
- Tx_mac_BE <= PayloadRemaining[1:0];
- end
- end
- end
-
- PG_FSM_STATE_DONE:
- begin
- // TBD: Add support for REPEAT, NEXT & LAST!
- Tx_mac_wr <= 0;
- Tx_mac_eop <= 0;
- end
- endcase
- end
-
- //-------------------------------------------------------------------------
-
- assign Tx_mac_data = WriteHeader ?
- RdData_i : Tx_mac_data_reg;
-
- assign Addr_o = { DescHigh, DescLow };
-
- assign Rx_mac_rd = 0;
-
-endmodule
diff --git a/eth/demo/verilog/demo_uart.v b/eth/demo/verilog/demo_uart.v deleted file mode 100644 index ba4a3c35c..000000000 --- a/eth/demo/verilog/demo_uart.v +++ /dev/null @@ -1,235 +0,0 @@ -module demo_uart(
- Reset_n,
- Clk,
-
- // Interface to UART PHY (RS232 level converter)
- RXD_i,
- TXD_o,
-
- // Clk is divided by (Prescaler+1) to generate 16x the bitrate
- Prescaler_i,
-
- // Pulsed when RxData is valid
- RxValid_o,
- RxData_o,
-
- // Asserted when ready for a new Tx byte
- TxReady_o,
-
- // Pulsed when TxData is valid
- TxValid_i,
- TxData_i
-);
-
- input Reset_n;
- input Clk;
-
- // Interface to UART PHY (RS232 level converter)
- input RXD_i;
- output TXD_o;
-
- // Clk is divided by (Prescaler+1) to generate 16x the bitrate
- input [15:0] Prescaler_i;
-
- // Pulsed when RxData is valid
- output RxValid_o;
- output [7:0] RxData_o;
-
- // Asserted when ready for a new Tx byte
- output TxReady_o;
-
- // Pulsed when TxData is valid
- input TxValid_i;
- input [7:0] TxData_i;
-
- //-------------------------------------------------------------------------
- // Local declarations
- //-------------------------------------------------------------------------
-
- reg TXD_o;
- reg RxValid_o;
- reg [7:0] RxData_o;
- reg TxReady_o;
-
- //-------------------------------------------------------------------------
- // Instantiation of sub-modules
- //-------------------------------------------------------------------------
-
- //--- Prescaler generating 16x bitrate clock ------------------------------
-
- reg Clk_16x;
- reg [15:0] Prescaler;
-
- always @( negedge Reset_n or posedge Clk )
- if ( ~Reset_n )
- begin
- Prescaler <= 0;
- Clk_16x <= 0;
- end
- else
- begin
- if ( Prescaler == Prescaler_i )
- begin
- Prescaler <= 0;
- Clk_16x <= 1;
- end
- else
- begin
- Prescaler <= Prescaler + 1;
- Clk_16x <= 0;
- end
- end
-
- //--- Transmitter logic ---------------------------------------------------
-
- reg [3:0] TxCounter;
- reg TxSendBit;
-
- always @( negedge Reset_n or posedge Clk )
- if ( ~Reset_n )
- begin
- TxCounter <= 0;
- TxSendBit <= 0;
- end
- else
- begin
- TxSendBit <= 0;
- if ( Clk_16x )
- begin
- if ( TxCounter == 15 )
- begin
- TxCounter <= 0;
- TxSendBit <= 1;
- end
- else
- TxCounter <= TxCounter + 1;
- end
- end
-
- reg [7:0] TxData_reg;
- reg [3:0] TxBitCnt;
- always @( negedge Reset_n or posedge Clk )
- if ( ~Reset_n )
- begin
- TXD_o <= 1;
- TxReady_o <= 1;
- TxData_reg <= 0;
- TxBitCnt <= 0;
- end
- else
- begin
- if ( TxReady_o )
- begin
- if ( TxValid_i )
- begin
- TxReady_o <= 0;
- TxData_reg <= TxData_i;
- TxBitCnt <= 0;
- end
- end
- else
- begin
- if ( TxSendBit )
- begin
- // Only do anything on bit boundaries
- casez ( TxBitCnt )
- 0: // Tx START bit
- TXD_o <= 0;
- 10: // Tx second STOP bit
- // Now we're done
- TxReady_o <= 1;
- default: // Tx data bit + first stop bit
- begin
- TXD_o <= TxData_reg[0];
- TxData_reg <= { 1'b1, TxData_reg[7:1] };
- end
- endcase
-
- TxBitCnt <= TxBitCnt+1;
- end
- end
- end
-
- //--- Receiver logic ------------------------------------------------------
-
- reg RxHunt;
- reg [3:0] RxCounter;
- reg RxSampleBit;
- reg RxDone;
-
- always @( negedge Reset_n or posedge Clk )
- if ( ~Reset_n )
- begin
- RxCounter <= 0;
- RxSampleBit <= 0;
-
- RxHunt <= 1;
- end
- else
- begin
- RxSampleBit <= 0;
-
- if ( RxDone )
- RxHunt <= 1;
-
- if ( Clk_16x )
- begin
- if ( RxHunt )
- begin
- if ( RXD_i == 0 )
- begin
- // Receiving start bit!
- RxHunt <= 0;
- // Reset 16x bit counter
- RxCounter <= 0;
- end
- end
- else
- begin
- RxCounter <= RxCounter + 1;
- if ( RxCounter == 7 )
- // In middle of Rx bit in next cycle
- RxSampleBit <= 1;
- end
- end
- end
-
- reg [3:0] RxBitCount;
-
- always @( negedge Reset_n or posedge Clk )
- if ( ~Reset_n )
- begin
- RxValid_o <= 0;
- RxData_o <= 'b0;
- RxBitCount <= 0;
- RxDone <= 0;
- end
- else
- begin
- RxValid_o <= 0;
- RxDone <= 0;
-
- if ( RxSampleBit )
- begin
- RxBitCount <= RxBitCount + 1;
-
- casez ( RxBitCount )
- 0: // START bit - just ignore it
- ;
- 9: // STOP bit - indicate we're ready again
- begin
- RxDone <= 1;
- RxBitCount <= 0;
- end
- default: // Rx Data bits
- begin
- RxData_o <= { RXD_i, RxData_o[7:1] };
- if ( RxBitCount == 8 )
- // Last data bit just received
- RxValid_o <= 1;
- end
- endcase
- end
- end
-
-endmodule
diff --git a/eth/demo/verilog/demo_wishbone_master.v b/eth/demo/verilog/demo_wishbone_master.v deleted file mode 100644 index b3c64fbcf..000000000 --- a/eth/demo/verilog/demo_wishbone_master.v +++ /dev/null @@ -1,376 +0,0 @@ -module demo_wishbone_master(
- Reset_n,
- Clk,
-
- //--- UART interface
-
- // Pulsed when RxData_i is valid
- RxValid_i,
- RxData_i,
-
- // Asserted when ready for a new Tx byte
- TxReady_i,
-
- // Pulsed when TxData_o is valid
- TxValid_o,
- TxData_o,
-
- //--- Wishbone interface
- STB_ETH_O,
- STB_PDM_O,
- STB_PG_O,
- CYC_O,
- ADR_O,
- WE_O,
- DAT_O,
- DAT_I,
- ACK_I
-);
-
- input Reset_n;
- input Clk;
-
- //--- UART interface
-
- // Pulsed when RxData_i is valid
- input RxValid_i;
- input [7:0] RxData_i;
-
- // Asserted when ready for a new Tx byte
- input TxReady_i;
-
- // Pulsed when TxData_o is valid
- output TxValid_o;
- output [7:0] TxData_o;
-
- output STB_ETH_O;
- output STB_PDM_O;
- output STB_PG_O;
- output CYC_O;
- output [14:0] ADR_O;
- output WE_O;
- output [15:0] DAT_O;
- input [15:0] DAT_I;
- input ACK_I;
-
- //-------------------------------------------------------------------------
- // Local declarations
- //-------------------------------------------------------------------------
-
- reg TxValid_o;
- reg [7:0] TxData_o;
- reg STB_ETH_O;
- reg STB_PDM_O;
- reg STB_PG_O;
- reg CYC_O;
- reg [14:0] ADR_O;
- reg WE_O;
- reg [15:0] DAT_O;
-
- //-------------------------------------------------------------------------
- // Instantiation of sub-modules
- //-------------------------------------------------------------------------
-
- //--- Transmit FSM --------------------------------------------------------
-
- parameter TX_STATE_IDLE = 0;
- parameter TX_STATE_INIT = 1;
- parameter TX_STATE_OK = 2;
- parameter TX_STATE_ERROR = 3;
- parameter TX_STATE_VALUE = 4;
- parameter TX_STATE_LF = 5;
-
- reg [2:0] TxState;
- reg [3:0] TxIndex;
- reg TxLast;
-
- wire [15:0] TxValue16;
- wire [3:0] TxHexDigit;
- wire [7:0] TxHexChar;
- reg TxOK;
- reg TxERROR;
- reg TxValue;
-
- always @( negedge Reset_n or posedge Clk )
- if ( ~Reset_n )
- begin
- TxState <= TX_STATE_INIT;
- TxIndex <= 0;
- TxLast <= 0;
-
- TxValid_o <= 0;
- TxData_o <= 'b0;
- end
- else
- begin
- TxValid_o <= 0;
-
- // Don't do anything in cycle following TxValid_o being pulsed
- if ( ~TxValid_o )
- begin
- casez ( TxState )
- TX_STATE_INIT:
- casez ( TxIndex )
- 0: TxData_o <= "R";
- 1: TxData_o <= "E";
- 2: TxData_o <= "A";
- 3: TxData_o <= "D";
- 4: TxData_o <= "Y";
- default: TxLast <= 1;
- endcase
-
- TX_STATE_OK:
- casez ( TxIndex )
- 0: TxData_o <= "O";
- 1: TxData_o <= "K";
- default: TxLast <= 1;
- endcase
-
- TX_STATE_ERROR:
- casez ( TxIndex )
- 0: TxData_o <= "E";
- 1: TxData_o <= "R";
- 2: TxData_o <= "R";
- 3: TxData_o <= "O";
- 4: TxData_o <= "R";
- default: TxLast <= 1;
- endcase
-
- TX_STATE_VALUE:
- casez ( TxIndex )
- 0,1,2,3: TxData_o <= TxHexChar;
- default: TxLast <= 1;
- endcase
-
- TX_STATE_LF:
- ;
-
- default:
- begin
- if ( TxOK )
- TxState <= TX_STATE_OK;
- else if ( TxERROR )
- TxState <= TX_STATE_ERROR;
- else if ( TxValue )
- begin
- TxState <= TX_STATE_VALUE;
- TxIndex <= 0;
- end
- end
- endcase
-
- if ( (TxState != TX_STATE_IDLE) & TxReady_i )
- begin
- TxValid_o <= 1;
-
- if ( TxLast )
- begin
- if ( TxState == TX_STATE_LF )
- begin
- TxData_o <= 10; // LF
- TxState <= TX_STATE_IDLE;
- TxIndex <= 0;
- TxLast <= 0;
- end
- else
- begin
- TxData_o <= 13; // CR
- TxState <= TX_STATE_LF;
- end
- end
- else
- TxIndex <= TxIndex + 1;
- end
- end
- end
-
- assign TxHexDigit = (TxIndex==0) ? TxValue16[15:12] :
- (TxIndex==1) ? TxValue16[11: 8] :
- (TxIndex==2) ? TxValue16[ 7: 4] :
- TxValue16[ 3: 0];
-
- assign TxHexChar = (TxHexDigit <= 9) ? (TxHexDigit + "0") :
- (TxHexDigit + "A"-'hA);
-
- //--- Receive FSM ---------------------------------------------------------
-
- parameter RX_STATE_IDLE = 0;
- parameter RX_STATE_VALUE16_FIRST = 1;
- parameter RX_STATE_VALUE16 = 2;
- parameter RX_STATE_COMMENT = 3;
- parameter RX_STATE_CMD = 4;
-
- reg [2:0] RxState;
-
- wire IsWhiteSpace = ( RxData_i==" " ) |
- ( RxData_i=="\t" ) |
- ( RxData_i=="," ) |
- ( RxData_i==10 ) |
- ( RxData_i==13 );
- wire IsHexDigit = (( RxData_i >= "0" ) & ( RxData_i <= "9" )) |
- (( RxData_i >= "a" ) & ( RxData_i <= "f" )) |
- (( RxData_i >= "A" ) & ( RxData_i <= "F" ));
- wire [3:0] RxHexValue =
- (( RxData_i >= "0" ) & ( RxData_i <= "9" )) ? RxData_i[3:0] :
- (( RxData_i >= "a" ) & ( RxData_i <= "f" )) ? (RxData_i-"a"+'hA) :
- (( RxData_i >= "A" ) & ( RxData_i <= "F" )) ? (RxData_i-"A"+'hA) : 0;
-
- reg [15:0] RxValue16;
- reg RxWrite;
- reg RxWrData;
-
- reg [15:0] RegAddr;
- reg [15:0] RegRdData;
-
- assign TxValue16 = RegRdData;
-
- always @( negedge Reset_n or posedge Clk )
- if ( ~Reset_n )
- begin
- RxState <= RX_STATE_IDLE;
-
- RxValue16 <= 16'h0;
- RxWrite <= 0;
- RxWrData <= 0;
-
- RegAddr <= 'b0;
- RegRdData <= 'b0;
-
- STB_ETH_O <= 0;
- STB_PDM_O <= 0;
- STB_PG_O <= 0;
- CYC_O <= 0;
- ADR_O <= 0;
- WE_O <= 0;
- DAT_O <= 0;
-
- TxOK <= 0;
- TxERROR <= 0;
- TxValue <= 0;
- end
- else
- begin
- TxOK <= 0;
- TxERROR <= 0;
- TxValue <= 0;
-
- if ( RxState == RX_STATE_CMD )
- begin
- STB_ETH_O <= ( RegAddr[15:12] == 4'h0 );
- STB_PG_O <= ( RegAddr[15:12] == 4'h1 );
- STB_PDM_O <= ( RegAddr[15] == 1'b1 );
-
- CYC_O <= 1;
- ADR_O <= RegAddr[14:0];
- WE_O <= RxWrite;
-
- if ( ACK_I )
- begin
- // Register transaction is completing!
- CYC_O <= 0;
- STB_ETH_O <= 0;
- STB_PDM_O <= 0;
- STB_PG_O <= 0;
-
- // Latch data read in case of a read
- RegRdData <= DAT_I;
-
- if ( RxWrite )
- // Transaction was a register write
- TxOK <= 1;
- else
- TxValue <= 1;
-
- RxState <= RX_STATE_IDLE;
- end
- end
- else if ( (TxState == TX_STATE_IDLE) & RxValid_i )
- begin
- // A byte has been received!
-
- casez ( RxState )
- RX_STATE_IDLE:
- if ( (RxData_i == "w") | (RxData_i == "W") )
- begin
- // Write Register Command: W rrrr dddd
- RxState <= RX_STATE_VALUE16_FIRST;
- RxWrite <= 1;
- RxWrData <= 0;
- end
- else if ( (RxData_i == "r") | (RxData_i == "R") )
- begin
- // Read Register Command: R rrrr
- RxState <= RX_STATE_VALUE16_FIRST;
- RxWrite <= 0;
- end
- else if ( RxData_i == "/" )
- begin
- // Comment!
- RxState <= RX_STATE_COMMENT;
- end
- else if ( ~IsWhiteSpace )
- // Unknown command!
- TxERROR <= 1;
-
- RX_STATE_COMMENT:
- if ( (RxData_i == 13) | (RxData_i == 10) )
- // CR or LF - end of comment
- RxState <= RX_STATE_IDLE;
-
- RX_STATE_VALUE16_FIRST:
- if ( IsHexDigit )
- begin
- RxValue16 <= { 12'b0, RxHexValue };
- RxState <= RX_STATE_VALUE16;
- end
- else if ( ~IsWhiteSpace )
- begin
- // Unexpected character!
- TxERROR <= 1;
- RxState <= RX_STATE_IDLE;
- end
-
- RX_STATE_VALUE16:
- if ( IsHexDigit )
- RxValue16 <= { RxValue16[11:0], RxHexValue };
- else if ( IsWhiteSpace )
- begin
- // Done collecting 16-bit value
- if ( RxWrite )
- begin
- // This is a register write
- if ( RxWrData )
- begin
- // Second time around - just received write data
- DAT_O <= RxValue16;
- RxState <= RX_STATE_CMD;
- end
- else
- begin
- // Just received register address - expecting second argument
- RegAddr <= RxValue16;
- RxState <= RX_STATE_VALUE16_FIRST;
- RxWrData <= 1; // Now receive the write data
- end
- end
- else
- begin
- // This is a register read
- RegAddr <= RxValue16;
- RxState <= RX_STATE_CMD;
- end
- end
- else
- begin
- // Unexpected character!
- TxERROR <= 1;
- RxState <= RX_STATE_IDLE;
- end
-
- default:
- TxERROR <= 1;
- endcase
- end
- end
-
-endmodule
diff --git a/eth/demo/verilog/tb_demo.v b/eth/demo/verilog/tb_demo.v deleted file mode 100644 index c5a8a3f41..000000000 --- a/eth/demo/verilog/tb_demo.v +++ /dev/null @@ -1,348 +0,0 @@ -`timescale 1ns / 1ns
-
-module tb_demo;
-
- //-------------------- Instantiate Xilinx glbl module ----------------------
- // - this is needed to get ModelSim to work because e.g. I/O buffer models
- // refer directly to glbl.GTS and similar signals
-
- wire GSR;
- wire GTS;
- xlnx_glbl glbl( .GSR( GSR ), .GTS( GTS ) );
-
- reg VLOG_ExitSignal = 0;
- reg Done = 0;
- reg Error = 0;
-
- //-------------------------------------------------------------------------
-
- reg Reset_n;
- reg Clk_100M;
- reg Clk_125M;
-
- wire RS232_TXD;
- wire RS232_RXD;
-
- wire USB_TXD;
- wire USB_RXD;
-
- //--- 10/100/1000BASE-T Ethernet PHY (MII/GMII)
- wire PHY_RESET_n;
-
- wire PHY_RXC;
- wire [7:0] PHY_RXD;
- wire PHY_RXDV;
- wire PHY_RXER;
-
- wire PHY_GTX_CLK; // GMII only
- wire PHY_TXC;
- wire [7:0] PHY_TXD;
- wire PHY_TXEN;
- wire PHY_TXER;
-
- wire PHY_COL = 0;
- wire PHY_CRS = 0;
-
- wire PHY_MDC;
- wire PHY_MDIO;
-
- wire [1:4] LED;
-
- reg [1:4] Button = 4'b0000;
-
- //-------------------------------------------------------------------------
- // Local declarations
- //-------------------------------------------------------------------------
-
- //-------------------------------------------------------------------------
- // Instantiation of sub-modules
- //-------------------------------------------------------------------------
-
- //--- DUT
-
- demo demo(
- .Reset_n ( Reset_n ),
- .Clk_100M( Clk_100M ),
- .Clk_125M( Clk_125M ),
-
- .RS232_TXD( RS232_TXD ),
- .RS232_RXD( RS232_RXD ),
-
- .USB_TXD( USB_TXD ),
- .USB_RXD( USB_RXD ),
-
- //--- 10/100/1000BASE-T Ethernet PHY (MII/GMII)
- .PHY_RESET_n( PHY_RESET_n ),
-
- .PHY_RXC ( PHY_RXC ),
- .PHY_RXD ( PHY_RXD ),
- .PHY_RXDV( PHY_RXDV ),
- .PHY_RXER( PHY_RXER ),
-
- .PHY_GTX_CLK( PHY_GTX_CLK ), // GMII only
- .PHY_TXC ( PHY_TXC ),
- .PHY_TXD ( PHY_TXD ),
- .PHY_TXEN ( PHY_TXEN ),
- .PHY_TXER ( PHY_TXER ),
-
- .PHY_COL( PHY_COL ),
- .PHY_CRS( PHY_CRS ),
-
- .PHY_MDC ( PHY_MDC ),
- .PHY_MDIO( PHY_MDIO ),
-
- // Misc. I/Os
- .LED ( LED ),
- .Button( Button )
- );
-
- //-------------------------------------------------------------------------
- // MII/GMII Ethernet PHY model
-
- reg [2:0] Speed = 3'b000;
-
- Phy_sim U_Phy_sim(
- .Gtx_clk( PHY_GTX_CLK ),
- .Rx_clk ( PHY_RXC ),
- .Tx_clk ( PHY_TXC ),
- .Tx_er ( PHY_TXER ),
- .Tx_en ( PHY_TXEN ),
- .Txd ( PHY_TXD ),
- .Rx_er ( PHY_RXER ),
- .Rx_dv ( PHY_RXDV ),
- .Rxd ( PHY_RXD ),
- .Crs ( PHY_CRS ),
- .Col ( PHY_COL ),
- .Speed ( Speed ),
- .Done ( Done )
- );
-
- //-------------------------------------------------------------------------
- // Generate all clocks & reset
- //-------------------------------------------------------------------------
-
- // Core master clock (100 MHz)
- initial
- begin
- #10;
- while ( !Done )
- begin
- #5 Clk_100M = 0;
- #5 Clk_100M = 1;
- end
- end
-
- // GMII master clock (125 MHz)
- initial
- begin
- #10;
- while ( !Done )
- begin
- #4 Clk_125M = 0;
- #4 Clk_125M = 1;
- end
- end
-
- initial
- begin
- Reset_n = 0;
-
- #103;
- Reset_n = 1;
- end
-
- //--- Emulate UART Transmitter --------------------------------------------
-
- parameter PRESCALER_16X = 3;
- integer Prescaler;
- integer TxLen = 0;
- reg [2:0] TxState;
- integer TxBit;
- reg [1023:0] TxMsg;
- reg TXD;
- reg TxDone;
-
- always @( negedge Reset_n or posedge Clk_100M )
- if ( ~Reset_n )
- begin
- Prescaler <= 0;
- TxState = 0;
- TXD = 1;
- TxBit = 0;
- TxDone <= 0;
- end
- else
- begin
- TxDone <= 0;
-
- if ( Prescaler == ((PRESCALER_16X + 1)*16 -1) )
- Prescaler <= 0;
- else
- Prescaler <= Prescaler + 1;
-
- if ( Prescaler==0 )
- begin
- casez ( TxState )
- 0: // IDLE
- begin
- if ( TxLen != 0 )
- begin // Send start bit!
- TxBit = (TxLen-1)*8;
- TxLen = TxLen - 1;
- TXD = 0;
- TxState = 1;
- end
- end
-
- 1: // Send next data bit
- begin
- // Send next data bit
- TXD = TxMsg[ TxBit ];
- TxBit = TxBit + 1;
- if ( (TxBit % 8)==0 )
- // Next send two stop bits
- TxState = 2;
- end
-
- 2: // First of two stop bits
- begin
- TXD = 1;
- TxState = 3;
- end
-
- 3: // Second of two stop bits
- begin
- TXD = 1;
- TxState = 0;
- if ( TxLen == 0 )
- // Done with transmission!
- TxDone <= 1;
- end
- endcase
- end
- end
-
- assign RS232_RXD = TXD;
- assign USB_RXD = 1;
-
- //--- Send commands to the DUT --------------------------------------------
-
- initial
- begin
- #10;
- while ( ~Reset_n ) #10;
-
- // Wait a couple of clock edges before continuing to allow
- // internal logic to get out of reset
- repeat ( 5 )
- @( posedge Clk_100M );
-
- // Wait for the "READY" message to complete transmission
- #60000;
-
- // Select 100 Mbps
- Speed = 3'b010;
- TxMsg = "W 0022 0002 ";
- TxLen = 12;
- while ( ~TxDone )
- @( posedge Clk_100M );
-
- #50000;
-
- TxMsg = "W 8000 8003 ";
- TxLen = 12;
- while ( ~TxDone )
- @( posedge Clk_100M );
-
- #50000;
-
- TxMsg = "W 8001 0011 ";
- TxLen = 12;
- while ( ~TxDone )
- @( posedge Clk_100M );
-
- #50000;
-
- TxMsg = "W 8002 1234 ";
- TxLen = 12;
- while ( ~TxDone )
- @( posedge Clk_100M );
-
- #50000;
-
- TxMsg = "W 8003 5678 ";
- TxLen = 12;
- while ( ~TxDone )
- @( posedge Clk_100M );
-
- #50000;
-
- TxMsg = "W 8004 9ABC ";
- TxLen = 12;
- while ( ~TxDone )
- @( posedge Clk_100M );
-
- #50000;
-
- TxMsg = "W 8005 DEF0 ";
- TxLen = 12;
- while ( ~TxDone )
- @( posedge Clk_100M );
-
- #50000;
-
- TxMsg = "W 8006 C5C0 ";
- TxLen = 12;
- while ( ~TxDone )
- @( posedge Clk_100M );
-
- #50000;
-
- TxMsg = "W 8007 BABE ";
- TxLen = 12;
- while ( ~TxDone )
- @( posedge Clk_100M );
-
- #50000;
-
- TxMsg = "R 8006 ";
- TxLen = 7;
- while ( ~TxDone )
- @( posedge Clk_100M );
-
- #50000;
-
- // Enable PG!
- TxMsg = "W 1000 0001 ";
- TxLen = 12;
- while ( ~TxDone )
- @( posedge Clk_100M );
-
- #50000;
-
- // Read back that PG has been enabled!
- TxMsg = "R 1000 ";
- TxLen = 7;
- while ( ~TxDone )
- @( posedge Clk_100M );
-
- #50000;
-
- #50000;
-
- Done = 1; #10;
-
- $stop;
- end
-
- //--- Directly accesses a register on the internal Wishbone bus, bypassing the UART interface
-
- task WrReg;
- input [15:0] Reg;
- input [15:0] Data;
-
- begin
- end
- endtask
-
-endmodule
diff --git a/eth/header_ram.v b/eth/header_ram.v deleted file mode 100644 index 699f16a4f..000000000 --- a/eth/header_ram.v +++ /dev/null @@ -1,24 +0,0 @@ - -module header_ram - #(parameter REGNUM=0, - parameter WIDTH=32) - (input clk, - input set_stb, - input [7:0] set_addr, - input [31:0] set_data, - - input [3:0] addr, - output [31:0] q - ); - - reg [WIDTH-1:0] mini_ram[0:15]; - wire write_to_ram = (set_stb & (set_addr[7:4]==REGNUM[7:4])); - wire [3:0] ram_addr = write_to_ram ? set_addr[3:0] : addr; - - always @(posedge clk) - if(write_to_ram) - mini_ram[ram_addr] <= set_data; - - assign q = mini_ram[ram_addr]; - -endmodule // header_ram diff --git a/eth/mac_rxfifo_int.v b/eth/mac_rxfifo_int.v deleted file mode 100644 index 6f6c5ed38..000000000 --- a/eth/mac_rxfifo_int.v +++ /dev/null @@ -1,91 +0,0 @@ - -module mac_rxfifo_int - (input clk, input rst, - - input Rx_mac_empty, - output Rx_mac_rd, - input [31:0] Rx_mac_data, - input [1:0] Rx_mac_BE, - input Rx_mac_sop, - input Rx_mac_eop, - input Rx_mac_err, - - output [31:0] wr_dat_o, - output wr_write_o, - output wr_done_o, - output wr_error_o, - input wr_ready_i, - input wr_full_i, - - // FIFO Status - output [15:0] fifo_occupied, - output fifo_full, - output fifo_empty - ); - - // Write side of short FIFO - // Inputs: full, Rx_mac_empty, Rx_mac_sop, Rx_mac_eop, Rx_mac_err, Rx_mac_data/BE - // Controls: write, datain, Rx_mac_rd - - wire write, full, read, empty, sop_o, eop_o, error_o; - - // Write side of short FIFO - assign write = ~full & ~Rx_mac_empty; - assign Rx_mac_rd = write; - -`define LONGFIFO 0 - -`ifdef LONGFIFO - cascadefifo2 #(.WIDTH(35),.SIZE(10)) mac_rx_longfifo - (.clk(clk),.rst(rst),.clear(0), - .datain({Rx_mac_sop,Rx_mac_eop,Rx_mac_err,Rx_mac_data}),.write(write),.full(full), - .dataout({sop_o,eop_o,error_o,wr_dat_o}),.read(read),.empty(empty), - .space(), .occupied(fifo_occupied) ); -`else - shortfifo #(.WIDTH(35)) mac_rx_sfifo - (.clk(clk),.rst(rst),.clear(0), - .datain({Rx_mac_sop,Rx_mac_eop,Rx_mac_err,Rx_mac_data}),.write(write),.full(full), - .dataout({sop_o,eop_o,error_o,wr_dat_o}),.read(read),.empty(empty), - .space(), .occupied(fifo_occupied[4:0]) ); - assign fifo_occupied[15:5] = 0; -`endif - - assign fifo_full = full; - assign fifo_empty = empty; - - // Read side of short FIFO - // Inputs: empty, dataout, wr_ready_i, wr_full_i - // Controls: read, wr_dat_o, wr_write_o, wr_done_o, wr_error_o - - reg [1:0] rd_state; - localparam RD_IDLE = 0; - localparam RD_HAVEPKT = 1; - localparam RD_XFER = 2; - localparam RD_ERROR = 3; - - always @(posedge clk) - if(rst) - rd_state <= RD_IDLE; - else - case(rd_state) - RD_IDLE : - if(sop_o & ~empty) - rd_state <= RD_HAVEPKT; - RD_HAVEPKT : - if(wr_ready_i) - rd_state <= RD_XFER; - RD_XFER : - if(eop_o & ~empty) - rd_state <= RD_IDLE; - else if(wr_full_i) - rd_state <= RD_HAVEPKT; - RD_ERROR : - rd_state <= RD_IDLE; - endcase // case(rd_state) - - assign read = ~empty & ((rd_state == RD_XFER) | ((rd_state==RD_IDLE)&~sop_o)); - assign wr_write_o = ~empty & (rd_state == RD_XFER); - assign wr_done_o = ~empty & (rd_state == RD_XFER) & eop_o; - assign wr_error_o = ~empty & (rd_state == RD_XFER) & error_o; - -endmodule // mac_rxfifo_int diff --git a/eth/mac_txfifo_int.v b/eth/mac_txfifo_int.v deleted file mode 100644 index 38d8d38fc..000000000 --- a/eth/mac_txfifo_int.v +++ /dev/null @@ -1,77 +0,0 @@ - -module mac_txfifo_int - (input clk, input rst, input mac_clk, - - // To MAC - input Tx_mac_wa, - output Tx_mac_wr, - output [31:0] Tx_mac_data, - output [1:0] Tx_mac_BE, - output Tx_mac_sop, - output Tx_mac_eop, - - // To buffer interface - input [31:0] rd_dat_i, - output rd_read_o, - output rd_done_o, - output rd_error_o, - input rd_sop_i, - input rd_eop_i, - - // FIFO Status - output [15:0] fifo_occupied, - output fifo_full, - output fifo_empty ); - - wire empty, full, sfifo_write, sfifo_read; - wire [33:0] sfifo_in, sfifo_out; - - /* - shortfifo #(.WIDTH(34)) txmac_sfifo - (.clk(clk),.rst(rst),.clear(0), - .datain(sfifo_in),.write(sfifo_write),.full(full), - .dataout(sfifo_out),.read(sfifo_read),.empty(empty)); - */ - fifo_xlnx_512x36_2clk mac_tx_fifo_2clk - (.rst(rst), - .wr_clk(clk),.din({2'b0,sfifo_in}),.full(full),.wr_en(sfifo_write),.wr_data_count(fifo_occupied[8:0]), - .rd_clk(mac_clk),.dout(sfifo_out),.empty(empty),.rd_en(sfifo_read),.rd_data_count() ); - assign fifo_occupied[15:9] = 0; - assign fifo_full = full; - assign fifo_empty = empty; // Note empty is in wrong clock domain - - // MAC side signals - // We are allowed to do one more write after we are told the FIFO is full - // This allows us to register the _wa signal and speed up timing. - - reg tx_mac_wa_d1; - always @(posedge clk) - tx_mac_wa_d1 <= Tx_mac_wa; - - assign sfifo_read = ~empty & tx_mac_wa_d1; - - assign Tx_mac_wr = sfifo_read; - assign Tx_mac_data = sfifo_out[31:0]; - assign Tx_mac_BE = 0; // Since we only deal with packets that are multiples of 32 bits long - assign Tx_mac_sop = sfifo_out[33]; - assign Tx_mac_eop = sfifo_out[32]; - - - // BUFFER side signals - reg xfer_active; - always @(posedge clk) - if(rst) - xfer_active <= 0; - else if(rd_eop_i & ~full) - xfer_active <= 0; - else if(rd_sop_i) - xfer_active <= 1; - - assign sfifo_in = {rd_sop_i, rd_eop_i, rd_dat_i}; - assign sfifo_write = xfer_active & ~full; - - assign rd_read_o = sfifo_write; - assign rd_done_o = 0; // Always send everything we're given? - assign rd_error_o = 0; // No possible error situations? - -endmodule // mac_txfifo_int diff --git a/eth/rtl/verilog/Clk_ctrl.v b/eth/rtl/verilog/Clk_ctrl.v deleted file mode 100644 index 917082644..000000000 --- a/eth/rtl/verilog/Clk_ctrl.v +++ /dev/null @@ -1,133 +0,0 @@ -//////////////////////////////////////////////////////////////////////
-//// ////
-//// Clk_ctrl.v ////
-//// ////
-//// This file is part of the Ethernet IP core project ////
-//// http://www.opencores.org/projects.cgi/web/ethernet_tri_mode/////
-//// ////
-//// Author(s): ////
-//// - Jon Gao (gaojon@yahoo.com) ////
-//// ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// Copyright (C) 2001 Authors ////
-//// ////
-//// This source file may be used and distributed without ////
-//// restriction provided that this copyright statement is not ////
-//// removed from the file and that any derivative work contains ////
-//// the original copyright notice and the associated disclaimer. ////
-//// ////
-//// This source file is free software; you can redistribute it ////
-//// and/or modify it under the terms of the GNU Lesser General ////
-//// Public License as published by the Free Software Foundation; ////
-//// either version 2.1 of the License, or (at your option) any ////
-//// later version. ////
-//// ////
-//// This source is distributed in the hope that it will be ////
-//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
-//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-//// PURPOSE. See the GNU Lesser General Public License for more ////
-//// details. ////
-//// ////
-//// You should have received a copy of the GNU Lesser General ////
-//// Public License along with this source; if not, download it ////
-//// from http://www.opencores.org/lgpl.shtml ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//
-// CVS Revision History
-//
-// $Log: Clk_ctrl.v,v $
-// Revision 1.3 2006/01/19 14:07:52 maverickist
-// verification is complete.
-//
-// Revision 1.2 2005/12/16 06:44:13 Administrator
-// replaced tab with space.
-// passed 9.6k length frame test.
-//
-// Revision 1.1.1.1 2005/12/13 01:51:44 Administrator
-// no message
-//
-
-module Clk_ctrl(
-Reset ,
-Clk_125M ,
-//host interface,
-Speed ,
-//Phy interface ,
-Gtx_clk ,
-Rx_clk ,
-Tx_clk ,
-//interface clk ,
-MAC_tx_clk ,
-MAC_rx_clk ,
-MAC_tx_clk_div ,
-MAC_rx_clk_div
-);
-input Reset ;
-input Clk_125M ;
- //host interface
-input [2:0] Speed ;
- //Phy interface
-output Gtx_clk ;//used only in GMII mode
-input Rx_clk ;
-input Tx_clk ;//used only in MII mode
- //interface clk signals
-output MAC_tx_clk ;
-output MAC_rx_clk ;
-output MAC_tx_clk_div ;
-output MAC_rx_clk_div ;
-
-
-// ******************************************************************************
-// internal signals
-// ******************************************************************************
-wire Rx_clk_div2 ;
-wire Tx_clk_div2 ;
-// ******************************************************************************
-//
-// ******************************************************************************
- assign Gtx_clk = Clk_125M ;
- assign MAC_rx_clk = Rx_clk ;
- assign MAC_rx_clk_div = Rx_clk ;
- assign MAC_tx_clk = Clk_125M;
- assign MAC_tx_clk_div = Clk_125M;
-
-
- /*
-eth_clk_div2 U_0_CLK_DIV2(
-.Reset (Reset ),
-.IN (Rx_clk ),
-.OUT (Rx_clk_div2 )
-);
-
-eth_clk_div2 U_1_CLK_DIV2(
-.Reset (Reset ),
-.IN (Tx_clk ),
-.OUT (Tx_clk_div2 )
-);
-
-eth_clk_switch U_0_CLK_SWITCH(
-.IN_0 (Rx_clk_div2 ),
-.IN_1 (Rx_clk ),
-.SW (Speed[2] ),
-.OUT (MAC_rx_clk_div )
-);
-
-eth_clk_switch U_1_CLK_SWITCH(
-.IN_0 (Tx_clk ),
-.IN_1 (Clk_125M ),
-.SW (Speed[2] ),
-.OUT (MAC_tx_clk )
-);
-
-eth_clk_switch U_2_CLK_SWITCH(
-.IN_0 (Tx_clk_div2 ),
-.IN_1 (Clk_125M ),
-.SW (Speed[2] ),
-.OUT (MAC_tx_clk_div )
-);
-
- */
-endmodule
diff --git a/eth/rtl/verilog/MAC_rx.v b/eth/rtl/verilog/MAC_rx.v deleted file mode 100644 index 0e02e8fcc..000000000 --- a/eth/rtl/verilog/MAC_rx.v +++ /dev/null @@ -1,242 +0,0 @@ -//////////////////////////////////////////////////////////////////////
-//// ////
-//// MAC_rx.v ////
-//// ////
-//// This file is part of the Ethernet IP core project ////
-//// http://www.opencores.org/projects.cgi/web/ethernet_tri_mode/////
-//// ////
-//// Author(s): ////
-//// - Jon Gao (gaojon@yahoo.com) ////
-//// ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// Copyright (C) 2001 Authors ////
-//// ////
-//// This source file may be used and distributed without ////
-//// restriction provided that this copyright statement is not ////
-//// removed from the file and that any derivative work contains ////
-//// the original copyright notice and the associated disclaimer. ////
-//// ////
-//// This source file is free software; you can redistribute it ////
-//// and/or modify it under the terms of the GNU Lesser General ////
-//// Public License as published by the Free Software Foundation; ////
-//// either version 2.1 of the License, or (at your option) any ////
-//// later version. ////
-//// ////
-//// This source is distributed in the hope that it will be ////
-//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
-//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-//// PURPOSE. See the GNU Lesser General Public License for more ////
-//// details. ////
-//// ////
-//// You should have received a copy of the GNU Lesser General ////
-//// Public License along with this source; if not, download it ////
-//// from http://www.opencores.org/lgpl.shtml ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//
-// CVS Revision History
-//
-// $Log: MAC_rx.v,v $
-// Revision 1.4 2006/11/17 17:53:07 maverickist
-// no message
-//
-// Revision 1.3 2006/01/19 14:07:52 maverickist
-// verification is complete.
-//
-// Revision 1.2 2005/12/16 06:44:13 Administrator
-// replaced tab with space.
-// passed 9.6k length frame test.
-//
-// Revision 1.1.1.1 2005/12/13 01:51:44 Administrator
-// no message
-//
-
-module MAC_rx
- #(parameter RX_FF_DEPTH = 9)
- (
-input Reset ,
-input Clk_user,
-input Clk ,
- //RMII interface
-input MCrs_dv ,
-input [7:0] MRxD ,
-input MRxErr ,
- //flow_control signals
-output [15:0] pause_quanta,
-output pause_quanta_val,
-output [15:0] rx_fifo_space,
- //user interface
-output Rx_mac_empty,
-input Rx_mac_rd ,
-output [31:0] Rx_mac_data ,
-output [1:0] Rx_mac_BE ,
-output Rx_mac_sop ,
-output Rx_mac_eop ,
-output Rx_mac_err ,
- //CPU
-input MAC_rx_add_chk_en ,
-input [7:0] MAC_add_prom_data ,
-input [2:0] MAC_add_prom_add ,
-input MAC_add_prom_wr ,
-input broadcast_filter_en ,
-input [15:0] broadcast_bucket_depth ,
-input [15:0] broadcast_bucket_interval ,
-input RX_APPEND_CRC,
-input [4:0] Rx_Hwmark ,
-input [4:0] Rx_Lwmark ,
-input CRC_chk_en ,
-input [5:0] RX_IFG_SET ,
-input [15:0] RX_MAX_LENGTH ,// 1518
-input [6:0] RX_MIN_LENGTH ,// 64
- //RMON interface
-output [15:0] Rx_pkt_length_rmon ,
-output Rx_apply_rmon ,
-output [2:0] Rx_pkt_err_type_rmon ,
-output [2:0] Rx_pkt_type_rmon ,
-
- output [15:0] rx_fifo_occupied,
- output rx_fifo_full,
- output rx_fifo_empty,
- output [31:0] debug
-);
-//******************************************************************************
-//internal signals
-//******************************************************************************
- //CRC_chk interface
-wire CRC_en ;
-wire [7:0] CRC_data;
-wire CRC_init;
-wire CRC_err ;
- //MAC_rx_add_chk interface
-wire MAC_add_en ;
-wire [7:0] MAC_add_data;
-wire MAC_rx_add_chk_err ;
- //broadcast_filter
-wire broadcast_ptr ;
-wire broadcast_drop ;
- //MAC_rx_ctrl interface
-wire [7:0] Fifo_data ;
-wire Fifo_data_en ;
-wire Fifo_full ;
-wire Fifo_data_err ;
-wire Fifo_data_drop ;
-wire Fifo_data_end ;
-
-
-//******************************************************************************
-//instantiation
-//******************************************************************************
-
-
-MAC_rx_ctrl U_MAC_rx_ctrl(
-.Reset (Reset ),
-.Clk (Clk ),
- //RMII interface ( //RMII interface ),
-.MCrs_dv (MCrs_dv ),
-.MRxD (MRxD ),
-.MRxErr (MRxErr ),
- //CRC_chk interface (//CRC_chk interface ),
-.CRC_en (CRC_en ),
-.CRC_data (CRC_data ),
-.CRC_init (CRC_init ),
-.CRC_err (CRC_err ),
- //MAC_rx_add_chk interface (//MAC_rx_add_chk interface),
-.MAC_add_en (MAC_add_en ),
-.MAC_add_data (MAC_add_data ),
-.MAC_rx_add_chk_err (MAC_rx_add_chk_err ),
- //broadcast_filter (//broadcast_filter ),
-.broadcast_ptr (broadcast_ptr ),
-.broadcast_drop (broadcast_drop ),
- //flow_control signals (//flow_control signals ),
-.pause_quanta (pause_quanta ),
-.pause_quanta_val (pause_quanta_val ),
- //MAC_rx_FF interface (//MAC_rx_FF interface ),
-.Fifo_data (Fifo_data ),
-.Fifo_data_en (Fifo_data_en ),
-.Fifo_data_err (Fifo_data_err ),
-.Fifo_data_drop (Fifo_data_drop ),
-.Fifo_data_end (Fifo_data_end ),
-.Fifo_full (Fifo_full ),
- //RMON interface (//RMON interface ),
-.Rx_pkt_type_rmon (Rx_pkt_type_rmon ),
-.Rx_pkt_length_rmon (Rx_pkt_length_rmon ),
-.Rx_apply_rmon (Rx_apply_rmon ),
-.Rx_pkt_err_type_rmon (Rx_pkt_err_type_rmon ),
- //CPU (//CPU ),
-.RX_IFG_SET (RX_IFG_SET ),
-.RX_MAX_LENGTH (RX_MAX_LENGTH ),
-.RX_MIN_LENGTH (RX_MIN_LENGTH )
-);
-
- assign debug = {28'd0, Fifo_data_en, Fifo_data_err, Fifo_data_end,Fifo_full};
-
-MAC_rx_FF #(.RX_FF_DEPTH(RX_FF_DEPTH)) U_MAC_rx_FF (
-.Reset (Reset ),
-.Clk_MAC (Clk ),
-.Clk_SYS (Clk_user ),
- //MAC_rx_ctrl interface (//MAC_rx_ctrl interface ),
-.Fifo_data (Fifo_data ),
-.Fifo_data_en (Fifo_data_en ),
-.Fifo_full (Fifo_full ),
-.Fifo_data_err (Fifo_data_err ),
-//.Fifo_data_drop (Fifo_data_drop ),
-.Fifo_data_end (Fifo_data_end ),
-.Fifo_space (rx_fifo_space ),
- //CPU (//CPU ),
-.Rx_Hwmark (Rx_Hwmark ),
-.Rx_Lwmark (Rx_Lwmark ),
-.RX_APPEND_CRC (RX_APPEND_CRC ),
- //user interface (//user interface ),
-.Rx_mac_empty (Rx_mac_empty ),
-.Rx_mac_rd (Rx_mac_rd ),
-.Rx_mac_data (Rx_mac_data ),
-.Rx_mac_BE (Rx_mac_BE ),
-.Rx_mac_sop (Rx_mac_sop ),
-.Rx_mac_eop (Rx_mac_eop ),
-.Rx_mac_err (Rx_mac_err ),
-
-.fifo_occupied(rx_fifo_occupied),
-.fifo_full_dbg(rx_fifo_full),
-.fifo_empty(rx_fifo_empty)
-);
-
- Broadcast_filter U_Broadcast_filter
- (.Reset (Reset ),
- .Clk (Clk ),
- //MAC_rx_ctrl (//MAC_rx_ctrl ),
- .broadcast_ptr (broadcast_ptr ),
- .broadcast_drop (broadcast_drop ),
- //FromCPU (//FromCPU ),
- .broadcast_filter_en (broadcast_filter_en ),
- .broadcast_bucket_depth (broadcast_bucket_depth ),
- .broadcast_bucket_interval (broadcast_bucket_interval )
- );
-
-CRC_chk U_CRC_chk(
-.Reset (Reset ),
-.Clk (Clk ),
-.CRC_data (CRC_data ),
-.CRC_init (CRC_init ),
-.CRC_en (CRC_en ),
- //From CPU (//From CPU ),
-.CRC_chk_en (CRC_chk_en ),
-.CRC_err (CRC_err )
-);
-
- MAC_rx_add_chk U_MAC_rx_add_chk
- (.Reset (Reset ),
- .Clk (Clk ),
- .Init (CRC_init ),
- .data (MAC_add_data ),
- .MAC_add_en (MAC_add_en ),
- .MAC_rx_add_chk_err (MAC_rx_add_chk_err ),
- //From CPU (//From CPU ),
- .MAC_rx_add_chk_en (MAC_rx_add_chk_en ),
- .MAC_add_prom_data (MAC_add_prom_data ),
- .MAC_add_prom_add (MAC_add_prom_add ),
- .MAC_add_prom_wr (MAC_add_prom_wr )
- );
-
-endmodule // MAC_rx
diff --git a/eth/rtl/verilog/MAC_rx/Broadcast_filter.v b/eth/rtl/verilog/MAC_rx/Broadcast_filter.v deleted file mode 100644 index bc95e31d7..000000000 --- a/eth/rtl/verilog/MAC_rx/Broadcast_filter.v +++ /dev/null @@ -1,107 +0,0 @@ -//////////////////////////////////////////////////////////////////////
-//// ////
-//// Broadcast_filter.v ////
-//// ////
-//// This file is part of the Ethernet IP core project ////
-//// http://www.opencores.org/projects.cgi/web/ethernet_tri_mode/////
-//// ////
-//// Author(s): ////
-//// - Jon Gao (gaojon@yahoo.com) ////
-//// ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// Copyright (C) 2001 Authors ////
-//// ////
-//// This source file may be used and distributed without ////
-//// restriction provided that this copyright statement is not ////
-//// removed from the file and that any derivative work contains ////
-//// the original copyright notice and the associated disclaimer. ////
-//// ////
-//// This source file is free software; you can redistribute it ////
-//// and/or modify it under the terms of the GNU Lesser General ////
-//// Public License as published by the Free Software Foundation; ////
-//// either version 2.1 of the License, or (at your option) any ////
-//// later version. ////
-//// ////
-//// This source is distributed in the hope that it will be ////
-//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
-//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-//// PURPOSE. See the GNU Lesser General Public License for more ////
-//// details. ////
-//// ////
-//// You should have received a copy of the GNU Lesser General ////
-//// Public License along with this source; if not, download it ////
-//// from http://www.opencores.org/lgpl.shtml ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//
-// CVS Revision History
-//
-// $Log: Broadcast_filter.v,v $
-// Revision 1.3 2006/01/19 14:07:54 maverickist
-// verification is complete.
-//
-// Revision 1.2 2005/12/16 06:44:16 Administrator
-// replaced tab with space.
-// passed 9.6k length frame test.
-//
-// Revision 1.1.1.1 2005/12/13 01:51:45 Administrator
-// no message
-//
-
-module Broadcast_filter (
-Reset ,
-Clk ,
-//MAC_rx_ctrl ,
-broadcast_ptr ,
-broadcast_drop ,
-//FromCPU ,
-broadcast_filter_en ,
-broadcast_bucket_depth ,
-broadcast_bucket_interval
-);
-input Reset ;
-input Clk ;
- //MAC_rx_ctrl
-input broadcast_ptr ;
-output broadcast_drop ;
- //FromCPU ;
-input broadcast_filter_en ;
-input [15:0] broadcast_bucket_depth ;
-input [15:0] broadcast_bucket_interval ;
-
-//******************************************************************************
-//internal signals
-//******************************************************************************
-reg [15:0] time_counter ;
-reg [15:0] broadcast_counter ;
-reg broadcast_drop ;
-//******************************************************************************
-//
-//******************************************************************************
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- time_counter <=0;
- else if (time_counter==broadcast_bucket_interval)
- time_counter <=0;
- else
- time_counter <=time_counter+1;
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- broadcast_counter <=0;
- else if (time_counter==broadcast_bucket_interval)
- broadcast_counter <=0;
- else if (broadcast_ptr&&broadcast_counter!=broadcast_bucket_depth)
- broadcast_counter <=broadcast_counter+1;
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- broadcast_drop <=0;
- else if(broadcast_filter_en&&broadcast_counter==broadcast_bucket_depth)
- broadcast_drop <=1;
- else
- broadcast_drop <=0;
-
-endmodule
\ No newline at end of file diff --git a/eth/rtl/verilog/MAC_rx/CRC_chk.v b/eth/rtl/verilog/MAC_rx/CRC_chk.v deleted file mode 100644 index d6bb22b51..000000000 --- a/eth/rtl/verilog/MAC_rx/CRC_chk.v +++ /dev/null @@ -1,128 +0,0 @@ -//////////////////////////////////////////////////////////////////////
-//// ////
-//// CRC_chk.v ////
-//// ////
-//// This file is part of the Ethernet IP core project ////
-//// http://www.opencores.org/projects.cgi/web/ethernet_tri_mode/////
-//// ////
-//// Author(s): ////
-//// - Jon Gao (gaojon@yahoo.com) ////
-//// ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// Copyright (C) 2001 Authors ////
-//// ////
-//// This source file may be used and distributed without ////
-//// restriction provided that this copyright statement is not ////
-//// removed from the file and that any derivative work contains ////
-//// the original copyright notice and the associated disclaimer. ////
-//// ////
-//// This source file is free software; you can redistribute it ////
-//// and/or modify it under the terms of the GNU Lesser General ////
-//// Public License as published by the Free Software Foundation; ////
-//// either version 2.1 of the License, or (at your option) any ////
-//// later version. ////
-//// ////
-//// This source is distributed in the hope that it will be ////
-//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
-//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-//// PURPOSE. See the GNU Lesser General Public License for more ////
-//// details. ////
-//// ////
-//// You should have received a copy of the GNU Lesser General ////
-//// Public License along with this source; if not, download it ////
-//// from http://www.opencores.org/lgpl.shtml ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//
-// CVS Revision History
-//
-// $Log: CRC_chk.v,v $
-// Revision 1.3 2006/01/19 14:07:54 maverickist
-// verification is complete.
-//
-// Revision 1.2 2005/12/16 06:44:16 Administrator
-// replaced tab with space.
-// passed 9.6k length frame test.
-//
-// Revision 1.1.1.1 2005/12/13 01:51:45 Administrator
-// no message
-//
-
-module CRC_chk(
-Reset ,
-Clk ,
-CRC_data ,
-CRC_init ,
-CRC_en ,
-//From CPU
-CRC_chk_en ,
-CRC_err
-);
-input Reset ;
-input Clk ;
-input[7:0] CRC_data ;
-input CRC_init ;
-input CRC_en ;
- //From CPU
-input CRC_chk_en ;
-output CRC_err ;
-//******************************************************************************
-//internal signals
-//******************************************************************************
-reg [31:0] CRC_reg;
-//******************************************************************************
-//input data width is 8bit, and the first bit is bit[0]
-function[31:0] NextCRC;
- input[7:0] D;
- input[31:0] C;
- reg[31:0] NewCRC;
- begin
- NewCRC[0]=C[24]^C[30]^D[1]^D[7];
- NewCRC[1]=C[25]^C[31]^D[0]^D[6]^C[24]^C[30]^D[1]^D[7];
- NewCRC[2]=C[26]^D[5]^C[25]^C[31]^D[0]^D[6]^C[24]^C[30]^D[1]^D[7];
- NewCRC[3]=C[27]^D[4]^C[26]^D[5]^C[25]^C[31]^D[0]^D[6];
- NewCRC[4]=C[28]^D[3]^C[27]^D[4]^C[26]^D[5]^C[24]^C[30]^D[1]^D[7];
- NewCRC[5]=C[29]^D[2]^C[28]^D[3]^C[27]^D[4]^C[25]^C[31]^D[0]^D[6]^C[24]^C[30]^D[1]^D[7];
- NewCRC[6]=C[30]^D[1]^C[29]^D[2]^C[28]^D[3]^C[26]^D[5]^C[25]^C[31]^D[0]^D[6];
- NewCRC[7]=C[31]^D[0]^C[29]^D[2]^C[27]^D[4]^C[26]^D[5]^C[24]^D[7];
- NewCRC[8]=C[0]^C[28]^D[3]^C[27]^D[4]^C[25]^D[6]^C[24]^D[7];
- NewCRC[9]=C[1]^C[29]^D[2]^C[28]^D[3]^C[26]^D[5]^C[25]^D[6];
- NewCRC[10]=C[2]^C[29]^D[2]^C[27]^D[4]^C[26]^D[5]^C[24]^D[7];
- NewCRC[11]=C[3]^C[28]^D[3]^C[27]^D[4]^C[25]^D[6]^C[24]^D[7];
- NewCRC[12]=C[4]^C[29]^D[2]^C[28]^D[3]^C[26]^D[5]^C[25]^D[6]^C[24]^C[30]^D[1]^D[7];
- NewCRC[13]=C[5]^C[30]^D[1]^C[29]^D[2]^C[27]^D[4]^C[26]^D[5]^C[25]^C[31]^D[0]^D[6];
- NewCRC[14]=C[6]^C[31]^D[0]^C[30]^D[1]^C[28]^D[3]^C[27]^D[4]^C[26]^D[5];
- NewCRC[15]=C[7]^C[31]^D[0]^C[29]^D[2]^C[28]^D[3]^C[27]^D[4];
- NewCRC[16]=C[8]^C[29]^D[2]^C[28]^D[3]^C[24]^D[7];
- NewCRC[17]=C[9]^C[30]^D[1]^C[29]^D[2]^C[25]^D[6];
- NewCRC[18]=C[10]^C[31]^D[0]^C[30]^D[1]^C[26]^D[5];
- NewCRC[19]=C[11]^C[31]^D[0]^C[27]^D[4];
- NewCRC[20]=C[12]^C[28]^D[3];
- NewCRC[21]=C[13]^C[29]^D[2];
- NewCRC[22]=C[14]^C[24]^D[7];
- NewCRC[23]=C[15]^C[25]^D[6]^C[24]^C[30]^D[1]^D[7];
- NewCRC[24]=C[16]^C[26]^D[5]^C[25]^C[31]^D[0]^D[6];
- NewCRC[25]=C[17]^C[27]^D[4]^C[26]^D[5];
- NewCRC[26]=C[18]^C[28]^D[3]^C[27]^D[4]^C[24]^C[30]^D[1]^D[7];
- NewCRC[27]=C[19]^C[29]^D[2]^C[28]^D[3]^C[25]^C[31]^D[0]^D[6];
- NewCRC[28]=C[20]^C[30]^D[1]^C[29]^D[2]^C[26]^D[5];
- NewCRC[29]=C[21]^C[31]^D[0]^C[30]^D[1]^C[27]^D[4];
- NewCRC[30]=C[22]^C[31]^D[0]^C[28]^D[3];
- NewCRC[31]=C[23]^C[29]^D[2];
- NextCRC=NewCRC;
- end
- endfunction
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- CRC_reg <=32'hffffffff;
- else if (CRC_init)
- CRC_reg <=32'hffffffff;
- else if (CRC_en)
- CRC_reg <=NextCRC(CRC_data,CRC_reg);
-
-assign CRC_err = CRC_chk_en&(CRC_reg[31:0] != 32'hc704dd7b);
-
-endmodule
diff --git a/eth/rtl/verilog/MAC_rx/MAC_rx_FF.v b/eth/rtl/verilog/MAC_rx/MAC_rx_FF.v deleted file mode 100644 index e212b8986..000000000 --- a/eth/rtl/verilog/MAC_rx/MAC_rx_FF.v +++ /dev/null @@ -1,167 +0,0 @@ -
-// ////////////////////////////////////////////////////////////////////
-// Completely Rewritten by M. Ettus, no John Gao code left
-// ////////////////////////////////////////////////////////////////////
-
-module MAC_rx_FF
- #(parameter RX_FF_DEPTH = 9)
- (input Reset,
- input Clk_MAC,
- input Clk_SYS,
-
- // MAC_rx_ctrl interface
- input [7:0] Fifo_data,
- input Fifo_data_en,
- output Fifo_full,
- input Fifo_data_err,
- input Fifo_data_end,
- output [15:0] Fifo_space,
-
- // CPU
- input RX_APPEND_CRC,
- input [4:0] Rx_Hwmark,
- input [4:0] Rx_Lwmark,
-
- // User interface
- output Rx_mac_empty,
- input Rx_mac_rd,
- output [31:0] Rx_mac_data,
- output [1:0] Rx_mac_BE,
- output Rx_mac_sop,
- output Rx_mac_eop,
- output Rx_mac_err,
-
- // FIFO Levels
- output [15:0] fifo_occupied,
- output fifo_full_dbg,
- output fifo_empty
- );
-
- reg [1:0] FF_state;
- reg [2:0] PKT_state;
- reg [31:0] staging;
- reg [35:0] staging2;
- reg line_ready, line_ready_d1;
- wire sop_i, eop_i;
- reg [1:0] be;
-
- always @(posedge Clk_MAC or posedge Reset)
- if(Reset)
- FF_state <= 0;
- else
- if(Fifo_data_err | Fifo_data_end)
- FF_state <= 0;
- else if(Fifo_data_en)
- FF_state <= FF_state + 1;
-
- always @(posedge Clk_MAC or posedge Reset)
- if(Reset)
- staging[31:0] <= 0;
- else if(Fifo_data_en)
- case(FF_state)
- 0 : staging[31:24] <= Fifo_data;
- 1 : staging[23:16] <= Fifo_data;
- 2 : staging[15:8] <= Fifo_data;
- 3 : staging[7:0] <= Fifo_data;
- endcase // case(FF_state)
-
- localparam PKT_idle = 0;
- localparam PKT_sop = 1;
- localparam PKT_pkt = 2;
- localparam PKT_end = 3;
- localparam PKT_err = 4;
-
- always @(posedge Clk_MAC or posedge Reset)
- if(Reset)
- PKT_state <= 0;
- else
- case(PKT_state)
- PKT_idle :
- if(Fifo_data_en)
- PKT_state <= PKT_sop;
- PKT_sop, PKT_pkt :
- if(Fifo_data_err | (line_ready & Fifo_full))
- PKT_state <= PKT_err;
- else if(Fifo_data_end)
- PKT_state <= PKT_end;
- else if(line_ready & ~Fifo_full)
- PKT_state <= PKT_pkt;
- PKT_end :
- PKT_state <= PKT_idle;
- PKT_err :
- if(~Fifo_full)
- PKT_state <= PKT_idle;
- endcase // case(PKT_state)
-
- assign sop_i = (PKT_state == PKT_sop);
- assign eop_i = (PKT_state == PKT_end);
-
- always @(posedge Clk_MAC)
- if(line_ready)
- staging2 <= {sop_i, eop_i, be[1:0], staging};
-
- always @(posedge Clk_MAC)
- if(Reset)
- line_ready <= 0;
- else if((Fifo_data_en & (FF_state==2'd3)) | Fifo_data_end | Fifo_data_err)
- line_ready <= 1;
- else
- line_ready <= 0;
-
- always @(posedge Clk_MAC)
- line_ready_d1 <= line_ready;
-
- always @(posedge Clk_MAC)
- if(Fifo_data_end | Fifo_data_err)
- be <= FF_state;
- else
- be <= 0;
-
- wire sop_o, eop_o, empty;
- wire [1:0] be_o;
- wire [RX_FF_DEPTH-1:0] occupied, occupied_sysclk;
- wire [31:0] dataout;
-
-/*
- fifo_2clock #(.DWIDTH(36),.AWIDTH(RX_FF_DEPTH)) mac_rx_fifo
- (.wclk(Clk_MAC),.datain((PKT_state==PKT_err) ? 36'hF_FFFF_FFFF : staging2),.write(~Fifo_full & (line_ready_d1|(PKT_state==PKT_err))),
- .full(Fifo_full),.level_wclk(occupied),
- .rclk(Clk_SYS),.dataout({sop_o,eop_o,be_o[1:0],dataout}),.read(Rx_mac_rd),
- .empty(empty),.level_rclk(),
- .arst(Reset) );
- */
-
- fifo_xlnx_2Kx36_2clk mac_rx_ff_core
- (
- .din((PKT_state==PKT_err) ? 36'hF_FFFF_FFFF : staging2), // Bus [35 : 0]
- .rd_clk(Clk_SYS),
- .rd_en(Rx_mac_rd),
- .rst(Reset),
- .wr_clk(Clk_MAC),
- .wr_en(~Fifo_full & (line_ready_d1|(PKT_state==PKT_err))),
- .dout({sop_o,eop_o,be_o[1:0],dataout}), // Bus [35 : 0]
- .empty(empty),
- .full(Fifo_full),
- .rd_data_count(occupied_sysclk), // Bus [11 : 0]
- .wr_data_count(occupied)); // Bus [11 : 0]
-
- assign Fifo_space[15:RX_FF_DEPTH] = 0;
- assign Fifo_space[RX_FF_DEPTH-1:0] = ~occupied;
- assign fifo_occupied = occupied_sysclk;
- assign fifo_full_dbg = Fifo_full; // FIXME -- in wrong clock domain
- assign fifo_empty = empty;
-
- // mac side fifo interface
- // Input - Rx_mac_rd
- // Output - Rx_mac_empty, Rx_mac_sop, Rx_mac_eop, Rx_mac_err, Rx_mac_data, Rx_mac_BE
-
- assign Rx_mac_BE = be_o;
- assign Rx_mac_sop = sop_o & ~eop_o;
- assign Rx_mac_eop = eop_o;
- assign Rx_mac_err = sop_o & eop_o;
- assign Rx_mac_empty = empty;
- assign Rx_mac_data = dataout;
-
-endmodule // MAC_rx_FF
-
-// FIXME Should we send out an "almost full" signal instead of full?
diff --git a/eth/rtl/verilog/MAC_rx/MAC_rx_add_chk.v b/eth/rtl/verilog/MAC_rx/MAC_rx_add_chk.v deleted file mode 100644 index 0c8d6bd4e..000000000 --- a/eth/rtl/verilog/MAC_rx/MAC_rx_add_chk.v +++ /dev/null @@ -1,158 +0,0 @@ -// ////////////////////////////////////////////////////////////////////
-// // ////
-// // MAC_rx_add_chk.v ////
-// // ////
-// // This file is part of the Ethernet IP core project ////
-// // http://www.opencores.org/projects.cgi/wr_en/ethernet_tri_mode/////
-// // ////
-// // Author(s): ////
-// // - Jon Gao (gaojon@yahoo.com) ////
-// // ////
-// // ////
-// ////////////////////////////////////////////////////////////////////
-// // ////
-// // Copyright (C) 2001 Authors ////
-// // ////
-// // This source file may be used and distributed without ////
-// // restriction provided that this copyright statement is not ////
-// // removed from the file and that any derivative work contains ////
-// // the original copyright notice and the associated disclaimer. ////
-// // ////
-// // This source file is free software; you can redistribute it ////
-// // and/or modify it under the terms of the GNU Lesser General ////
-// // Public License as published by the Free Software Foundation; ////
-// // either version 2.1 of the License, or (at your option) any ////
-// // later version. ////
-// // ////
-// // This source is distributed in the hope that it will be ////
-// // useful, but WITHOUT ANY WARRANTY; without even the implied ////
-// // warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-// // PURPOSE. See the GNU Lesser General Public License for more ////
-// // details. ////
-// // ////
-// // You should have received a copy of the GNU Lesser General ////
-// // Public License along with this source; if not, download it ////
-// // from http://www.opencores.org/lgpl.shtml ////
-// // ////
-// ////////////////////////////////////////////////////////////////////
-//
-// CVS Revision History
-//
-// $Log: MAC_rx_add_chk.v,v $
-// Revision 1.3 2006/01/19 14:07:54 maverickist
-// verification is complete.
-//
-// Revision 1.2 2005/12/16 06:44:17 Administrator
-// replaced tab with space.
-// passed 9.6k length frame test.
-//
-// Revision 1.1.1.1 2005/12/13 01:51:45 Administrator
-// no message
-//
-
-module MAC_rx_add_chk
- (Reset ,
- Clk ,
- Init ,
- data ,
- MAC_add_en ,
- MAC_rx_add_chk_err ,
- //From CPU
- MAC_rx_add_chk_en ,
- MAC_add_prom_data ,
- MAC_add_prom_add ,
- MAC_add_prom_wr
- );
-
- input Reset ;
- input Clk ;
- input Init ;
- input [7:0] data ;
- input MAC_add_en ;
- output MAC_rx_add_chk_err ;
- //From CPU
- input MAC_rx_add_chk_en ;
- input [7:0] MAC_add_prom_data ;
- input [2:0] MAC_add_prom_add ;
- input MAC_add_prom_wr ;
-
- // ******************************************************************************
- // internal signals
- // ******************************************************************************
- reg [2:0] addr_rd;
- wire [2:0] addr_wr;
- wire [7:0] din;
- //wire [7:0] dout;
- reg [7:0] dout;
- wire wr_en;
-
- reg MAC_rx_add_chk_err;
- reg MAC_add_prom_wr_dl1;
- reg MAC_add_prom_wr_dl2;
- reg [7:0] data_dl1 ;
- reg MAC_add_en_dl1 ;
-
- // ******************************************************************************
- // write data from cpu to prom
- // ******************************************************************************
- always @ (posedge Clk or posedge Reset)
- if (Reset)
- begin
- data_dl1 <=0;
- MAC_add_en_dl1 <=0;
- end
- else
- begin
- data_dl1 <=data;
- MAC_add_en_dl1 <=MAC_add_en;
- end
-
- always @ (posedge Clk or posedge Reset)
- if (Reset)
- begin
- MAC_add_prom_wr_dl1 <=0;
- MAC_add_prom_wr_dl2 <=0;
- end
- else
- begin
- MAC_add_prom_wr_dl1 <=MAC_add_prom_wr;
- MAC_add_prom_wr_dl2 <=MAC_add_prom_wr_dl1;
- end
-
- assign wr_en =MAC_add_prom_wr_dl1&!MAC_add_prom_wr_dl2;
- assign addr_wr =MAC_add_prom_add;
- assign din =MAC_add_prom_data;
-
- // ******************************************************************************
- // mac add verify
- // ******************************************************************************
- always @ (posedge Clk or posedge Reset)
- if (Reset)
- addr_rd <=0;
- else if (Init)
- addr_rd <=0;
- else if (MAC_add_en)
- addr_rd <=addr_rd + 1;
-
- always @ (posedge Clk or posedge Reset)
- if (Reset)
- MAC_rx_add_chk_err <=0;
- else if (Init)
- MAC_rx_add_chk_err <=0;
- else if (MAC_rx_add_chk_en && MAC_add_en_dl1 && (dout!=data_dl1) )
- MAC_rx_add_chk_err <=1;
-
-
- // ******************************************************************************
- // a port for read ,b port for write .
- // ******************************************************************************
-
- reg [7:0] address_ram [0:7];
- always @(posedge Clk)
- if(wr_en)
- address_ram[addr_wr] <= din;
-
- always @(posedge Clk)
- dout <= address_ram[addr_rd];
-
-endmodule // MAC_rx_add_chk
diff --git a/eth/rtl/verilog/MAC_rx/MAC_rx_ctrl.v b/eth/rtl/verilog/MAC_rx/MAC_rx_ctrl.v deleted file mode 100644 index 5ab795801..000000000 --- a/eth/rtl/verilog/MAC_rx/MAC_rx_ctrl.v +++ /dev/null @@ -1,664 +0,0 @@ -//////////////////////////////////////////////////////////////////////
-//// ////
-//// MAC_rx_ctrl.v ////
-//// ////
-//// This file is part of the Ethernet IP core project ////
-//// http://www.opencores.org/projects.cgi/web/ethernet_tri_mode/////
-//// ////
-//// Author(s): ////
-//// - Jon Gao (gaojon@yahoo.com) ////
-//// ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// Copyright (C) 2001 Authors ////
-//// ////
-//// This source file may be used and distributed without ////
-//// restriction provided that this copyright statement is not ////
-//// removed from the file and that any derivative work contains ////
-//// the original copyright notice and the associated disclaimer. ////
-//// ////
-//// This source file is free software; you can redistribute it ////
-//// and/or modify it under the terms of the GNU Lesser General ////
-//// Public License as published by the Free Software Foundation; ////
-//// either version 2.1 of the License, or (at your option) any ////
-//// later version. ////
-//// ////
-//// This source is distributed in the hope that it will be ////
-//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
-//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-//// PURPOSE. See the GNU Lesser General Public License for more ////
-//// details. ////
-//// ////
-//// You should have received a copy of the GNU Lesser General ////
-//// Public License along with this source; if not, download it ////
-//// from http://www.opencores.org/lgpl.shtml ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//
-// CVS Revision History
-//
-// $Log: MAC_rx_ctrl.v,v $
-// Revision 1.4 2006/06/25 04:58:56 maverickist
-// no message
-//
-// Revision 1.3 2006/01/19 14:07:54 maverickist
-// verification is complete.
-//
-// Revision 1.3 2005/12/16 06:44:17 Administrator
-// replaced tab with space.
-// passed 9.6k length frame test.
-//
-// Revision 1.2 2005/12/13 12:15:37 Administrator
-// no message
-//
-// Revision 1.1.1.1 2005/12/13 01:51:45 Administrator
-// no message
-//
-
-module MAC_rx_ctrl (
-Reset ,
-Clk ,
-//RMII interface
-MCrs_dv , //
-MRxD , //
-MRxErr , //
-//CRC_chk interface
-CRC_en ,
-CRC_data,
-CRC_init ,
-CRC_err ,
-//MAC_rx_add_chk interface
-MAC_add_en ,
-MAC_add_data,
-MAC_rx_add_chk_err ,
-//broadcast_filter
-broadcast_ptr ,
-broadcast_drop ,
-//flow_control signals
-pause_quanta ,
-pause_quanta_val ,
-//MAC_rx_FF interface
-Fifo_data ,
-Fifo_data_en ,
-Fifo_data_err ,
-Fifo_data_drop ,
-Fifo_data_end ,
-Fifo_full ,
-//RMON interface
-Rx_pkt_type_rmon ,
-Rx_pkt_length_rmon ,
-Rx_apply_rmon ,
-Rx_pkt_err_type_rmon ,
-//CPU
-RX_IFG_SET ,
-RX_MAX_LENGTH,
-RX_MIN_LENGTH
-);
-
-input Reset ;
-input Clk ;
- //RMII interface
-input MCrs_dv ;
-input [7:0] MRxD ;
-input MRxErr ;
- //CRC_chk interface
-output CRC_en ;
-output CRC_init;
-output [7:0] CRC_data;
-input CRC_err ;
- //MAC_rx_add_chk interface
-output MAC_add_en ;
-output [7:0] MAC_add_data;
-input MAC_rx_add_chk_err ;
- //broadcast_filter
-output broadcast_ptr ;
-input broadcast_drop ;
- //flow_control signals
-output [15:0] pause_quanta ;
-output pause_quanta_val ;
- //MAC_rx_FF interface
-output [7:0] Fifo_data ;
-output Fifo_data_en ;
-output Fifo_data_err ;
-output Fifo_data_drop ;
-output Fifo_data_end ;
-input Fifo_full;
- //RMON interface
-output [15:0] Rx_pkt_length_rmon ;
-output Rx_apply_rmon ;
-output [2:0] Rx_pkt_err_type_rmon ;
-output [2:0] Rx_pkt_type_rmon ;
- //CPU
-input [5:0] RX_IFG_SET ;
-input [15:0] RX_MAX_LENGTH ;// 1518
-input [6:0] RX_MIN_LENGTH ;// 64
-
-//******************************************************************************
-//internal signals
-//******************************************************************************
-parameter State_idle =4'd00;
-parameter State_preamble =4'd01;
-parameter State_SFD =4'd02;
-parameter State_data =4'd03;
-parameter State_checkCRC =4'd04;
-parameter State_OkEnd =4'd07;
-parameter State_DropEnd =4'd08;
-parameter State_ErrEnd =4'd09;
-parameter State_CRCErrEnd =4'd10;
-parameter State_FFFullDrop =4'd11;
-parameter State_FFFullErrEnd =4'd12;
-parameter State_IFG =4'd13;
-parameter State_Drop2End =4'd14;
-
-parameter Pause_idle =4'd0;
-parameter Pause_pre_syn =4'd1;
-parameter Pause_quanta_hi =4'd2;
-parameter Pause_quanta_lo =4'd3;
-parameter Pause_syn =4'd4;
-
-reg [3:0] Current_state /* synthesis syn_keep=1 */;
-reg [3:0] Next_state;
-reg [3:0] Pause_current /* synthesis syn_keep=1 */;
-reg [3:0] Pause_next;
-reg [5:0] IFG_counter;
-reg Crs_dv ;
-reg [7:0] RxD ;
-reg [7:0] RxD_dl1 ;
-reg RxErr ;
-reg [15:0] Frame_length_counter;
-reg Too_long;
-reg Too_short;
-reg ProcessingHeader;
-//reg Fifo_data_en;
-//reg Fifo_data_err;
-//reg Fifo_data_drop;
-//reg Fifo_data_end;
-reg CRC_en;
-reg CRC_init;
-reg Rx_apply_rmon;
-reg [2:0] Rx_pkt_err_type_rmon;
-reg MAC_add_en;
-reg [2:0] Rx_pkt_type_rmon;
-reg [7:0] pause_quanta_h ;
-reg [15:0] pause_quanta ;
-reg pause_quanta_val ;
-reg pause_quanta_val_tmp;
-reg pause_frame_ptr ;
-reg broadcast_ptr ;
-//******************************************************************************
-//delay signals
-//******************************************************************************
-
-always @ (posedge Reset or posedge Clk)
- if (Reset)
- begin
- Crs_dv <=0;
- RxD <=0;
- RxErr <=0;
- end
- else
- begin
- Crs_dv <=MCrs_dv ;
- RxD <=MRxD ;
- RxErr <=MRxErr ;
- end
-
-always @ (posedge Reset or posedge Clk)
- if (Reset)
- RxD_dl1 <=0;
- else
- RxD_dl1 <=RxD;
-
-//---------------------------------------------------------------------------
-// Small pre-FIFO (acutally a synchronously clearable shift-register) for
-// storing the first part of a packet before writing it to the "real" FIFO
-// in MAC_rx_FF. This allows a packet to be dropped safely if an error
-// happens in the beginning of a packet (or if the MAC address doesn't pass
-// the receive filter!)
-//---------------------------------------------------------------------------
-
- reg pre_fifo_data_drop;
- reg pre_fifo_data_en;
- reg pre_fifo_data_err;
- reg pre_fifo_data_end;
- wire [7:0] pre_fifo_wrdata;
-
- reg [8+3-1:0] pre_fifo_element_0;
- reg [8+3-1:0] pre_fifo_element_1;
- reg [8+3-1:0] pre_fifo_element_2;
- reg [8+3-1:0] pre_fifo_element_3;
- reg [8+3-1:0] pre_fifo_element_4;
- reg [8+3-1:0] pre_fifo_element_5;
- reg [8+3-1:0] pre_fifo_element_6;
- reg [8+3-1:0] pre_fifo_element_7;
- reg [8+3-1:0] pre_fifo_element_8;
- reg [8+3-1:0] pre_fifo_element_9;
-
- always @( posedge Reset or posedge Clk )
- if ( Reset )
- begin
- pre_fifo_element_0 <= 'b0;
- pre_fifo_element_1 <= 'b0;
- pre_fifo_element_2 <= 'b0;
- pre_fifo_element_3 <= 'b0;
- pre_fifo_element_4 <= 'b0;
- pre_fifo_element_5 <= 'b0;
- pre_fifo_element_6 <= 'b0;
- pre_fifo_element_7 <= 'b0;
- pre_fifo_element_8 <= 'b0;
- pre_fifo_element_9 <= 'b0;
- end
- else
- begin
- if ( pre_fifo_data_drop )
- begin
- pre_fifo_element_0 <= 'b0;
- pre_fifo_element_1 <= 'b0;
- pre_fifo_element_2 <= 'b0;
- pre_fifo_element_3 <= 'b0;
- pre_fifo_element_4 <= 'b0;
- pre_fifo_element_5 <= 'b0;
- pre_fifo_element_6 <= 'b0;
- pre_fifo_element_7 <= 'b0;
- pre_fifo_element_8 <= 'b0;
- pre_fifo_element_9 <= 'b0;
- end
- else
- begin
- pre_fifo_element_0 <= pre_fifo_element_1;
- pre_fifo_element_1 <= pre_fifo_element_2;
- pre_fifo_element_2 <= pre_fifo_element_3;
- pre_fifo_element_3 <= pre_fifo_element_4;
- pre_fifo_element_4 <= pre_fifo_element_5;
- pre_fifo_element_5 <= pre_fifo_element_6;
- pre_fifo_element_6 <= pre_fifo_element_7;
- pre_fifo_element_7 <= pre_fifo_element_8;
- pre_fifo_element_8 <= pre_fifo_element_9;
- pre_fifo_element_9 <= { pre_fifo_data_en,
- pre_fifo_data_err,
- pre_fifo_data_end,
- pre_fifo_wrdata };
- end
- end
-
- assign Fifo_data = pre_fifo_element_0[7:0];
- assign Fifo_data_end = pre_fifo_element_0[8];
- assign Fifo_data_err = pre_fifo_element_0[9];
- assign Fifo_data_en = pre_fifo_element_0[10];
-
- assign CRC_data = pre_fifo_wrdata;
- assign MAC_add_data = pre_fifo_wrdata;
-
-//******************************************************************************
-//State_machine
-//******************************************************************************
-
-always @( posedge Reset or posedge Clk )
- if ( Reset )
- Current_state <= State_idle;
- else
- Current_state <= Next_state;
-
-always @ (*)
- case (Current_state)
- State_idle:
- if ( Crs_dv&&RxD==8'h55 )
- Next_state = State_preamble;
- else
- Next_state = Current_state;
-
- State_preamble:
- if ( !Crs_dv )
- Next_state = State_DropEnd;
- else if ( RxErr )
- Next_state = State_DropEnd;
- else if ( RxD==8'hd5 )
- Next_state = State_SFD;
- else if ( RxD==8'h55 )
- Next_state =Current_state;
- else
- Next_state = State_DropEnd;
-
- State_SFD:
- if ( !Crs_dv )
- Next_state = State_DropEnd;
- else if ( RxErr )
- Next_state = State_DropEnd;
- else
- Next_state = State_data;
-
- State_data:
- if ( !Crs_dv && !ProcessingHeader && !Too_short && !Too_long )
- Next_state = State_checkCRC;
- else if ( !Crs_dv && ProcessingHeader )
- Next_state = State_Drop2End;
- else if ( !Crs_dv && (Too_short | Too_long) )
- Next_state = State_ErrEnd;
- else if ( Fifo_full )
- Next_state = State_FFFullErrEnd;
- else if ( RxErr && ProcessingHeader )
- Next_state = State_Drop2End;
- else if ( RxErr || Too_long )
- Next_state = State_ErrEnd;
- else if ( MAC_rx_add_chk_err || broadcast_drop )
- Next_state = State_DropEnd;
- else
- Next_state = State_data;
-
- State_checkCRC:
- if ( CRC_err )
- Next_state = State_CRCErrEnd;
- else
- Next_state = State_OkEnd;
-
- State_OkEnd:
- Next_state = State_IFG;
-
- State_ErrEnd:
- Next_state = State_IFG;
-
- State_DropEnd:
- Next_state = State_IFG;
-
- State_Drop2End:
- Next_state = State_IFG;
-
- State_CRCErrEnd:
- Next_state = State_IFG;
-
- State_FFFullErrEnd:
- Next_state = State_FFFullDrop;
-
- State_FFFullDrop:
- if ( !Crs_dv )
- Next_state =State_IFG;
- else
- Next_state =Current_state;
-
- State_IFG:
- if ( IFG_counter==RX_IFG_SET-4 ) // Remove some additional time?
- Next_state = State_idle;
- else
- Next_state = Current_state;
-
- default:
- Next_state = State_idle;
- endcase
-
-always @( posedge Reset or posedge Clk )
- if ( Reset )
- IFG_counter <= 0;
- else if ( Current_state!=State_IFG )
- IFG_counter <= 0;
- else
- IFG_counter <= IFG_counter + 1;
-
-//******************************************************************************
-//gen fifo interface signals
-//******************************************************************************
-
-assign pre_fifo_wrdata = RxD_dl1;
-
-always @( Current_state )
- if ( Current_state==State_data )
- pre_fifo_data_en = 1;
- else
- pre_fifo_data_en = 0;
-
-always @( Current_state )
- if ( (Current_state==State_ErrEnd ) ||
- (Current_state==State_OkEnd ) ||
- (Current_state==State_CRCErrEnd ) ||
- (Current_state==State_FFFullErrEnd) ||
- (Current_state==State_DropEnd ) ||
- (Current_state==State_Drop2End ) )
- pre_fifo_data_end = 1;
- else
- pre_fifo_data_end = 0;
-
-always @( Current_state )
- if ( (Current_state==State_ErrEnd ) ||
- (Current_state==State_CRCErrEnd ) ||
- (Current_state==State_FFFullErrEnd) ||
- (Current_state==State_DropEnd ) ||
- (Current_state==State_Drop2End ) )
- pre_fifo_data_err = 1;
- else
- pre_fifo_data_err = 0;
-
-always @( Current_state )
- if ( (Current_state==State_DropEnd ) ||
- (Current_state==State_Drop2End) )
- pre_fifo_data_drop = 1;
- else
- pre_fifo_data_drop = 0;
-
- // Drop in main Rx FIFO is no longer supported!
- assign Fifo_data_drop = 0;
-
-//******************************************************************************
-//CRC_chk interface
-//******************************************************************************
-
-always @(Current_state)
- if (Current_state==State_data)
- CRC_en =1;
- else
- CRC_en =0;
-
-always @(Current_state)
- if (Current_state==State_SFD)
- CRC_init =1;
- else
- CRC_init =0;
-
-//******************************************************************************
-//gen rmon signals
-//******************************************************************************
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- Frame_length_counter <=0;
- else if (Current_state==State_SFD)
- Frame_length_counter <=1;
- else if (Current_state==State_data)
- Frame_length_counter <=Frame_length_counter+ 1'b1;
-
-always @( Frame_length_counter )
- if ( Frame_length_counter < 8 )
- ProcessingHeader = 1;
- else
- ProcessingHeader = 0;
-
-always @ (Frame_length_counter or RX_MIN_LENGTH)
- if (Frame_length_counter<RX_MIN_LENGTH)
- Too_short =1;
- else
- Too_short =0;
-
-always @ (*)
- if (Frame_length_counter>RX_MAX_LENGTH)
- Too_long =1;
- else
- Too_long =0;
-
-assign Rx_pkt_length_rmon = Frame_length_counter-1'b1;
-
-reg [2:0] Rx_apply_rmon_reg;
-
-always @( posedge Clk or posedge Reset )
- if ( Reset )
- begin
- Rx_apply_rmon <= 0;
- Rx_apply_rmon_reg <= 'b0;
- end
- else
- begin
- if ( (Current_state==State_OkEnd ) ||
- (Current_state==State_ErrEnd ) ||
- (Current_state==State_CRCErrEnd ) ||
- (Current_state==State_Drop2End ) ||
- (Current_state==State_FFFullErrEnd) )
- Rx_apply_rmon <= 1;
- else
- if ( Rx_apply_rmon_reg[2] )
- Rx_apply_rmon <= 0;
-
- Rx_apply_rmon_reg <= { Rx_apply_rmon_reg[1:0], Rx_apply_rmon };
- end
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- Rx_pkt_err_type_rmon <=0;
- else if (Current_state==State_CRCErrEnd)
- Rx_pkt_err_type_rmon <=3'b001 ;//
- else if (Current_state==State_FFFullErrEnd)
- Rx_pkt_err_type_rmon <=3'b010 ;//
- else if ( (Current_state==State_ErrEnd) || (Current_state==State_Drop2End) )
- Rx_pkt_err_type_rmon <=3'b011 ;//
- else if(Current_state==State_OkEnd)
- Rx_pkt_err_type_rmon <=3'b100 ;
-
-
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- Rx_pkt_type_rmon <=0;
- else if (Current_state==State_OkEnd&&pause_frame_ptr)
- Rx_pkt_type_rmon <=3'b100 ;//
- else if(Current_state==State_SFD&&Next_state==State_data)
- Rx_pkt_type_rmon <={1'b0,MRxD[7:6]};
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- broadcast_ptr <=0;
- else if(Current_state==State_IFG)
- broadcast_ptr <=0;
- else if(Current_state==State_SFD&&Next_state==State_data&&MRxD[7:6]==2'b11)
- broadcast_ptr <=1;
-
-
-
-//******************************************************************************
-//MAC add checker signals
-//******************************************************************************
-always @ (Frame_length_counter or pre_fifo_data_en)
- if(Frame_length_counter>=1&&Frame_length_counter<=6)
- MAC_add_en <=pre_fifo_data_en;
- else
- MAC_add_en <=0;
-
-//******************************************************************************
-//flow control signals
-//******************************************************************************
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- Pause_current <=Pause_idle;
- else
- Pause_current <=Pause_next;
-
-always @ (*)
- case (Pause_current)
- Pause_idle :
- if(Current_state==State_SFD)
- Pause_next =Pause_pre_syn;
- else
- Pause_next =Pause_current;
- Pause_pre_syn:
- case (Frame_length_counter)
- 16'd1: if (RxD_dl1==8'h01)
- Pause_next =Pause_current;
- else
- Pause_next =Pause_idle;
- 16'd2: if (RxD_dl1==8'h80)
- Pause_next =Pause_current;
- else
- Pause_next =Pause_idle;
- 16'd3: if (RxD_dl1==8'hc2)
- Pause_next =Pause_current;
- else
- Pause_next =Pause_idle;
- 16'd4: if (RxD_dl1==8'h00)
- Pause_next =Pause_current;
- else
- Pause_next =Pause_idle;
- 16'd5: if (RxD_dl1==8'h00)
- Pause_next =Pause_current;
- else
- Pause_next =Pause_idle;
- 16'd6: if (RxD_dl1==8'h01)
- Pause_next =Pause_current;
- else
- Pause_next =Pause_idle;
- 16'd13: if (RxD_dl1==8'h88)
- Pause_next =Pause_current;
- else
- Pause_next =Pause_idle;
- 16'd14: if (RxD_dl1==8'h08)
- Pause_next =Pause_current;
- else
- Pause_next =Pause_idle;
- 16'd15: if (RxD_dl1==8'h00)
- Pause_next =Pause_current;
- else
- Pause_next =Pause_idle;
- 16'd16: if (RxD_dl1==8'h01)
- Pause_next =Pause_quanta_hi;
- else
- Pause_next =Pause_idle;
- default: Pause_next =Pause_current;
- endcase
- Pause_quanta_hi :
- Pause_next =Pause_quanta_lo;
- Pause_quanta_lo :
- Pause_next =Pause_syn;
- Pause_syn :
- if (Current_state==State_IFG)
- Pause_next =Pause_idle;
- else
- Pause_next =Pause_current;
- default
- Pause_next =Pause_idle;
- endcase
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- pause_quanta_h <=0;
- else if(Pause_current==Pause_quanta_hi)
- pause_quanta_h <=RxD_dl1;
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- pause_quanta <=0;
- else if(Pause_current==Pause_quanta_lo)
- pause_quanta <={pause_quanta_h,RxD_dl1};
-
- // The following 2 always blocks are a strange way of holding
- // pause_quanta_val high for 2 cycles
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- pause_quanta_val_tmp <=0;
- else if(Current_state==State_OkEnd&&Pause_current==Pause_syn)
- pause_quanta_val_tmp <=1;
- else
- pause_quanta_val_tmp <=0;
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- pause_quanta_val <=0;
- else if(Current_state==State_OkEnd&&Pause_current==Pause_syn||pause_quanta_val_tmp)
- pause_quanta_val <=1;
- else
- pause_quanta_val <=0;
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- pause_frame_ptr <=0;
- else if(Pause_current==Pause_syn)
- pause_frame_ptr <=1;
- else
- pause_frame_ptr <=0;
-
-endmodule
-
-
diff --git a/eth/rtl/verilog/MAC_top.v b/eth/rtl/verilog/MAC_top.v deleted file mode 100644 index 4e5b0db0a..000000000 --- a/eth/rtl/verilog/MAC_top.v +++ /dev/null @@ -1,518 +0,0 @@ -//////////////////////////////////////////////////////////////////////
-//// ////
-//// MAC_top.v ////
-//// ////
-//// This file is part of the Ethernet IP core project ////
-//// http://www.opencores.org/projects.cgi/web/ethernet_tri_mode/////
-//// ////
-//// Author(s): ////
-//// - Jon Gao (gaojon@yahoo.com) ////
-//// ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// Copyright (C) 2001 Authors ////
-//// ////
-//// This source file may be used and distributed without ////
-//// restriction provided that this copyright statement is not ////
-//// removed from the file and that any derivative work contains ////
-//// the original copyright notice and the associated disclaimer. ////
-//// ////
-//// This source file is free software; you can redistribute it ////
-//// and/or modify it under the terms of the GNU Lesser General ////
-//// Public License as published by the Free Software Foundation; ////
-//// either version 2.1 of the License, or (at your option) any ////
-//// later version. ////
-//// ////
-//// This source is distributed in the hope that it will be ////
-//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
-//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-//// PURPOSE. See the GNU Lesser General Public License for more ////
-//// details. ////
-//// ////
-//// You should have received a copy of the GNU Lesser General ////
-//// Public License along with this source; if not, download it ////
-//// from http://www.opencores.org/lgpl.shtml ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-
-module MAC_top
- #(parameter TX_FF_DEPTH = 9,
- parameter RX_FF_DEPTH = 9)
- (
- // System signals
- input Clk_125M,
- input Clk_user,
-
- input rst_mac,
- input rst_user,
-
- // Wishbone compliant core host interface
- input RST_I, // Active high (async) reset of the Wishbone interface
- input CLK_I, // Wishbone interface clock (nominally 50 MHz)
- input STB_I, // Active high module-select
- input CYC_I, // Active high cycle-enable
- input [6:0] ADR_I, // Module register address
- input WE_I, // Active high for writes, low for reads
- input [31:0] DAT_I, // Write data
- output [31:0] DAT_O, // Read data
- output ACK_O, // Acknowledge output – single high pulse
-
- // User (packet) interface
- output Rx_mac_empty,
- input Rx_mac_rd,
- output [31:0] Rx_mac_data,
- output [1:0] Rx_mac_BE,
- output Rx_mac_sop,
- output Rx_mac_eop,
- output Rx_mac_err,
-
- output Tx_mac_wa,
- input Tx_mac_wr,
- input [31:0] Tx_mac_data,
- input [1:0] Tx_mac_BE,
- input Tx_mac_sop,
- input Tx_mac_eop,
-
- // PHY interface (GMII/MII)
- output Gtx_clk, // Used only in GMII mode
- input Rx_clk,
- input Tx_clk, // Used only in MII mode
- output Tx_er,
- output Tx_en,
- output [7:0] Txd,
- input Rx_er,
- input Rx_dv,
- input [7:0] Rxd,
- input Crs,
- input Col,
-
- // MDIO interface (to PHY)
- inout Mdio,
- output Mdc,
-
- // FIFO levels
- output [15:0] rx_fifo_occupied,
- output rx_fifo_full,
- output rx_fifo_empty,
- output [15:0] tx_fifo_occupied,
- output tx_fifo_full,
- output tx_fifo_empty,
-
- // Debug Interface
- output [31:0] debug0,
- output [31:0] debug1
-);
-
- wire rst_mac_rx = rst_mac;
- wire rst_mac_tx = rst_mac;
- wire [2:0] Speed;
-
- wire [31:0] debug_rx;
- wire [31:0] debug_tx0;
- wire [31:0] debug_tx1;
-
- //-------------------------------------------------------------------------
- // Local declarations
- //-------------------------------------------------------------------------
-
- // RMON interface
- wire [15:0] Rx_pkt_length_rmon;
- wire Rx_apply_rmon;
- wire [2:0] Rx_pkt_err_type_rmon;
- wire [2:0] Rx_pkt_type_rmon;
- wire [2:0] Tx_pkt_type_rmon;
- wire [15:0] Tx_pkt_length_rmon;
- wire Tx_apply_rmon;
- wire [2:0] Tx_pkt_err_type_rmon;
-
- // PHY interface
- wire MCrs_dv;
- wire [7:0] MRxD;
- wire MRxErr;
-
- // Flow-control signals
- wire [15:0] pause_quanta;
- wire pause_quanta_val;
- wire [15:0] rx_fifo_space;
- wire pause_apply, pause_quanta_sub;
- wire xon_gen, xoff_gen, xon_gen_complete, xoff_gen_complete;
- wire [15:0] fc_hwmark, fc_lwmark, fc_padtime;
-
- //PHY interface
- wire [7:0] MTxD;
- wire MTxEn;
- wire MCRS;
-
- // Interface clk signals
- wire MAC_tx_clk;
- wire MAC_rx_clk;
- wire MAC_tx_clk_div;
- wire MAC_rx_clk_div;
-
- // Reg signals
- wire [4:0] Tx_Hwmark;
- wire [4:0] Tx_Lwmark;
- wire pause_frame_send_en;
- wire [15:0] pause_quanta_set;
- wire MAC_tx_add_en;
- wire FullDuplex;
- wire [3:0] MaxRetry;
- wire [5:0] IFGset;
- wire [7:0] MAC_tx_add_prom_data;
- wire [2:0] MAC_tx_add_prom_add;
- wire MAC_tx_add_prom_wr;
- wire tx_pause_en;
-
- // Rx host interface
- wire MAC_rx_add_chk_en;
- wire [7:0] MAC_rx_add_prom_data;
- wire [2:0] MAC_rx_add_prom_add;
- wire MAC_rx_add_prom_wr;
- wire broadcast_filter_en;
- wire RX_APPEND_CRC;
- wire [4:0] Rx_Hwmark;
- wire [4:0] Rx_Lwmark;
- wire CRC_chk_en;
- wire [5:0] RX_IFG_SET;
- wire [15:0] RX_MAX_LENGTH;
- wire [6:0] RX_MIN_LENGTH;
-
- // RMON host interface
- wire [5:0] CPU_rd_addr;
- wire CPU_rd_apply;
- wire CPU_rd_grant;
- wire [31:0] CPU_rd_dout;
-
- // PHY int host interface
- wire Line_loop_en;
-
- // MII to CPU
- wire [7:0] Divider;
- wire [15:0] CtrlData;
- wire [4:0] Rgad;
- wire [4:0] Fiad;
- wire NoPre;
- wire WCtrlData;
- wire RStat;
- wire ScanStat;
- wire Busy;
- wire LinkFail;
- wire Nvalid;
- wire [15:0] Prsd;
- wire WCtrlDataStart;
- wire RStatStart;
- wire UpdateMIIRX_DATAReg;
- wire [15:0] broadcast_bucket_depth;
- wire [15:0] broadcast_bucket_interval;
-
- //-------------------------------------------------------------------------
- // Instantiation of sub-modules
- //-------------------------------------------------------------------------
-
- MAC_rx #(.RX_FF_DEPTH(RX_FF_DEPTH))
- U_MAC_rx(
- .Reset ( rst_mac_rx ),
- .Clk_user ( Clk_user ),
- .Clk ( MAC_rx_clk_div ),
-
- // RMII interface
- .MCrs_dv ( MCrs_dv ),
- .MRxD ( MRxD ),
- .MRxErr ( MRxErr ),
-
- // Flow-control signals
- .pause_quanta ( pause_quanta ),
- .pause_quanta_val ( pause_quanta_val ),
- .rx_fifo_space ( rx_fifo_space ),
-
- // User interface
- .Rx_mac_empty ( Rx_mac_empty ),
- .Rx_mac_rd ( Rx_mac_rd ),
- .Rx_mac_data ( Rx_mac_data ),
- .Rx_mac_BE ( Rx_mac_BE ),
- .Rx_mac_sop ( Rx_mac_sop ),
- .Rx_mac_eop ( Rx_mac_eop ),
- .Rx_mac_err ( Rx_mac_err ),
-
- // CPU
- .MAC_rx_add_chk_en ( MAC_rx_add_chk_en ),
- .MAC_add_prom_data ( MAC_rx_add_prom_data ),
- .MAC_add_prom_add ( MAC_rx_add_prom_add ),
- .MAC_add_prom_wr ( MAC_rx_add_prom_wr ),
- .broadcast_filter_en ( broadcast_filter_en ),
- .broadcast_bucket_depth ( broadcast_bucket_depth ),
- .broadcast_bucket_interval( broadcast_bucket_interval ),
- .RX_APPEND_CRC ( RX_APPEND_CRC ),
- .Rx_Hwmark ( Rx_Hwmark ),
- .Rx_Lwmark ( Rx_Lwmark ),
- .CRC_chk_en ( CRC_chk_en ),
- .RX_IFG_SET ( RX_IFG_SET ),
- .RX_MAX_LENGTH ( RX_MAX_LENGTH ),
- .RX_MIN_LENGTH ( RX_MIN_LENGTH ),
-
- // RMON interface
- .Rx_pkt_length_rmon ( Rx_pkt_length_rmon ),
- .Rx_apply_rmon ( Rx_apply_rmon ),
- .Rx_pkt_err_type_rmon ( Rx_pkt_err_type_rmon ),
- .Rx_pkt_type_rmon ( Rx_pkt_type_rmon ),
-
- .rx_fifo_occupied(rx_fifo_occupied),
- .rx_fifo_full(rx_fifo_full),
- .rx_fifo_empty(rx_fifo_empty),
- .debug(debug_rx)
- );
-
- MAC_tx #(.TX_FF_DEPTH(TX_FF_DEPTH))
- U_MAC_tx(
- .Reset ( rst_mac_tx ),
- .Clk ( MAC_tx_clk_div ),
- //.Clk_user ( Clk_user ),
- .Clk_user ( MAC_tx_clk_div ),
-
- // PHY interface
- .TxD ( MTxD ),
- .TxEn ( MTxEn ),
- .CRS ( MCRS ),
-
- // RMON
- .Tx_pkt_type_rmon ( Tx_pkt_type_rmon ),
- .Tx_pkt_length_rmon ( Tx_pkt_length_rmon ),
- .Tx_apply_rmon ( Tx_apply_rmon ),
- .Tx_pkt_err_type_rmon( Tx_pkt_err_type_rmon ),
-
- // User interface
- .Tx_mac_wa ( Tx_mac_wa ),
- .Tx_mac_wr ( Tx_mac_wr ),
- .Tx_mac_data ( Tx_mac_data ),
- .Tx_mac_BE ( Tx_mac_BE ),
- .Tx_mac_sop ( Tx_mac_sop ),
- .Tx_mac_eop ( Tx_mac_eop ),
-
- // Host interface
- .Tx_Hwmark ( Tx_Hwmark ),
- .Tx_Lwmark ( Tx_Lwmark ),
- .MAC_tx_add_en ( MAC_tx_add_en ),
- .FullDuplex ( FullDuplex ),
- .MaxRetry ( MaxRetry ),
- .IFGset ( IFGset ),
- .MAC_add_prom_data ( MAC_tx_add_prom_data ),
- .MAC_add_prom_add ( MAC_tx_add_prom_add ),
- .MAC_add_prom_wr ( MAC_tx_add_prom_wr ),
-
- .pause_apply ( pause_apply ),
- .pause_quanta_sub ( pause_quanta_sub ),
- .pause_quanta_set ( pause_quanta_set ),
- .xoff_gen ( xoff_gen ),
- .xon_gen ( xon_gen ),
- .xoff_gen_complete ( xoff_gen_complete ),
- .xon_gen_complete ( xon_gen_complete ),
- .debug0(debug_tx0),
- .debug1(debug_tx1)
- );
-
- // Flow control outbound -- when other side sends PAUSE, we wait
- flow_ctrl_tx flow_ctrl_tx
- (.rst(rst_mac_tx),
- .tx_clk(MAC_tx_clk_div),
- // Setting
- .tx_pause_en ( tx_pause_en ),
- // From RX side
- .pause_quanta (pause_quanta),
- .pause_quanta_val(pause_quanta_val), // Other guy sent a PAUSE
- // To TX side
- .pause_apply (pause_apply), // To TX, stop sending new frames
- .pause_quanta_sub (pause_quanta_sub) // From TX, indicates we have used up 1 quanta
- );
-
- flow_ctrl_rx flow_ctrl_rx // When we are running out of RX space, send a PAUSE
- (.rst(rst_mac_rx), // FIXME
- // Settings
- .pause_frame_send_en ( pause_frame_send_en ),
- .pause_quanta_set ( pause_quanta_set ),
- .fc_hwmark (fc_hwmark),
- .fc_lwmark (fc_lwmark),
- .fc_padtime (fc_padtime),
- // From RX side
- .rx_clk(MAC_rx_clk_div),
- .rx_fifo_space (rx_fifo_space), // Decide if we need to send a PAUSE
- // To TX side
- .tx_clk(MAC_tx_clk_div),
- .xoff_gen (xoff_gen),
- .xon_gen(xon_gen), // Tell our TX to send PAUSE frames
- .xoff_gen_complete (xoff_gen_complete),
- .xon_gen_complete(xon_gen_complete)
- );
-
- RMON U_RMON(
- .Clk ( CLK_I ),
- .Reset ( RST_I ),
-
- // Tx RMON
- .Tx_pkt_type_rmon ( Tx_pkt_type_rmon ),
- .Tx_pkt_length_rmon ( Tx_pkt_length_rmon ),
- .Tx_apply_rmon ( Tx_apply_rmon ),
- .Tx_pkt_err_type_rmon( Tx_pkt_err_type_rmon ),
-
- // Rx RMON
- .Rx_pkt_type_rmon ( Rx_pkt_type_rmon ),
- .Rx_pkt_length_rmon ( Rx_pkt_length_rmon ),
- .Rx_apply_rmon ( Rx_apply_rmon ),
- .Rx_pkt_err_type_rmon( Rx_pkt_err_type_rmon ),
-
- // CPU
- .CPU_rd_addr ( CPU_rd_addr ),
- .CPU_rd_apply ( CPU_rd_apply ),
- .CPU_rd_grant ( CPU_rd_grant ),
- .CPU_rd_dout ( CPU_rd_dout )
- );
-
- Phy_int U_Phy_int(
- .rst_mac_rx ( rst_mac_rx ),
- .rst_mac_tx ( rst_mac_tx ),
- .MAC_rx_clk ( MAC_rx_clk ),
- .MAC_tx_clk ( MAC_tx_clk ),
- // Rx interface
- .MCrs_dv ( MCrs_dv ),
- .MRxD ( MRxD ),
- .MRxErr ( MRxErr ),
- // Tx interface
- .MTxD ( MTxD ),
- .MTxEn ( MTxEn ),
- .MCRS ( MCRS ),
- // PHY interface
- .Tx_er ( Tx_er ),
- .Tx_en ( Tx_en ),
- .Txd ( Txd ),
- .Rx_er ( Rx_er ),
- .Rx_dv ( Rx_dv ),
- .Rxd ( Rxd ),
- .Crs ( Crs ),
- .Col ( Col ),
- // Host interface
- .Line_loop_en( Line_loop_en ),
- .Speed ( Speed ) );
-
- Clk_ctrl U_Clk_ctrl(
- .Reset ( rst_mac ),
- .Clk_125M ( Clk_125M ),
-
- // Host interface
- .Speed ( Speed ),
-
- // Phy interface
- .Gtx_clk ( Gtx_clk ),
- .Rx_clk ( Rx_clk ),
- .Tx_clk ( Tx_clk ),
-
- // Interface clocks
- .MAC_tx_clk ( MAC_tx_clk ),
- .MAC_rx_clk ( MAC_rx_clk ),
- .MAC_tx_clk_div( MAC_tx_clk_div ),
- .MAC_rx_clk_div( MAC_rx_clk_div )
- );
-
- eth_miim U_eth_miim(
- .Clk ( CLK_I ),
- .Reset ( RST_I ),
- .Divider ( Divider ),
- .NoPre ( NoPre ),
- .CtrlData ( CtrlData ),
- .Rgad ( Rgad ),
- .Fiad ( Fiad ),
- .WCtrlData ( WCtrlData ),
- .RStat ( RStat ),
- .ScanStat ( ScanStat ),
- .Mdio ( Mdio ),
- .Mdc ( Mdc ),
- .Busy ( Busy ),
- .Prsd ( Prsd ),
- .LinkFail ( LinkFail ),
- .Nvalid ( Nvalid ),
- .WCtrlDataStart ( WCtrlDataStart ),
- .RStatStart ( RStatStart ),
- .UpdateMIIRX_DATAReg( UpdateMIIRX_DATAReg )
- );
-
- Reg_int U_Reg_int(
- // Wishbone compliant core host interface
- .CLK_I( CLK_I ),
- .RST_I( RST_I ),
- .STB_I( STB_I ),
- .CYC_I( CYC_I ),
- .ADR_I( ADR_I ),
- .WE_I ( WE_I ),
- .DAT_I( DAT_I ),
- .DAT_O( DAT_O ),
- .ACK_O( ACK_O ),
-
- // Tx host interface
- .Tx_Hwmark ( Tx_Hwmark ),
- .Tx_Lwmark ( Tx_Lwmark ),
- .MAC_tx_add_en ( MAC_tx_add_en ),
- .FullDuplex ( FullDuplex ),
- .MaxRetry ( MaxRetry ),
- .IFGset ( IFGset ),
- .MAC_tx_add_prom_data ( MAC_tx_add_prom_data ),
- .MAC_tx_add_prom_add ( MAC_tx_add_prom_add ),
- .MAC_tx_add_prom_wr ( MAC_tx_add_prom_wr ),
-
- // Rx host interface
- .MAC_rx_add_chk_en ( MAC_rx_add_chk_en ),
- .MAC_rx_add_prom_data ( MAC_rx_add_prom_data ),
- .MAC_rx_add_prom_add ( MAC_rx_add_prom_add ),
- .MAC_rx_add_prom_wr ( MAC_rx_add_prom_wr ),
- .broadcast_filter_en ( broadcast_filter_en ),
- .broadcast_bucket_depth ( broadcast_bucket_depth ),
- .broadcast_bucket_interval( broadcast_bucket_interval ),
- .RX_APPEND_CRC ( RX_APPEND_CRC ),
- .Rx_Hwmark ( Rx_Hwmark ),
- .Rx_Lwmark ( Rx_Lwmark ),
- .CRC_chk_en ( CRC_chk_en ),
- .RX_IFG_SET ( RX_IFG_SET ),
- .RX_MAX_LENGTH ( RX_MAX_LENGTH ),
- .RX_MIN_LENGTH ( RX_MIN_LENGTH ),
-
- // Flow Control settings
- .pause_frame_send_en ( pause_frame_send_en ),
- .pause_quanta_set ( pause_quanta_set ),
- .tx_pause_en ( tx_pause_en ),
- .fc_hwmark ( fc_hwmark ),
- .fc_lwmark ( fc_lwmark ),
- .fc_padtime ( fc_padtime ),
-
- // RMON host interface
- .CPU_rd_addr ( CPU_rd_addr ),
- .CPU_rd_apply ( CPU_rd_apply ),
- .CPU_rd_grant ( CPU_rd_grant ),
- .CPU_rd_dout ( CPU_rd_dout ),
-
- // PHY int host interface
- .Line_loop_en ( Line_loop_en ),
- .Speed ( Speed ),
-
- // MII to CPU
- .Divider ( Divider ),
- .CtrlData ( CtrlData ),
- .Rgad ( Rgad ),
- .Fiad ( Fiad ),
- .NoPre ( NoPre ),
- .WCtrlData ( WCtrlData ),
- .RStat ( RStat ),
- .ScanStat ( ScanStat ),
- .Busy ( Busy ),
- .LinkFail ( LinkFail ),
- .Nvalid ( Nvalid ),
- .Prsd ( Prsd ),
- .WCtrlDataStart ( WCtrlDataStart ),
- .RStatStart ( RStatStart ),
- .UpdateMIIRX_DATAReg ( UpdateMIIRX_DATAReg )
- );
-
- assign debug0 = {xon_gen, xoff_gen, xon_gen_complete, xoff_gen_complete, debug_rx[3:0]};
- //assign debug0 = {{debug_rx[3:0], xon_gen, xon_gen_complete, xoff_gen, xoff_gen_complete},
- // {1'b0,Rx_mac_err,Rx_mac_empty,Rx_mac_rd,Rx_mac_sop,Rx_mac_eop,Rx_mac_BE[1:0]},
- // {rx_fifo_space}};
- //assign debug0 = debug_tx0;
- //assign debug1 = debug_tx1;
-endmodule
diff --git a/eth/rtl/verilog/MAC_tx.v b/eth/rtl/verilog/MAC_tx.v deleted file mode 100644 index bbf331022..000000000 --- a/eth/rtl/verilog/MAC_tx.v +++ /dev/null @@ -1,250 +0,0 @@ -//////////////////////////////////////////////////////////////////////
-//// ////
-//// MAC_tx.v ////
-//// ////
-//// This file is part of the Ethernet IP core project ////
-//// http://www.opencores.org/projects.cgi/web/ethernet_tri_mode/////
-//// ////
-//// Author(s): ////
-//// - Jon Gao (gaojon@yahoo.com) ////
-//// ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// Copyright (C) 2001 Authors ////
-//// ////
-//// This source file may be used and distributed without ////
-//// restriction provided that this copyright statement is not ////
-//// removed from the file and that any derivative work contains ////
-//// the original copyright notice and the associated disclaimer. ////
-//// ////
-//// This source file is free software; you can redistribute it ////
-//// and/or modify it under the terms of the GNU Lesser General ////
-//// Public License as published by the Free Software Foundation; ////
-//// either version 2.1 of the License, or (at your option) any ////
-//// later version. ////
-//// ////
-//// This source is distributed in the hope that it will be ////
-//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
-//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-//// PURPOSE. See the GNU Lesser General Public License for more ////
-//// details. ////
-//// ////
-//// You should have received a copy of the GNU Lesser General ////
-//// Public License along with this source; if not, download it ////
-//// from http://www.opencores.org/lgpl.shtml ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//
-// CVS Revision History
-//
-// $Log: MAC_tx.v,v $
-// Revision 1.4 2006/11/17 17:53:07 maverickist
-// no message
-//
-// Revision 1.3 2006/01/19 14:07:53 maverickist
-// verification is complete.
-//
-// Revision 1.2 2005/12/16 06:44:14 Administrator
-// replaced tab with space.
-// passed 9.6k length frame test.
-//
-// Revision 1.1.1.1 2005/12/13 01:51:44 Administrator
-// no message
-//
-
-module MAC_tx
- #(parameter TX_FF_DEPTH = 9)
- (
-input Reset ,
-input Clk ,
-input Clk_user ,
- //PHY interface
-output [7:0] TxD ,
-output TxEn ,
-input CRS ,
- //RMON
-output [2:0] Tx_pkt_type_rmon ,
-output [15:0] Tx_pkt_length_rmon ,
-output Tx_apply_rmon ,
-output [2:0] Tx_pkt_err_type_rmon,
- //user interface
-output Tx_mac_wa ,
-input Tx_mac_wr ,
-input [31:0] Tx_mac_data ,
-input [1:0] Tx_mac_BE ,//big endian
-input Tx_mac_sop ,
-input Tx_mac_eop ,
- //host interface
-input [4:0] Tx_Hwmark ,
-input [4:0] Tx_Lwmark ,
-input MAC_tx_add_en ,
-input FullDuplex ,
-input [3:0] MaxRetry ,
-input [5:0] IFGset ,
-input [7:0] MAC_add_prom_data ,
-input [2:0] MAC_add_prom_add ,
-input MAC_add_prom_wr ,
- // Flow control stuff
-input pause_apply ,
-output pause_quanta_sub,
-input [15:0] pause_quanta_set ,
-input xoff_gen,
-input xon_gen,
-output xoff_gen_complete,
-output xon_gen_complete,
- output [31:0] debug0,
- output [31:0] debug1
-);
-
- // ******************************************************************************
- // internal signals
- // ******************************************************************************
- //CRC_gen Interface
-wire CRC_init ;
-wire[7:0] Frame_data ;
-wire Data_en ;
-wire CRC_rd ;
-wire CRC_end ;
-wire[7:0] CRC_out ;
- //Random_gen interface
-wire Random_init ;
-wire[3:0] RetryCnt ;
-wire Random_time_meet ;//levle hight indicate random time passed away
- //flow control
- //MAC_rx_FF
-wire[7:0] Fifo_data ;
-wire Fifo_rd ;
-wire Fifo_eop ;
-wire Fifo_da ;
-wire Fifo_rd_finish ;
-wire Fifo_rd_retry ;
-wire Fifo_ra ;
-wire Fifo_data_err_empty ;
-wire Fifo_data_err_full ;
- //MAC_tx_addr_add
-wire MAC_tx_addr_init ;
-wire MAC_tx_addr_rd ;
-wire[7:0] MAC_tx_addr_data ;
-
-
- reg xon_gen_d1, xoff_gen_d1;
- always @(posedge Clk) xon_gen_d1 <= xon_gen;
- always @(posedge Clk) xoff_gen_d1 <= xoff_gen;
-
-//******************************************************************************
-//instantiation
-//******************************************************************************
-MAC_tx_ctrl U_MAC_tx_ctrl(
-.Reset (Reset ),
-.Clk (Clk ),
- //CRC_gen Interface (//CRC_gen Interface ),
-.CRC_init (CRC_init ),
-.Frame_data (Frame_data ),
-.Data_en (Data_en ),
-.CRC_rd (CRC_rd ),
-.CRC_end (CRC_end ),
-.CRC_out (CRC_out ),
- //Random_gen interfac (//Random_gen interfac ),
-.Random_init (Random_init ),
-.RetryCnt (RetryCnt ),
-.Random_time_meet (Random_time_meet ),
- //flow control (//flow control ),
-.pause_apply (pause_apply ),
-.pause_quanta_sub (pause_quanta_sub ),
-.xoff_gen (xoff_gen_d1 ),
-.xoff_gen_complete (xoff_gen_complete ),
-.xon_gen (xon_gen_d1 ),
-.xon_gen_complete (xon_gen_complete ),
- //MAC_tx_FF (//MAC_tx_FF ),
-.Fifo_data (Fifo_data ),
-.Fifo_rd (Fifo_rd ),
-.Fifo_eop (Fifo_eop ),
-.Fifo_da (Fifo_da ),
-.Fifo_rd_finish (Fifo_rd_finish ),
-.Fifo_rd_retry (Fifo_rd_retry ),
-.Fifo_ra (Fifo_ra ),
-.Fifo_data_err_empty (Fifo_data_err_empty ),
-.Fifo_data_err_full (Fifo_data_err_full ),
- //RMII (//RMII ),
-.TxD (TxD ),
-.TxEn (TxEn ),
-.CRS (CRS ),
- //MAC_tx_addr_add (//MAC_tx_addr_add ),
-.MAC_tx_addr_rd (MAC_tx_addr_rd ),
-.MAC_tx_addr_data (MAC_tx_addr_data ),
-.MAC_tx_addr_init (MAC_tx_addr_init ),
- //RMON (//RMON ),
-.Tx_pkt_type_rmon (Tx_pkt_type_rmon ),
-.Tx_pkt_length_rmon (Tx_pkt_length_rmon ),
-.Tx_apply_rmon (Tx_apply_rmon ),
-.Tx_pkt_err_type_rmon (Tx_pkt_err_type_rmon ),
- //CPU (//CPU ),
-.pause_quanta_set (pause_quanta_set ),
-.MAC_tx_add_en (MAC_tx_add_en ),
-.FullDuplex (FullDuplex ),
-.MaxRetry (MaxRetry ),
-.IFGset (IFGset )
-);
-
-CRC_gen U_CRC_gen(
-.Reset (Reset ),
-.Clk (Clk ),
-.Init (CRC_init ),
-.Frame_data (Frame_data ),
-.Data_en (Data_en ),
-.CRC_rd (CRC_rd ),
-.CRC_out (CRC_out ),
-.CRC_end (CRC_end )
-);
-
- MAC_tx_addr_add U_MAC_tx_addr_add
- (.Reset (Reset ),
- .Clk (Clk ),
- .MAC_tx_addr_rd (MAC_tx_addr_rd ),
- .MAC_tx_addr_init (MAC_tx_addr_init ),
- .MAC_tx_addr_data (MAC_tx_addr_data ),
- //CPU
- .MAC_add_prom_data (MAC_add_prom_data ),
- .MAC_add_prom_add (MAC_add_prom_add ),
- .MAC_add_prom_wr (MAC_add_prom_wr )
- );
-
-MAC_tx_FF #(.TX_FF_DEPTH(TX_FF_DEPTH)) U_MAC_tx_FF(
-.Reset (Reset ),
-.Clk_MAC (Clk ),
-.Clk_SYS (Clk_user ),
- //MAC_rx_ctrl interf (//MAC_rx_ctrl interf ),
-.Fifo_data (Fifo_data ),
-.Fifo_rd (Fifo_rd ),
-.Fifo_rd_finish (Fifo_rd_finish ),
-.Fifo_rd_retry (Fifo_rd_retry ),
-.Fifo_eop (Fifo_eop ),
-.Fifo_da (Fifo_da ),
-.Fifo_ra (Fifo_ra ),
-.Fifo_data_err_empty (Fifo_data_err_empty ),
-.Fifo_data_err_full (Fifo_data_err_full ),
- //user interface (//user interface ),
-.Tx_mac_wa (Tx_mac_wa ),
-.Tx_mac_wr (Tx_mac_wr ),
-.Tx_mac_data (Tx_mac_data ),
-.Tx_mac_BE (Tx_mac_BE ),
-.Tx_mac_sop (Tx_mac_sop ),
-.Tx_mac_eop (Tx_mac_eop ),
- //host interface (//host interface ),
-.FullDuplex (FullDuplex ),
-.Tx_Hwmark (Tx_Hwmark ),
-.Tx_Lwmark (Tx_Lwmark ),
-.debug0(debug0),
-.debug1(debug1)
-);
-
-Random_gen U_Random_gen(
-.Reset (Reset ),
-.Clk (Clk ),
-.Init (Random_init ),
-.RetryCnt (RetryCnt ),
-.Random_time_meet (Random_time_meet )
-);
-
-endmodule
diff --git a/eth/rtl/verilog/MAC_tx/CRC_gen.v b/eth/rtl/verilog/MAC_tx/CRC_gen.v deleted file mode 100644 index 4a16e7c36..000000000 --- a/eth/rtl/verilog/MAC_tx/CRC_gen.v +++ /dev/null @@ -1,169 +0,0 @@ -//////////////////////////////////////////////////////////////////////
-//// ////
-//// CRC_gen.v ////
-//// ////
-//// This file is part of the Ethernet IP core project ////
-//// http://www.opencores.org/projects.cgi/web/ethernet_tri_mode/////
-//// ////
-//// Author(s): ////
-//// - Jon Gao (gaojon@yahoo.com) ////
-//// ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// Copyright (C) 2001 Authors ////
-//// ////
-//// This source file may be used and distributed without ////
-//// restriction provided that this copyright statement is not ////
-//// removed from the file and that any derivative work contains ////
-//// the original copyright notice and the associated disclaimer. ////
-//// ////
-//// This source file is free software; you can redistribute it ////
-//// and/or modify it under the terms of the GNU Lesser General ////
-//// Public License as published by the Free Software Foundation; ////
-//// either version 2.1 of the License, or (at your option) any ////
-//// later version. ////
-//// ////
-//// This source is distributed in the hope that it will be ////
-//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
-//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-//// PURPOSE. See the GNU Lesser General Public License for more ////
-//// details. ////
-//// ////
-//// You should have received a copy of the GNU Lesser General ////
-//// Public License along with this source; if not, download it ////
-//// from http://www.opencores.org/lgpl.shtml ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//
-// CVS Revision History
-//
-// $Log: CRC_gen.v,v $
-// Revision 1.3 2006/01/19 14:07:54 maverickist
-// verification is complete.
-//
-// Revision 1.2 2005/12/16 06:44:17 Administrator
-// replaced tab with space.
-// passed 9.6k length frame test.
-//
-// Revision 1.1.1.1 2005/12/13 01:51:45 Administrator
-// no message
-//
-
-module CRC_gen (
-Reset ,
-Clk ,
-Init ,
-Frame_data ,
-Data_en ,
-CRC_rd ,
-CRC_end ,
-CRC_out
-
-);
-input Reset ;
-input Clk ;
-input Init ;
-input [7:0] Frame_data ;
-input Data_en ;
-input CRC_rd ;
-output [7:0] CRC_out ;
-output CRC_end ;
-
-//******************************************************************************
-//internal signals
-//******************************************************************************
-reg [7:0] CRC_out ;
-reg [31:0] CRC_reg;
-reg CRC_end;
-reg [3:0] Counter;
-//******************************************************************************
-//******************************************************************************
-//input data width is 8bit, and the first bit is bit[0]
-function[31:0] NextCRC;
- input[7:0] D;
- input[31:0] C;
- reg[31:0] NewCRC;
- begin
- NewCRC[0]=C[24]^C[30]^D[1]^D[7];
- NewCRC[1]=C[25]^C[31]^D[0]^D[6]^C[24]^C[30]^D[1]^D[7];
- NewCRC[2]=C[26]^D[5]^C[25]^C[31]^D[0]^D[6]^C[24]^C[30]^D[1]^D[7];
- NewCRC[3]=C[27]^D[4]^C[26]^D[5]^C[25]^C[31]^D[0]^D[6];
- NewCRC[4]=C[28]^D[3]^C[27]^D[4]^C[26]^D[5]^C[24]^C[30]^D[1]^D[7];
- NewCRC[5]=C[29]^D[2]^C[28]^D[3]^C[27]^D[4]^C[25]^C[31]^D[0]^D[6]^C[24]^C[30]^D[1]^D[7];
- NewCRC[6]=C[30]^D[1]^C[29]^D[2]^C[28]^D[3]^C[26]^D[5]^C[25]^C[31]^D[0]^D[6];
- NewCRC[7]=C[31]^D[0]^C[29]^D[2]^C[27]^D[4]^C[26]^D[5]^C[24]^D[7];
- NewCRC[8]=C[0]^C[28]^D[3]^C[27]^D[4]^C[25]^D[6]^C[24]^D[7];
- NewCRC[9]=C[1]^C[29]^D[2]^C[28]^D[3]^C[26]^D[5]^C[25]^D[6];
- NewCRC[10]=C[2]^C[29]^D[2]^C[27]^D[4]^C[26]^D[5]^C[24]^D[7];
- NewCRC[11]=C[3]^C[28]^D[3]^C[27]^D[4]^C[25]^D[6]^C[24]^D[7];
- NewCRC[12]=C[4]^C[29]^D[2]^C[28]^D[3]^C[26]^D[5]^C[25]^D[6]^C[24]^C[30]^D[1]^D[7];
- NewCRC[13]=C[5]^C[30]^D[1]^C[29]^D[2]^C[27]^D[4]^C[26]^D[5]^C[25]^C[31]^D[0]^D[6];
- NewCRC[14]=C[6]^C[31]^D[0]^C[30]^D[1]^C[28]^D[3]^C[27]^D[4]^C[26]^D[5];
- NewCRC[15]=C[7]^C[31]^D[0]^C[29]^D[2]^C[28]^D[3]^C[27]^D[4];
- NewCRC[16]=C[8]^C[29]^D[2]^C[28]^D[3]^C[24]^D[7];
- NewCRC[17]=C[9]^C[30]^D[1]^C[29]^D[2]^C[25]^D[6];
- NewCRC[18]=C[10]^C[31]^D[0]^C[30]^D[1]^C[26]^D[5];
- NewCRC[19]=C[11]^C[31]^D[0]^C[27]^D[4];
- NewCRC[20]=C[12]^C[28]^D[3];
- NewCRC[21]=C[13]^C[29]^D[2];
- NewCRC[22]=C[14]^C[24]^D[7];
- NewCRC[23]=C[15]^C[25]^D[6]^C[24]^C[30]^D[1]^D[7];
- NewCRC[24]=C[16]^C[26]^D[5]^C[25]^C[31]^D[0]^D[6];
- NewCRC[25]=C[17]^C[27]^D[4]^C[26]^D[5];
- NewCRC[26]=C[18]^C[28]^D[3]^C[27]^D[4]^C[24]^C[30]^D[1]^D[7];
- NewCRC[27]=C[19]^C[29]^D[2]^C[28]^D[3]^C[25]^C[31]^D[0]^D[6];
- NewCRC[28]=C[20]^C[30]^D[1]^C[29]^D[2]^C[26]^D[5];
- NewCRC[29]=C[21]^C[31]^D[0]^C[30]^D[1]^C[27]^D[4];
- NewCRC[30]=C[22]^C[31]^D[0]^C[28]^D[3];
- NewCRC[31]=C[23]^C[29]^D[2];
- NextCRC=NewCRC;
- end
- endfunction
-//******************************************************************************
-
-always @ (posedge Clk) // or posedge Reset)
-// if (Reset)
-// CRC_reg <=32'hffffffff;
-// else
- if (Init)
- CRC_reg <=32'hffffffff;
- else if (Data_en)
- CRC_reg <=NextCRC(Frame_data,CRC_reg);
- else if (CRC_rd)
- CRC_reg <={CRC_reg[23:0],8'hff};
-
-always @ (CRC_rd or CRC_reg)
-// if (CRC_rd)
- CRC_out <=~{
- CRC_reg[24],
- CRC_reg[25],
- CRC_reg[26],
- CRC_reg[27],
- CRC_reg[28],
- CRC_reg[29],
- CRC_reg[30],
- CRC_reg[31]
- };
-// else
-// CRC_out <=0;
-
-//caculate CRC out length ,4 cycles
-//CRC_end aligned to last CRC checksum data
-always @(posedge Clk or posedge Reset)
- if (Reset)
- Counter <=0;
- else if (!CRC_rd)
- Counter <=0;
- else
- Counter <=Counter + 1;
-
-always @ (Counter)
- if (Counter==3)
- CRC_end=1;
- else
- CRC_end=0;
-
-endmodule
-
-
diff --git a/eth/rtl/verilog/MAC_tx/MAC_tx_FF.v b/eth/rtl/verilog/MAC_tx/MAC_tx_FF.v deleted file mode 100644 index e62346fb7..000000000 --- a/eth/rtl/verilog/MAC_tx/MAC_tx_FF.v +++ /dev/null @@ -1,722 +0,0 @@ -//////////////////////////////////////////////////////////////////////
-//// ////
-//// MAC_tx_FF.v ////
-//// ////
-//// This file is part of the Ethernet IP core project ////
-//// http://www.opencores.org/projects.cgi/web/ethernet_tri_mode/////
-//// ////
-//// Author(s): ////
-//// - Jon Gao (gaojon@yahoo.com) ////
-//// ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// Copyright (C) 2001 Authors ////
-//// ////
-//// This source file may be used and distributed without ////
-//// restriction provided that this copyright statement is not ////
-//// removed from the file and that any derivative work contains ////
-//// the original copyright notice and the associated disclaimer. ////
-//// ////
-//// This source file is free software; you can redistribute it ////
-//// and/or modify it under the terms of the GNU Lesser General ////
-//// Public License as published by the Free Software Foundation; ////
-//// either version 2.1 of the License, or (at your option) any ////
-//// later version. ////
-//// ////
-//// This source is distributed in the hope that it will be ////
-//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
-//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-//// PURPOSE. See the GNU Lesser General Public License for more ////
-//// details. ////
-//// ////
-//// You should have received a copy of the GNU Lesser General ////
-//// Public License along with this source; if not, download it ////
-//// from http://www.opencores.org/lgpl.shtml ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-
-module MAC_tx_FF
- #(parameter TX_FF_DEPTH = 9)
- (input Reset ,
- input Clk_MAC ,
- input Clk_SYS ,
- //MAC_tx_ctrl
- output reg [7:0]Fifo_data ,
- input Fifo_rd ,
- input Fifo_rd_finish ,
- input Fifo_rd_retry ,
- output reg Fifo_eop ,
- output reg Fifo_da ,
- output reg Fifo_ra ,
- output reg Fifo_data_err_empty ,
- output Fifo_data_err_full ,
- //user interface
- output reg Tx_mac_wa ,
- input Tx_mac_wr ,
- input [31:0] Tx_mac_data ,
- input [1:0] Tx_mac_BE ,//big endian
- input Tx_mac_sop ,
- input Tx_mac_eop ,
- //host interface
- input FullDuplex ,
- input [4:0] Tx_Hwmark ,
- input [4:0] Tx_Lwmark ,
- output [31:0] debug0,
- output [31:0] debug1
- );
-
-//******************************************************************************
-//internal signals
-//******************************************************************************
-localparam MAC_byte3 =4'd00;
-localparam MAC_byte2 =4'd01;
-localparam MAC_byte1 =4'd02;
-localparam MAC_byte0 =4'd03;
-localparam MAC_wait_finish =4'd04;
-localparam MAC_retry =4'd08;
-localparam MAC_idle =4'd09;
-localparam MAC_FFEmpty =4'd10;
-localparam MAC_FFEmpty_drop =4'd11;
-localparam MAC_pkt_sub =4'd12;
-localparam MAC_FF_Err =4'd13;
-
-
-reg [3:0] Next_state_MAC ;
-
-
-localparam SYS_idle =4'd0;
-localparam SYS_WaitSop =4'd1;
-localparam SYS_SOP =4'd2;
-localparam SYS_MOP =4'd3;
-localparam SYS_DROP =4'd4;
-localparam SYS_EOP_ok =4'd5;
-localparam SYS_FFEmpty =4'd6;
-localparam SYS_EOP_err =4'd7;
-localparam SYS_SOP_err =4'd8;
-
-reg [3:0] Next_state_SYS;
-
-reg [TX_FF_DEPTH-1:0] Add_wr ;
-reg [TX_FF_DEPTH-1:0] Add_wr_ungray ;
-reg [TX_FF_DEPTH-1:0] Add_wr_gray ;
-reg [TX_FF_DEPTH-1:0] Add_wr_gray_dl1 ;
-reg [TX_FF_DEPTH-1:0] Add_wr_gray_dl2 ;
-
-reg [TX_FF_DEPTH-1:0] Add_rd ;
-reg [TX_FF_DEPTH-1:0] Add_rd_reg ;
-reg [TX_FF_DEPTH-1:0] Add_rd_gray ;
-reg [TX_FF_DEPTH-1:0] Add_rd_gray_dl1 ;
-reg [TX_FF_DEPTH-1:0] Add_rd_gray_dl2 ;
-reg [TX_FF_DEPTH-1:0] Add_rd_ungray ;
-wire[35:0] Din ;
-wire[35:0] Dout ;
-reg Wr_en ;
-wire[TX_FF_DEPTH-1:0] Add_wr_pluse;
-wire[TX_FF_DEPTH-1:0] Add_wr_pluse_pluse;
-reg [TX_FF_DEPTH-1:TX_FF_DEPTH-5] Add_rd_reg_dl1;
-
-reg [3:0] Current_state_MAC;
-reg [3:0] Current_state_MAC_reg;
-reg [3:0] Current_state_SYS;
-reg Full;
-reg AlmostFull;
-reg Empty;
-reg [35:0] Dout_reg;
-reg Packet_number_sub_edge;
-reg Packet_number_add;
-reg [5:0] Packet_number_inFF;
-reg [5:0] Packet_number_inFF_reg;
-reg Dout_reg_en;
-reg Add_rd_add;
-
-
-reg Tx_mac_wr_dl1 ;
-reg [31:0] Tx_mac_data_dl1 ;
-reg [1:0] Tx_mac_BE_dl1 ;
-reg FF_FullErr ;
-wire[1:0] Dout_BE ;
-wire Dout_eop ;
-wire Dout_err ;
-wire[31:0] Dout_data ;
-reg Packet_number_sub_dl1 ;
-reg Packet_number_sub_dl2 ;
-reg [4:0] Fifo_data_count ;
-reg Fifo_ra_tmp ;
-reg Pkt_sub_apply_tmp ;
-reg Pkt_sub_apply ;
-reg Add_rd_reg_rdy_tmp ;
-reg Add_rd_reg_rdy ;
-reg Add_rd_reg_rdy_dl1 ;
-reg Add_rd_reg_rdy_dl2 ;
-reg [4:0] Tx_Hwmark_pl ;
-reg [4:0] Tx_Lwmark_pl ;
-reg Add_rd_jump_tmp ;
-reg Add_rd_jump_tmp_pl1 ;
-reg Add_rd_jump ;
-reg Add_rd_jump_wr_pl1 ;
-
-//******************************************************************************
-//write data to from FF .
-//domain Clk_SYS
-//******************************************************************************
-always @ (posedge Clk_SYS or posedge Reset)
- if (Reset)
- Current_state_SYS <=SYS_idle;
- else
- Current_state_SYS <=Next_state_SYS;
-
-always @ (Current_state_SYS or Tx_mac_wr or Tx_mac_sop or Full or AlmostFull
- or Tx_mac_eop )
- case (Current_state_SYS)
- SYS_idle:
- if (Tx_mac_wr&&Tx_mac_sop&&!Full)
- Next_state_SYS =SYS_SOP;
- else
- Next_state_SYS =Current_state_SYS ;
- SYS_SOP:
- Next_state_SYS =SYS_MOP;
- SYS_MOP:
- if (AlmostFull)
- Next_state_SYS =SYS_DROP;
- else if (Tx_mac_wr&&Tx_mac_sop)
- Next_state_SYS =SYS_SOP_err;
- else if (Tx_mac_wr&&Tx_mac_eop)
- Next_state_SYS =SYS_EOP_ok;
- else
- Next_state_SYS =Current_state_SYS ;
- SYS_EOP_ok:
- if (Tx_mac_wr&&Tx_mac_sop)
- Next_state_SYS =SYS_SOP;
- else
- Next_state_SYS =SYS_idle;
- SYS_EOP_err:
- if (Tx_mac_wr&&Tx_mac_sop)
- Next_state_SYS =SYS_SOP;
- else
- Next_state_SYS =SYS_idle;
- SYS_SOP_err:
- Next_state_SYS =SYS_DROP;
- SYS_DROP: //FIFO overflow
- if (Tx_mac_wr&&Tx_mac_eop)
- Next_state_SYS =SYS_EOP_err;
- else
- Next_state_SYS =Current_state_SYS ;
- default:
- Next_state_SYS =SYS_idle;
- endcase
-
-//delay signals
-always @ (posedge Clk_SYS or posedge Reset)
- if (Reset)
- begin
- Tx_mac_wr_dl1 <=0;
- Tx_mac_data_dl1 <=0;
- Tx_mac_BE_dl1 <=0;
- end
- else
- begin
- Tx_mac_wr_dl1 <=Tx_mac_wr ;
- Tx_mac_data_dl1 <=Tx_mac_data ;
- Tx_mac_BE_dl1 <=Tx_mac_BE ;
- end
-
-always @(Current_state_SYS)
- if (Current_state_SYS==SYS_EOP_err)
- FF_FullErr =1;
- else
- FF_FullErr =0;
-
-reg Tx_mac_eop_gen;
-
-always @(Current_state_SYS)
- if (Current_state_SYS==SYS_EOP_err||Current_state_SYS==SYS_EOP_ok)
- Tx_mac_eop_gen =1;
- else
- Tx_mac_eop_gen =0;
-
-assign Din={Tx_mac_eop_gen,FF_FullErr,Tx_mac_BE_dl1,Tx_mac_data_dl1};
-
-always @(Current_state_SYS or Tx_mac_wr_dl1)
- if ((Current_state_SYS==SYS_SOP||Current_state_SYS==SYS_EOP_ok||
- Current_state_SYS==SYS_MOP||Current_state_SYS==SYS_EOP_err)&&Tx_mac_wr_dl1)
- Wr_en = 1;
- else
- Wr_en = 0;
-
-
-//
-
-
-always @ (posedge Reset or posedge Clk_SYS)
- if (Reset)
- Add_wr_gray <=0;
- else
- begin : Add_wr_gray_loop
- integer i;
- Add_wr_gray[TX_FF_DEPTH-1] <=Add_wr[TX_FF_DEPTH-1];
- for (i=TX_FF_DEPTH-2;i>=0;i=i-1)
- Add_wr_gray[i] <=Add_wr[i+1]^Add_wr[i];
- end
-
-always @ (posedge Clk_SYS or posedge Reset)
- if (Reset)
- Add_rd_gray_dl1 <=0;
- else
- Add_rd_gray_dl1 <=Add_rd_gray;
-
- always @(posedge Clk_SYS or posedge Reset)
- if (Reset)
- Add_rd_gray_dl2 <= 0;
- else
- Add_rd_gray_dl2 <= Add_rd_gray_dl1;
-
-always @ (posedge Clk_SYS or posedge Reset)
- if (Reset)
- Add_rd_jump_wr_pl1 <=0;
- else
- Add_rd_jump_wr_pl1 <=Add_rd_jump;
-
-always @ (posedge Clk_SYS or posedge Reset)
- if (Reset)
- Add_rd_ungray =0;
- else if (!Add_rd_jump_wr_pl1)
- begin : Add_rd_ungray_loop
- integer i;
- Add_rd_ungray[TX_FF_DEPTH-1] = Add_rd_gray_dl2[TX_FF_DEPTH-1];
- for (i=TX_FF_DEPTH-2;i>=0;i=i-1)
- Add_rd_ungray[i] = Add_rd_ungray[i+1]^Add_rd_gray_dl2[i];
- end
-
-assign Add_wr_pluse =Add_wr+1;
-assign Add_wr_pluse_pluse =Add_wr+4;
-
-always @ (Add_wr_pluse or Add_rd_ungray)
- if (Add_wr_pluse==Add_rd_ungray)
- Full =1;
- else
- Full =0;
-
-always @ (posedge Clk_SYS or posedge Reset)
- if (Reset)
- AlmostFull <=0;
- else if (Add_wr_pluse_pluse==Add_rd_ungray)
- AlmostFull <=1;
- else
- AlmostFull <=0;
-
-always @ (posedge Clk_SYS or posedge Reset)
- if (Reset)
- Add_wr <= 0;
- else if (Wr_en&&!Full)
- Add_wr <= Add_wr +1;
-
-always @ (posedge Clk_SYS or posedge Reset)
- if (Reset)
- begin
- Packet_number_sub_dl1 <=0;
- Packet_number_sub_dl2 <=0;
- end
- else
- begin
- Packet_number_sub_dl1 <=Pkt_sub_apply;
- Packet_number_sub_dl2 <=Packet_number_sub_dl1;
- end
-
-always @ (posedge Clk_SYS or posedge Reset)
- if (Reset)
- Packet_number_sub_edge <=0;
- else if (Packet_number_sub_dl1&!Packet_number_sub_dl2)
- Packet_number_sub_edge <=1;
- else
- Packet_number_sub_edge <=0;
-
-always @ (posedge Clk_SYS or posedge Reset)
- if (Reset)
- Packet_number_add <=0;
- else if (Current_state_SYS==SYS_EOP_ok||Current_state_SYS==SYS_EOP_err)
- Packet_number_add <=1;
- else
- Packet_number_add <=0;
-
-
-always @ (posedge Clk_SYS or posedge Reset)
- if (Reset)
- Packet_number_inFF <=0;
- else if (Packet_number_add&&!Packet_number_sub_edge)
- Packet_number_inFF <=Packet_number_inFF + 1'b1;
- else if (!Packet_number_add&&Packet_number_sub_edge)
- Packet_number_inFF <=Packet_number_inFF - 1'b1;
-
-
-always @ (posedge Clk_SYS or posedge Reset)
- if (Reset)
- Packet_number_inFF_reg <=0;
- else
- Packet_number_inFF_reg <=Packet_number_inFF;
-
-always @ (posedge Clk_SYS or posedge Reset)
- if (Reset)
- begin
- Add_rd_reg_rdy_dl1 <=0;
- Add_rd_reg_rdy_dl2 <=0;
- end
- else
- begin
- Add_rd_reg_rdy_dl1 <=Add_rd_reg_rdy;
- Add_rd_reg_rdy_dl2 <=Add_rd_reg_rdy_dl1;
- end
-
-always @ (posedge Clk_SYS or posedge Reset)
- if (Reset)
- Add_rd_reg_dl1 <=0;
- else if (Add_rd_reg_rdy_dl1&!Add_rd_reg_rdy_dl2)
- Add_rd_reg_dl1 <=Add_rd_reg[TX_FF_DEPTH-1:TX_FF_DEPTH-5];
-
-
-
-always @ (posedge Clk_SYS or posedge Reset)
- if (Reset)
- Fifo_data_count <=0;
- else if (FullDuplex)
- Fifo_data_count <=Add_wr[TX_FF_DEPTH-1:TX_FF_DEPTH-5]-Add_rd_ungray[TX_FF_DEPTH-1:TX_FF_DEPTH-5];
- else
- Fifo_data_count <=Add_wr[TX_FF_DEPTH-1:TX_FF_DEPTH-5]-Add_rd_reg_dl1[TX_FF_DEPTH-1:TX_FF_DEPTH-5]; //for half duplex backoff requirement
-
-
-always @ (posedge Clk_SYS or posedge Reset)
- if (Reset)
- Fifo_ra_tmp <=0;
- else if (Packet_number_inFF_reg>=1||Fifo_data_count>=Tx_Lwmark)
- Fifo_ra_tmp <=1;
- else
- Fifo_ra_tmp <=0;
-
-always @ (posedge Clk_SYS or posedge Reset)
- if (Reset)
- begin
- Tx_Hwmark_pl <=0;
- Tx_Lwmark_pl <=0;
- end
- else
- begin
- Tx_Hwmark_pl <=Tx_Hwmark;
- Tx_Lwmark_pl <=Tx_Lwmark;
- end
-
-always @ (posedge Clk_SYS or posedge Reset)
- if (Reset)
- Tx_mac_wa <=0;
- else if (Fifo_data_count>=Tx_Hwmark_pl)
- Tx_mac_wa <=0;
- else if (Fifo_data_count<Tx_Lwmark_pl)
- Tx_mac_wa <=1;
-
-//******************************************************************************
-//rd data to from FF .
-//domain Clk_MAC
-//******************************************************************************
-reg[35:0] Dout_dl1;
-
-always @ (posedge Clk_MAC or posedge Reset)
- if (Reset)
- Dout_dl1 <=0;
- else
- Dout_dl1 <=Dout;
-
-always @ (Current_state_MAC or Next_state_MAC)
- if ((Current_state_MAC==MAC_idle||Current_state_MAC==MAC_byte0)&&Next_state_MAC==MAC_byte3)
- Dout_reg_en =1;
- else
- Dout_reg_en =0;
-
-always @ (posedge Clk_MAC or posedge Reset)
- if (Reset)
- Dout_reg <=0;
- else if (Dout_reg_en)
- Dout_reg <=Dout_dl1;
-
-assign {Dout_eop,Dout_err,Dout_BE,Dout_data}=Dout_reg;
-
-always @ (posedge Clk_MAC or posedge Reset)
- if (Reset)
- Current_state_MAC <=MAC_idle;
- else
- Current_state_MAC <=Next_state_MAC;
-
-always @ (Current_state_MAC or Fifo_rd or Dout_BE or Dout_eop or Fifo_rd_retry
- or Fifo_rd_finish or Empty or Fifo_rd or Fifo_eop)
- case (Current_state_MAC)
- MAC_idle:
- if (Empty&&Fifo_rd)
- Next_state_MAC=MAC_FF_Err;
- else if (Fifo_rd)
- Next_state_MAC=MAC_byte3;
- else
- Next_state_MAC=Current_state_MAC;
- MAC_byte3:
- if (Fifo_rd_retry)
- Next_state_MAC=MAC_retry;
- else if (Fifo_eop)
- Next_state_MAC=MAC_wait_finish;
- else if (Fifo_rd&&!Fifo_eop)
- Next_state_MAC=MAC_byte2;
- else
- Next_state_MAC=Current_state_MAC;
- MAC_byte2:
- if (Fifo_rd_retry)
- Next_state_MAC=MAC_retry;
- else if (Fifo_eop)
- Next_state_MAC=MAC_wait_finish;
- else if (Fifo_rd&&!Fifo_eop)
- Next_state_MAC=MAC_byte1;
- else
- Next_state_MAC=Current_state_MAC;
- MAC_byte1:
- if (Fifo_rd_retry)
- Next_state_MAC=MAC_retry;
- else if (Fifo_eop)
- Next_state_MAC=MAC_wait_finish;
- else if (Fifo_rd&&!Fifo_eop)
- Next_state_MAC=MAC_byte0;
- else
- Next_state_MAC=Current_state_MAC;
- MAC_byte0:
- if (Empty&&Fifo_rd&&!Fifo_eop)
- Next_state_MAC=MAC_FFEmpty;
- else if (Fifo_rd_retry)
- Next_state_MAC=MAC_retry;
- else if (Fifo_eop)
- Next_state_MAC=MAC_wait_finish;
- else if (Fifo_rd&&!Fifo_eop)
- Next_state_MAC=MAC_byte3;
- else
- Next_state_MAC=Current_state_MAC;
- MAC_retry:
- Next_state_MAC=MAC_idle;
- MAC_wait_finish:
- if (Fifo_rd_finish)
- Next_state_MAC=MAC_pkt_sub;
- else
- Next_state_MAC=Current_state_MAC;
- MAC_pkt_sub:
- Next_state_MAC=MAC_idle;
- MAC_FFEmpty:
- if (!Empty)
- Next_state_MAC=MAC_byte3;
- else
- Next_state_MAC=Current_state_MAC;
- MAC_FF_Err: //stopped state-machine need change
- Next_state_MAC=Current_state_MAC;
- default
- Next_state_MAC=MAC_idle;
- endcase
-//
-always @ (posedge Reset or posedge Clk_MAC)
- if (Reset)
- Add_rd_gray <=0;
- else
- begin : Add_rd_gray_loop
- integer i;
- Add_rd_gray[TX_FF_DEPTH-1] <=Add_rd[TX_FF_DEPTH-1];
- for (i=TX_FF_DEPTH-2;i>=0;i=i-1)
- Add_rd_gray[i] <= Add_rd[i+1]^Add_rd[i];
- end
-//
-
-always @ (posedge Clk_MAC or posedge Reset)
- if (Reset)
- Add_wr_gray_dl1 <=0;
- else
- Add_wr_gray_dl1 <=Add_wr_gray;
-
-always @ (posedge Clk_MAC or posedge Reset)
- if (Reset)
- Add_wr_gray_dl2 <=0;
- else
- Add_wr_gray_dl2 <=Add_wr_gray_dl1;
-
-always @ (posedge Clk_MAC or posedge Reset)
- if (Reset)
- Add_wr_ungray =0;
- else
- begin : Add_wr_ungray_loop
- integer i;
- Add_wr_ungray[TX_FF_DEPTH-1] = Add_wr_gray_dl2[TX_FF_DEPTH-1];
- for (i=TX_FF_DEPTH-2;i>=0;i=i-1)
- Add_wr_ungray[i] = Add_wr_ungray[i+1]^Add_wr_gray_dl2[i];
- end
-
-//empty
-always @ (posedge Clk_MAC or posedge Reset)
- if (Reset)
- Empty <=1;
- else if (Add_rd==Add_wr_ungray)
- Empty <=1;
- else
- Empty <=0;
-
-//ra
-always @ (posedge Clk_MAC or posedge Reset)
- if (Reset)
- Fifo_ra <=0;
- else
- Fifo_ra <=Fifo_ra_tmp;
-
-
-
-always @ (posedge Clk_MAC or posedge Reset)
- if (Reset)
- Pkt_sub_apply_tmp <=0;
- else if (Current_state_MAC==MAC_pkt_sub)
- Pkt_sub_apply_tmp <=1;
- else
- Pkt_sub_apply_tmp <=0;
-
-always @ (posedge Clk_MAC or posedge Reset)
- if (Reset)
- Pkt_sub_apply <=0;
- else if ((Current_state_MAC==MAC_pkt_sub)||Pkt_sub_apply_tmp)
- Pkt_sub_apply <=1;
- else
- Pkt_sub_apply <=0;
-
-//reg Add_rd for collison retry
-always @ (posedge Clk_MAC or posedge Reset)
- if (Reset)
- Add_rd_reg <=0;
- else if (Fifo_rd_finish)
- Add_rd_reg <=Add_rd;
-
-always @ (posedge Clk_MAC or posedge Reset)
- if (Reset)
- Add_rd_reg_rdy_tmp <=0;
- else if (Fifo_rd_finish)
- Add_rd_reg_rdy_tmp <=1;
- else
- Add_rd_reg_rdy_tmp <=0;
-
-always @ (posedge Clk_MAC or posedge Reset)
- if (Reset)
- Add_rd_reg_rdy <=0;
- else if (Fifo_rd_finish||Add_rd_reg_rdy_tmp)
- Add_rd_reg_rdy <=1;
- else
- Add_rd_reg_rdy <=0;
-
-
-always @ (Current_state_MAC or Next_state_MAC)
- if ((Current_state_MAC==MAC_idle||Current_state_MAC==MAC_byte0)&&Next_state_MAC==MAC_byte3)
- Add_rd_add =1;
- else
- Add_rd_add =0;
-
-
-always @ (posedge Clk_MAC or posedge Reset)
- if (Reset)
- Add_rd <=0;
- else if (Current_state_MAC==MAC_retry)
- Add_rd <= Add_rd_reg;
- else if (Add_rd_add)
- Add_rd <= Add_rd + 1;
-
-always @ (posedge Clk_MAC or posedge Reset)
- if (Reset)
- Add_rd_jump_tmp <=0;
- else if (Current_state_MAC==MAC_retry)
- Add_rd_jump_tmp <=1;
- else
- Add_rd_jump_tmp <=0;
-
-always @ (posedge Clk_MAC or posedge Reset)
- if (Reset)
- Add_rd_jump_tmp_pl1 <=0;
- else
- Add_rd_jump_tmp_pl1 <=Add_rd_jump_tmp;
-
-always @ (posedge Clk_MAC or posedge Reset)
- if (Reset)
- Add_rd_jump <=0;
- else if (Current_state_MAC==MAC_retry)
- Add_rd_jump <=1;
- else if (Add_rd_jump_tmp_pl1)
- Add_rd_jump <=0;
-
-//gen Fifo_data
-
-
-always @ (Dout_data or Current_state_MAC)
- case (Current_state_MAC)
- MAC_byte3:
- Fifo_data =Dout_data[31:24];
- MAC_byte2:
- Fifo_data =Dout_data[23:16];
- MAC_byte1:
- Fifo_data =Dout_data[15:8];
- MAC_byte0:
- Fifo_data =Dout_data[7:0];
- default:
- Fifo_data =0;
- endcase
-
-always @ (posedge Clk_MAC or posedge Reset)
- if (Reset)
- Fifo_da <=0;
- else if ((Current_state_MAC==MAC_byte0||Current_state_MAC==MAC_byte1||
- Current_state_MAC==MAC_byte2||Current_state_MAC==MAC_byte3)&&Fifo_rd&&!Fifo_eop)
- Fifo_da <=1;
- else
- Fifo_da <=0;
-
-//gen Fifo_data_err_empty
-assign Fifo_data_err_full=Dout_err;
-//gen Fifo_data_err_empty
-always @ (posedge Clk_MAC or posedge Reset)
- if (Reset)
- Current_state_MAC_reg <=0;
- else
- Current_state_MAC_reg <=Current_state_MAC;
-
-always @ (posedge Clk_MAC or posedge Reset)
- if (Reset)
- Fifo_data_err_empty <=0;
- else if (Current_state_MAC_reg==MAC_FFEmpty)
- Fifo_data_err_empty <=1;
- else
- Fifo_data_err_empty <=0;
-
-//always @ (posedge Clk_MAC)
-// if (Current_state_MAC_reg==MAC_FF_Err)
-// begin
-// $finish(2);
-// $display("mac_tx_FF meet error status at time :%t",$time);
-// end
-
-//gen Fifo_eop aligned to last valid data byte
-always @ ( Current_state_MAC or Dout_eop or Dout_BE )
- if ( ( ( Current_state_MAC==MAC_byte0 && Dout_BE==2'b00 ) ||
- ( Current_state_MAC==MAC_byte1 && Dout_BE==2'b11 ) ||
- ( Current_state_MAC==MAC_byte2 && Dout_BE==2'b10 ) ||
- ( Current_state_MAC==MAC_byte3 && Dout_BE==2'b01 ) ) && Dout_eop )
- Fifo_eop = 1;
- else
- Fifo_eop = 0;
-
- // Dual port RAM for FIFO
- ram_2port #(.DWIDTH(36),.AWIDTH(TX_FF_DEPTH)) mac_tx_ff_ram
- (.clka(Clk_SYS),.ena(1'b1),.wea(Wr_en),.addra(Add_wr),.dia(Din),.doa(),
- .clkb(Clk_MAC),.enb(1'b1),.web(1'b0),.addrb(Add_rd),.dib(36'b0),.dob(Dout) );
-
- assign debug0 =
- { { 5'd0, Empty, Full, AlmostFull },
- { Current_state_SYS, Current_state_MAC },
- { Fifo_rd, Fifo_rd_finish, Fifo_rd_retry, Fifo_eop, Fifo_da, Fifo_ra, Fifo_data_err_empty, Fifo_data_err_full },
- { 2'b0, Dout_BE, Tx_mac_wa, Tx_mac_wr, Tx_mac_sop, Tx_mac_eop} };
-
- assign debug1 =
- { { 8'd0 },
- { 8'd0 },
- { 8'd0 },
- { 8'd0 } };
-
-endmodule // MAC_tx_FF
diff --git a/eth/rtl/verilog/MAC_tx/MAC_tx_addr_add.v b/eth/rtl/verilog/MAC_tx/MAC_tx_addr_add.v deleted file mode 100644 index 76026ce06..000000000 --- a/eth/rtl/verilog/MAC_tx/MAC_tx_addr_add.v +++ /dev/null @@ -1,128 +0,0 @@ -// ////////////////////////////////////////////////////////////////////
-// // ////
-// // MAC_tx_addr_add.v ////
-// // ////
-// // This file is part of the Ethernet IP core project ////
-// // http://www.opencores.org/projects.cgi/wr_en/ethernet_tri_mode/////
-// // ////
-// // Author(s): ////
-// // - Jon Gao (gaojon@yahoo.com) ////
-// // ////
-// // ////
-// ////////////////////////////////////////////////////////////////////
-// // ////
-// // Copyright (C) 2001 Authors ////
-// // ////
-// // This source file may be used and distributed without ////
-// // restriction provided that this copyright statement is not ////
-// // removed from the file and that any derivative work contains ////
-// // the original copyright notice and the associated disclaimer. ////
-// // ////
-// // This source file is free software; you can redistribute it ////
-// // and/or modify it under the terms of the GNU Lesser General ////
-// // Public License as published by the Free Software Foundation; ////
-// // either version 2.1 of the License, or (at your option) any ////
-// // later version. ////
-// // ////
-// // This source is distributed in the hope that it will be ////
-// // useful, but WITHOUT ANY WARRANTY; without even the implied ////
-// // warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-// // PURPOSE. See the GNU Lesser General Public License for more ////
-// // details. ////
-// // ////
-// // You should have received a copy of the GNU Lesser General ////
-// // Public License along with this source; if not, download it ////
-// // from http://www.opencores.org/lgpl.shtml ////
-// // ////
-// ////////////////////////////////////////////////////////////////////
-//
-// CVS Revision History
-//
-// $Log: MAC_tx_addr_add.v,v $
-// Revision 1.3 2006/01/19 14:07:54 maverickist
-// verification is complete.
-//
-// Revision 1.2 2005/12/16 06:44:18 Administrator
-// replaced tab with space.
-// passed 9.6k length frame test.
-//
-// Revision 1.1.1.1 2005/12/13 01:51:45 Administrator
-// no message
-//
-
-module MAC_tx_addr_add
- (Reset ,
- Clk ,
- MAC_tx_addr_init ,
- MAC_tx_addr_rd ,
- MAC_tx_addr_data ,
- //CPU ,
- MAC_add_prom_data ,
- MAC_add_prom_add ,
- MAC_add_prom_wr
- );
-
- input Reset ;
- input Clk ;
- input MAC_tx_addr_rd ;
- input MAC_tx_addr_init ;
- output [7:0] MAC_tx_addr_data ;
- //CPU ;
- input [7:0] MAC_add_prom_data ;
- input [2:0] MAC_add_prom_add ;
- input MAC_add_prom_wr ;
-
- // ******************************************************************************
- // internal signals
- // ******************************************************************************
- reg [2:0] add_rd;
- wire [2:0] add_wr;
- wire [7:0] din;
- //wire [7:0] dout;
- reg [7:0] dout;
- wire wr_en;
- reg MAC_add_prom_wr_dl1;
- reg MAC_add_prom_wr_dl2;
- // ******************************************************************************
- // write data from cpu to prom
- // ******************************************************************************
- always @ (posedge Clk or posedge Reset)
- if (Reset)
- begin
- MAC_add_prom_wr_dl1 <=0;
- MAC_add_prom_wr_dl2 <=0;
- end
- else
- begin
- MAC_add_prom_wr_dl1 <=MAC_add_prom_wr;
- MAC_add_prom_wr_dl2 <=MAC_add_prom_wr_dl1;
- end
-
- assign wr_en =MAC_add_prom_wr_dl1&!MAC_add_prom_wr_dl2;
- assign add_wr =MAC_add_prom_add;
- assign din =MAC_add_prom_data;
-
- // ******************************************************************************
- // read data from cpu to prom
- // ******************************************************************************
- always @ (posedge Clk or posedge Reset)
- if (Reset)
- add_rd <=0;
- else if (MAC_tx_addr_init)
- add_rd <=0;
- else if (MAC_tx_addr_rd)
- add_rd <=add_rd + 1;
- assign MAC_tx_addr_data=dout;
- // ******************************************************************************
- // b port for read ,a port for write .
- // ******************************************************************************
-
- reg [7:0] address_ram [0:7];
- always @(posedge Clk)
- if(wr_en)
- address_ram[add_wr] <= din;
-
- always @(posedge Clk)
- dout <= address_ram[add_rd];
-
-endmodule // MAC_tx_addr_add
diff --git a/eth/rtl/verilog/MAC_tx/MAC_tx_ctrl.v b/eth/rtl/verilog/MAC_tx/MAC_tx_ctrl.v deleted file mode 100644 index 8da2e253c..000000000 --- a/eth/rtl/verilog/MAC_tx/MAC_tx_ctrl.v +++ /dev/null @@ -1,656 +0,0 @@ -//////////////////////////////////////////////////////////////////////
-//// ////
-//// MAC_tx_ctrl.v ////
-//// ////
-//// This file is part of the Ethernet IP core project ////
-//// http://www.opencores.org/projects.cgi/web/ethernet_tri_mode/////
-//// ////
-//// Author(s): ////
-//// - Jon Gao (gaojon@yahoo.com) ////
-//// ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// Copyright (C) 2001 Authors ////
-//// ////
-//// This source file may be used and distributed without ////
-//// restriction provided that this copyright statement is not ////
-//// removed from the file and that any derivative work contains ////
-//// the original copyright notice and the associated disclaimer. ////
-//// ////
-//// This source file is free software; you can redistribute it ////
-//// and/or modify it under the terms of the GNU Lesser General ////
-//// Public License as published by the Free Software Foundation; ////
-//// either version 2.1 of the License, or (at your option) any ////
-//// later version. ////
-//// ////
-//// This source is distributed in the hope that it will be ////
-//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
-//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-//// PURPOSE. See the GNU Lesser General Public License for more ////
-//// details. ////
-//// ////
-//// You should have received a copy of the GNU Lesser General ////
-//// Public License along with this source; if not, download it ////
-//// from http://www.opencores.org/lgpl.shtml ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//
-// CVS Revision History
-//
-// $Log: MAC_tx_Ctrl.v,v $
-// Revision 1.4 2006/06/25 04:58:56 maverickist
-// no message
-//
-// Revision 1.3 2006/01/19 14:07:54 maverickist
-// verification is complete.
-//
-// Revision 1.3 2005/12/16 06:44:17 Administrator
-// replaced tab with space.
-// passed 9.6k length frame test.
-//
-// Revision 1.2 2005/12/13 12:15:38 Administrator
-// no message
-//
-// Revision 1.1.1.1 2005/12/13 01:51:45 Administrator
-// no message
-//
-
-module MAC_tx_ctrl (
-Reset ,
-Clk ,
-//CRC_gen Interface
-CRC_init ,
-Frame_data ,
-Data_en ,
-CRC_rd ,
-CRC_end ,
-CRC_out ,
-//Ramdon_gen interfac
-Random_init ,
-RetryCnt ,
-Random_time_meet ,
-//flow control
-pause_apply ,
-pause_quanta_sub ,
-xoff_gen ,
-xoff_gen_complete ,
-xon_gen ,
-xon_gen_complete ,
-//MAC_tx_FF
-Fifo_data ,
-Fifo_rd ,
-Fifo_eop ,
-Fifo_da ,
-Fifo_rd_finish ,
-Fifo_rd_retry ,
-Fifo_ra ,
-Fifo_data_err_empty ,
-Fifo_data_err_full ,
-//RMII
-TxD ,
-TxEn ,
-CRS ,
-//MAC_tx_addr_add
-MAC_tx_addr_rd ,
-MAC_tx_addr_data ,
-MAC_tx_addr_init ,
-//RMON
-Tx_pkt_type_rmon ,
-Tx_pkt_length_rmon ,
-Tx_apply_rmon ,
-Tx_pkt_err_type_rmon,
-//CPU
-pause_quanta_set ,
-MAC_tx_add_en ,
-FullDuplex ,
-MaxRetry ,
-IFGset
-);
-
-input Reset ;
-input Clk ;
- //CRC_gen Interface
-output CRC_init ;
-output [7:0] Frame_data ;
-output Data_en ;
-output CRC_rd ;
-input CRC_end ;
-input [7:0] CRC_out ;
- //Ramdon_gen interface
-output Random_init ;
-output [3:0] RetryCnt ;
-input Random_time_meet ;//levle hight indicate random time passed away
- //flow control
-input pause_apply ;
-output pause_quanta_sub ;
-input xoff_gen ;
-output xoff_gen_complete ;
-input xon_gen ;
-output xon_gen_complete ;
- //MAC_rx_FF
-input [7:0] Fifo_data ;
-output Fifo_rd ;
-input Fifo_eop ;
-input Fifo_da ;
-output Fifo_rd_finish ;
-output Fifo_rd_retry ;
-input Fifo_ra ;
-input Fifo_data_err_empty ;
-input Fifo_data_err_full ;
- //RMII
-output [7:0] TxD ;
-output TxEn ;
-input CRS ;
- //MAC_tx_addr_add
-output MAC_tx_addr_init ;
-output MAC_tx_addr_rd ;
-input [7:0] MAC_tx_addr_data ;
- //RMON
-output [2:0] Tx_pkt_type_rmon ;
-output [15:0] Tx_pkt_length_rmon ;
-output Tx_apply_rmon ;
-output [2:0] Tx_pkt_err_type_rmon;
- //CPU
-input [15:0] pause_quanta_set ;
-input MAC_tx_add_en ;
-input FullDuplex ;
-input [3:0] MaxRetry ;
-input [5:0] IFGset ;
-//******************************************************************************
-//internal signals
-//******************************************************************************
-parameter StateIdle =4'd00;
-parameter StatePreamble =4'd01;
-parameter StateSFD =4'd02;
-parameter StateData =4'd03;
-parameter StatePause =4'd04;
-parameter StatePAD =4'd05;
-parameter StateFCS =4'd06;
-parameter StateIFG =4'd07;
-parameter StateJam =4'd08;
-parameter StateBackOff =4'd09;
-parameter StateJamDrop =4'd10;
-parameter StateFFEmptyDrop =4'd11;
-parameter StateSwitchNext =4'd12;
-parameter StateDefer =4'd13;
-parameter StateSendPauseFrame =4'd14;
-
-reg [3:0] Current_state;
-reg [3:0] Next_state;
-reg [5:0] IFG_counter;
-reg [4:0] Preamble_counter;//
-reg [7:0] TxD_tmp ;
-reg TxEn_tmp ;
-reg [15:0] Tx_pkt_length_rmon ;
-reg Tx_apply_rmon ;
-reg [2:0] Tx_pkt_err_type_rmon;
-reg [3:0] RetryCnt ;
-reg Random_init ;
-reg Fifo_rd_finish ;
-reg Fifo_rd_retry ;
-reg [7:0] TxD ;
-reg TxEn ;
-reg CRC_init ;
-reg Data_en ;
-reg CRC_rd ;
-reg Fifo_rd ;
-reg MAC_tx_addr_rd ;
-reg MAC_header_slot ;
-reg MAC_header_slot_tmp ;
-reg [2:0] Tx_pkt_type_rmon ;
-wire Collision ;
-reg MAC_tx_addr_init ;
-reg Src_MAC_ptr ;
-reg [7:0] IPLengthCounter ;//for pad append
-reg [1:0] PADCounter ;
-reg [7:0] JamCounter ;
-reg PktDrpEvenPtr ;
-reg [7:0] pause_counter ;
-reg pause_quanta_sub ;
-reg [15:0] pause_quanta_set_dl1 ;
-reg xoff_gen_complete ;
-reg xon_gen_complete ;
-//******************************************************************************
-//boundery signal processing
-//******************************************************************************
-always @(posedge Clk or posedge Reset)
- if (Reset)
- begin
- pause_quanta_set_dl1 <=0;
- end
- else
- begin
- pause_quanta_set_dl1 <=pause_quanta_set ;
- end
-//******************************************************************************
-//state machine
-//******************************************************************************
-assign Collision=TxEn&CRS;
-
-always @(posedge Clk or posedge Reset)
- if (Reset)
- IPLengthCounter <=0;
- else if (Current_state==StateDefer)
- IPLengthCounter <=0;
- else if (IPLengthCounter!=8'hff&&(Current_state==StateData||Current_state==StateSendPauseFrame||Current_state==StatePAD))
- IPLengthCounter <=IPLengthCounter+1;
-
-always @(posedge Clk or posedge Reset)
- if (Reset)
- PADCounter <=0;
- else if (Current_state!=StatePAD)
- PADCounter <=0;
- else
- PADCounter <=PADCounter+1;
-
-always @(posedge Clk or posedge Reset)
- if (Reset)
- Current_state <=StateDefer;
- else
- Current_state <=Next_state;
-
-always @ (*)
- case (Current_state)
- StateDefer:
- if ((FullDuplex)||(!FullDuplex&&!CRS))
- Next_state=StateIFG;
- else
- Next_state=Current_state;
- StateIFG:
- if (!FullDuplex&&CRS)
- Next_state=StateDefer;
- else if ((FullDuplex&&IFG_counter==IFGset-4)||(!FullDuplex&&!CRS&&IFG_counter==IFGset-4))//remove some additional time
- Next_state=StateIdle;
- else
- Next_state=Current_state;
- StateIdle:
- if (!FullDuplex&&CRS)
- Next_state=StateDefer;
- else if (xoff_gen||xon_gen)
- Next_state=StatePreamble;
- else if (pause_apply)
- Next_state=StatePause;
- else if ((FullDuplex||~CRS)&&Fifo_ra)
- Next_state=StatePreamble;
- else
- Next_state=Current_state;
- StatePause:
- if (pause_counter==512/8)
- Next_state=StateDefer;
- else if (xoff_gen||xon_gen)
- Next_state=StateIdle;
- else
- Next_state=Current_state;
- StatePreamble:
- if (!FullDuplex&&Collision)
- Next_state=StateJam;
- else if ((FullDuplex&&Preamble_counter==6)||(!FullDuplex&&!Collision&&Preamble_counter==6))
- Next_state=StateSFD;
- else
- Next_state=Current_state;
- StateSFD:
- if (!FullDuplex&&Collision)
- Next_state=StateJam;
- else if (xoff_gen||xon_gen)
- Next_state=StateSendPauseFrame;
- else
- Next_state=StateData;
- StateSendPauseFrame:
- if (IPLengthCounter==17)
- Next_state=StatePAD;
- else
- Next_state=Current_state;
- StateData:
- if (!FullDuplex&&Collision)
- Next_state=StateJam;
- else if (Fifo_data_err_empty)
- Next_state=StateFFEmptyDrop;
- else if (Fifo_eop&&IPLengthCounter>=59)//IP+MAC+TYPE=60 ,start from 0
- Next_state=StateFCS;
- else if (Fifo_eop)
- Next_state=StatePAD;
- else
- Next_state=StateData;
- StatePAD:
- if (!FullDuplex&&Collision)
- Next_state=StateJam;
- else if (IPLengthCounter>=59)
- Next_state=StateFCS;
- else
- Next_state=Current_state;
- StateJam:
- if (RetryCnt<=MaxRetry&&JamCounter==16)
- Next_state=StateBackOff;
- else if (RetryCnt>MaxRetry)
- Next_state=StateJamDrop;
- else
- Next_state=Current_state;
- StateBackOff:
- if (Random_time_meet)
- Next_state =StateDefer;
- else
- Next_state =Current_state;
- StateFCS:
- if (!FullDuplex&&Collision)
- Next_state =StateJam;
- else if (CRC_end)
- Next_state =StateSwitchNext;
- else
- Next_state =Current_state;
- StateFFEmptyDrop:
- if (Fifo_eop)
- Next_state =StateSwitchNext;
- else
- Next_state =Current_state;
- StateJamDrop:
- if (Fifo_eop)
- Next_state =StateSwitchNext;
- else
- Next_state =Current_state;
- StateSwitchNext:
- Next_state =StateDefer;
- default:
- Next_state =StateDefer;
- endcase
-
-
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- JamCounter <=0;
- else if (Current_state!=StateJam)
- JamCounter <=0;
- else if (Current_state==StateJam)
- JamCounter <=JamCounter+1;
-
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- RetryCnt <=0;
- else if (Current_state==StateSwitchNext)
- RetryCnt <=0;
- else if (Current_state==StateJam&&Next_state==StateBackOff)
- RetryCnt <=RetryCnt + 1;
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- IFG_counter <=0;
- else if (Current_state!=StateIFG)
- IFG_counter <=0;
- else
- IFG_counter <=IFG_counter + 1;
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- Preamble_counter <=0;
- else if (Current_state!=StatePreamble)
- Preamble_counter <=0;
- else
- Preamble_counter <=Preamble_counter+ 1;
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- PktDrpEvenPtr <=0;
- else if(Current_state==StateJamDrop||Current_state==StateFFEmptyDrop)
- PktDrpEvenPtr <=~PktDrpEvenPtr;
-//******************************************************************************
-//generate output signals
-//******************************************************************************
-//CRC related
-always @(Current_state)
- if (Current_state==StateSFD)
- CRC_init =1;
- else
- CRC_init =0;
-
-assign Frame_data=TxD_tmp;
-
-always @(Current_state)
- if (Current_state==StateData||Current_state==StateSendPauseFrame||Current_state==StatePAD)
- Data_en =1;
- else
- Data_en =0;
-
-always @(Current_state)
- if (Current_state==StateFCS)
- CRC_rd =1;
- else
- CRC_rd =0;
-
-//Ramdon_gen interface
-always @(Current_state or Next_state)
- if (Current_state==StateJam&&Next_state==StateBackOff)
- Random_init =1;
- else
- Random_init =0;
-
-//MAC_rx_FF
-//data have one cycle delay after fifo read signals
-always @ (*)
- if (Current_state==StateData ||
- Current_state==StateSFD&&!(xoff_gen||xon_gen) ||
- Current_state==StateJamDrop&&PktDrpEvenPtr||
- Current_state==StateFFEmptyDrop&&PktDrpEvenPtr )
- Fifo_rd =1;
- else
- Fifo_rd =0;
-
-always @ (Current_state)
- if (Current_state==StateSwitchNext)
- Fifo_rd_finish =1;
- else
- Fifo_rd_finish =0;
-
-always @ (Current_state)
- if (Current_state==StateJam)
- Fifo_rd_retry =1;
- else
- Fifo_rd_retry =0;
-//RMII
-always @(Current_state)
- if (Current_state==StatePreamble||Current_state==StateSFD||
- Current_state==StateData||Current_state==StateSendPauseFrame||
- Current_state==StateFCS||Current_state==StatePAD||Current_state==StateJam)
- TxEn_tmp =1;
- else
- TxEn_tmp =0;
-
-//gen txd data
-always @(*)
- case (Current_state)
- StatePreamble:
- TxD_tmp =8'h55;
- StateSFD:
- TxD_tmp =8'hd5;
- StateData:
- if (Src_MAC_ptr&&MAC_tx_add_en)
- TxD_tmp =MAC_tx_addr_data;
- else
- TxD_tmp =Fifo_data;
- StateSendPauseFrame:
- if (Src_MAC_ptr&&MAC_tx_add_en)
- TxD_tmp =MAC_tx_addr_data;
- else
- case (IPLengthCounter)
- 8'd0: TxD_tmp =8'h01;
- 8'd1: TxD_tmp =8'h80;
- 8'd2: TxD_tmp =8'hc2;
- 8'd3: TxD_tmp =8'h00;
- 8'd4: TxD_tmp =8'h00;
- 8'd5: TxD_tmp =8'h01;
- 8'd12: TxD_tmp =8'h88;//type
- 8'd13: TxD_tmp =8'h08;//
- 8'd14: TxD_tmp =8'h00;//opcode
- 8'd15: TxD_tmp =8'h01;
- 8'd16: TxD_tmp =xon_gen?8'b0:pause_quanta_set_dl1[15:8];
- 8'd17: TxD_tmp =xon_gen?8'b0:pause_quanta_set_dl1[7:0];
-// 8'd60: TxD_tmp =8'h26;
-// 8'd61: TxD_tmp =8'h6b;
-// 8'd62: TxD_tmp =8'hae;
-// 8'd63: TxD_tmp =8'h0a;
- default:TxD_tmp =0;
- endcase
-
- StatePAD:
- TxD_tmp =8'h00;
- StateJam:
- TxD_tmp =8'h01; //jam sequence
- StateFCS:
- TxD_tmp =CRC_out;
- default:
- TxD_tmp =2'b0;
- endcase
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- begin
- TxD <=0;
- TxEn <=0;
- end
- else
- begin
- TxD <=TxD_tmp;
- TxEn <=TxEn_tmp;
- end
-//RMON
-
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- Tx_pkt_length_rmon <=0;
- else if (Current_state==StateSFD)
- Tx_pkt_length_rmon <=0;
- else if (Current_state==StateData||Current_state==StateSendPauseFrame||Current_state==StatePAD||Current_state==StateFCS)
- Tx_pkt_length_rmon <=Tx_pkt_length_rmon+1;
-
-
-reg [2:0] Tx_apply_rmon_reg;
-
-always @( posedge Clk or posedge Reset )
- if ( Reset )
- begin
- Tx_apply_rmon <= 0;
- Tx_apply_rmon_reg <= 'b0;
- end
- else
- begin
- if ( (Fifo_eop&&Current_state==StateJamDrop) ||
- (Fifo_eop&&Current_state==StateFFEmptyDrop) ||
- CRC_end )
- Tx_apply_rmon <= 1;
- else
- if ( Tx_apply_rmon_reg[2] )
- Tx_apply_rmon <= 0;
-
- Tx_apply_rmon_reg <= { Tx_apply_rmon_reg[1:0], Tx_apply_rmon };
- end
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- Tx_pkt_err_type_rmon <=0;
- else if(Fifo_eop&&Current_state==StateJamDrop)
- Tx_pkt_err_type_rmon <=3'b001;//
- else if(Fifo_eop&&Current_state==StateFFEmptyDrop)
- Tx_pkt_err_type_rmon <=3'b010;//underflow
- else if(Fifo_eop&&Fifo_data_err_full)
- Tx_pkt_err_type_rmon <=3'b011;//overflow
- else if(CRC_end)
- Tx_pkt_err_type_rmon <=3'b100;//normal
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- MAC_header_slot_tmp <=0;
- else if(Current_state==StateSFD&&Next_state==StateData)
- MAC_header_slot_tmp <=1;
- else
- MAC_header_slot_tmp <=0;
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- MAC_header_slot <=0;
- else
- MAC_header_slot <=MAC_header_slot_tmp;
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- Tx_pkt_type_rmon <=0;
- else if (Current_state==StateSendPauseFrame)
- Tx_pkt_type_rmon <=3'b100;
- else if(MAC_header_slot)
- Tx_pkt_type_rmon <={1'b0,TxD[7:6]};
-
-
-always @(Tx_pkt_length_rmon)
- if (Tx_pkt_length_rmon>=6&&Tx_pkt_length_rmon<=11)
- Src_MAC_ptr =1;
- else
- Src_MAC_ptr =0;
-
-//MAC_tx_addr_add
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- MAC_tx_addr_rd <=0;
- else if ((Tx_pkt_length_rmon>=4&&Tx_pkt_length_rmon<=9)&&(MAC_tx_add_en||Current_state==StateSendPauseFrame))
- MAC_tx_addr_rd <=1;
- else
- MAC_tx_addr_rd <=0;
-
- always @*
- //if ((Tx_pkt_length_rmon==3)&&Fifo_rd)
- if (Current_state==StatePreamble)
- MAC_tx_addr_init=1;
- else
- MAC_tx_addr_init=0;
-
-//**************************************************************************************************************
-// CFH: this implementation delays the time it sends an entire Ethernet frame with 512 bits for every pause
-// request of 512 bits. Actually, it should only delay the time it takes to transmit 512 bits, not counting
-// Ethernet header, CRC, Interframe Gap etc.
-// Hence the current implementation waits longer than the pause frame actually requests (~20% more)
-//**************************************************************************************************************
-
-//flow control
-always @(posedge Clk or posedge Reset)
- if (Reset)
- pause_counter <=0;
- else if (Current_state!=StatePause)
- pause_counter <=0;
- else
- pause_counter <=pause_counter+1;
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- pause_quanta_sub <=0;
- else if(pause_counter==512/8)
- pause_quanta_sub <=1;
- else
- pause_quanta_sub <=0;
-
-// FIXME The below probably won't work if the pause request comes when we are in the wrong state
- reg clear_xonxoff;
- always @(posedge Clk or posedge Reset)
- if(Reset)
- clear_xonxoff <= 0;
- else if((Current_state==StateSendPauseFrame) & (IPLengthCounter==17))
- clear_xonxoff <= 1;
- else if(~xon_gen & ~xoff_gen)
- clear_xonxoff <= 0;
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- xoff_gen_complete <=0;
- else if(clear_xonxoff & xoff_gen)
- xoff_gen_complete <=1;
- else
- xoff_gen_complete <=0;
-
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- xon_gen_complete <=0;
- else if(clear_xonxoff & xon_gen)
- xon_gen_complete <=1;
- else
- xon_gen_complete <=0;
-
-endmodule
diff --git a/eth/rtl/verilog/MAC_tx/Random_gen.v b/eth/rtl/verilog/MAC_tx/Random_gen.v deleted file mode 100644 index fd57008b1..000000000 --- a/eth/rtl/verilog/MAC_tx/Random_gen.v +++ /dev/null @@ -1,109 +0,0 @@ -//////////////////////////////////////////////////////////////////////
-//// ////
-//// Random_gen.v ////
-//// ////
-//// This file is part of the Ethernet IP core project ////
-//// http://www.opencores.org/projects.cgi/web/ethernet_tri_mode/////
-//// ////
-//// Author(s): ////
-//// - Jon Gao (gaojon@yahoo.com) ////
-//// ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// Copyright (C) 2001 Authors ////
-//// ////
-//// This source file may be used and distributed without ////
-//// restriction provided that this copyright statement is not ////
-//// removed from the file and that any derivative work contains ////
-//// the original copyright notice and the associated disclaimer. ////
-//// ////
-//// This source file is free software; you can redistribute it ////
-//// and/or modify it under the terms of the GNU Lesser General ////
-//// Public License as published by the Free Software Foundation; ////
-//// either version 2.1 of the License, or (at your option) any ////
-//// later version. ////
-//// ////
-//// This source is distributed in the hope that it will be ////
-//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
-//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-//// PURPOSE. See the GNU Lesser General Public License for more ////
-//// details. ////
-//// ////
-//// You should have received a copy of the GNU Lesser General ////
-//// Public License along with this source; if not, download it ////
-//// from http://www.opencores.org/lgpl.shtml ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-
-module Random_gen(
-Reset ,
-Clk ,
-Init ,
-RetryCnt ,
-Random_time_meet
-);
-input Reset ;
-input Clk ;
-input Init ;
-input [3:0] RetryCnt ;
-output Random_time_meet;
-
-//******************************************************************************
-//internal signals
-//******************************************************************************
-reg [9:0] Random_sequence ;
-reg [9:0] Random ;
-reg [9:0] Random_counter ;
-reg [7:0] Slot_time_counter; //256*2=512bit=1 slot time
-reg Random_time_meet;
-
-//******************************************************************************
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- Random_sequence <=0;
- else
- Random_sequence <={Random_sequence[8:0],~(Random_sequence[2]^Random_sequence[9])};
-
-always @ (RetryCnt or Random_sequence)
- case (RetryCnt)
- 4'h0 : Random={9'b0,Random_sequence[0]};
- 4'h1 : Random={8'b0,Random_sequence[1:0]};
- 4'h2 : Random={7'b0,Random_sequence[2:0]};
- 4'h3 : Random={6'b0,Random_sequence[3:0]};
- 4'h4 : Random={5'b0,Random_sequence[4:0]};
- 4'h5 : Random={4'b0,Random_sequence[5:0]};
- 4'h6 : Random={3'b0,Random_sequence[6:0]};
- 4'h7 : Random={2'b0,Random_sequence[7:0]};
- 4'h8 : Random={1'b0,Random_sequence[8:0]};
- 4'h9 : Random={ Random_sequence[9:0]};
- default : Random={ Random_sequence[9:0]};
- endcase
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- Slot_time_counter <=0;
- else if(Init)
- Slot_time_counter <=0;
- else if(!Random_time_meet)
- Slot_time_counter <=Slot_time_counter+1;
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- Random_counter <=0;
- else if (Init)
- Random_counter <=Random;
- else if (Random_counter!=0&&Slot_time_counter==255)
- Random_counter <=Random_counter -1 ;
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- Random_time_meet <=1;
- else if (Init)
- Random_time_meet <=0;
- else if (Random_counter==0)
- Random_time_meet <=1;
-
-endmodule
-
-
diff --git a/eth/rtl/verilog/Phy_int.v b/eth/rtl/verilog/Phy_int.v deleted file mode 100644 index c85d4f64b..000000000 --- a/eth/rtl/verilog/Phy_int.v +++ /dev/null @@ -1,205 +0,0 @@ -//////////////////////////////////////////////////////////////////////
-//// ////
-//// Phy_int.v ////
-//// ////
-//// This file is part of the Ethernet IP core project ////
-//// http://www.opencores.org/projects.cgi/web/ethernet_tri_mode/////
-//// ////
-//// Author(s): ////
-//// - Jon Gao (gaojon@yahoo.com) ////
-//// ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// Copyright (C) 2001 Authors ////
-//// ////
-//// This source file may be used and distributed without ////
-//// restriction provided that this copyright statement is not ////
-//// removed from the file and that any derivative work contains ////
-//// the original copyright notice and the associated disclaimer. ////
-//// ////
-//// This source file is free software; you can redistribute it ////
-//// and/or modify it under the terms of the GNU Lesser General ////
-//// Public License as published by the Free Software Foundation; ////
-//// either version 2.1 of the License, or (at your option) any ////
-//// later version. ////
-//// ////
-//// This source is distributed in the hope that it will be ////
-//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
-//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-//// PURPOSE. See the GNU Lesser General Public License for more ////
-//// details. ////
-//// ////
-//// You should have received a copy of the GNU Lesser General ////
-//// Public License along with this source; if not, download it ////
-//// from http://www.opencores.org/lgpl.shtml ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//
-// CVS Revision History
-//
-// $Log: Phy_int.v,v $
-// Revision 1.3 2006/01/19 14:07:53 maverickist
-// verification is complete.
-//
-// Revision 1.3 2005/12/16 06:44:14 Administrator
-// replaced tab with space.
-// passed 9.6k length frame test.
-//
-// Revision 1.2 2005/12/13 12:15:36 Administrator
-// no message
-//
-// Revision 1.1.1.1 2005/12/13 01:51:44 Administrator
-// no message
-//
-
-module Phy_int
- (input rst_mac_rx,
- input rst_mac_tx,
- input MAC_rx_clk,
- input MAC_tx_clk,
-
- // Rx interface
- output reg MCrs_dv,
- output reg [7:0] MRxD,
- output MRxErr,
-
- // Tx interface
- input [7:0] MTxD,
- input MTxEn,
- output MCRS,
-
- // PHY interface
- output Tx_er,
- output reg Tx_en,
- output reg [7:0] Txd,
- input Rx_er,
- input Rx_dv,
- input [7:0] Rxd,
- input Crs,
- input Col,
-
- // Host interface
- input Line_loop_en,
- input [2:0] Speed );
-
- //-------------------------------------------------------------------------
- // Local declarations
- //-------------------------------------------------------------------------
-
- reg [7:0] MTxD_dl1;
- reg MTxEn_dl1;
- reg Tx_odd_data_ptr;
- reg Rx_odd_data_ptr;
- reg Rx_er_dl1;
- reg Rx_dv_dl1;
- reg Rx_dv_dl2;
- reg [7:0] Rxd_dl1;
- reg [7:0] Rxd_dl2;
- reg Crs_dl1;
-
- //-------------------------------------------------------------------------
- // Tx control
- //-------------------------------------------------------------------------
-
- // Reg boundary signals
- always @( posedge MAC_tx_clk or posedge rst_mac_tx )
- if ( rst_mac_tx )
- begin
- MTxD_dl1 <= 0;
- MTxEn_dl1 <= 0;
- end
- else
- begin
- MTxD_dl1 <= MTxD;
- MTxEn_dl1 <= MTxEn;
- end
-
- always @( posedge MAC_tx_clk or posedge rst_mac_tx )
- if ( rst_mac_tx )
- Tx_odd_data_ptr <= 0;
- else if ( !MTxD_dl1 )
- Tx_odd_data_ptr <= 0;
- else
- Tx_odd_data_ptr <= !Tx_odd_data_ptr;
-
-
- always @( posedge MAC_tx_clk or posedge rst_mac_tx )
- if ( rst_mac_tx )
- Txd <= 0;
- else if ( Speed[2] && MTxEn_dl1 )
- Txd <= MTxD_dl1;
- else if ( MTxEn_dl1 && !Tx_odd_data_ptr )
- Txd <= { 4'b0, MTxD_dl1[3:0] };
- else if ( MTxEn_dl1 && Tx_odd_data_ptr )
- Txd <= { 4'b0, MTxD_dl1[7:4] };
- else
- Txd <=0;
-
- always @( posedge MAC_tx_clk or posedge rst_mac_tx )
- if ( rst_mac_tx )
- Tx_en <= 0;
- else if ( MTxEn_dl1 )
- Tx_en <= 1;
- else
- Tx_en <= 0;
-
- assign Tx_er = 0;
-
- //-------------------------------------------------------------------------
- // Rx control
- //-------------------------------------------------------------------------
-
- // Reg boundery signals
- always @( posedge MAC_rx_clk or posedge rst_mac_rx )
- if ( rst_mac_rx )
- begin
- Rx_er_dl1 <= 0;
- Rx_dv_dl1 <= 0;
- Rx_dv_dl2 <= 0;
- Rxd_dl1 <= 0;
- Rxd_dl2 <= 0;
- Crs_dl1 <= 0;
- end
- else
- begin
- Rx_er_dl1 <= Rx_er;
- Rx_dv_dl1 <= Rx_dv;
- Rx_dv_dl2 <= Rx_dv_dl1;
- Rxd_dl1 <= Rxd;
- Rxd_dl2 <= Rxd_dl1;
- Crs_dl1 <= Crs;
- end
-
- assign MRxErr = Rx_er_dl1;
- assign MCRS = Crs_dl1;
-
- always @( posedge MAC_rx_clk or posedge rst_mac_rx )
- if ( rst_mac_rx )
- MCrs_dv <= 0;
- else if ( Line_loop_en )
- MCrs_dv <= Tx_en;
- else if( Rx_dv_dl2 )
- MCrs_dv <= 1;
- else
- MCrs_dv <= 0;
-
- always @ ( posedge MAC_rx_clk or posedge rst_mac_rx )
- if ( rst_mac_rx )
- Rx_odd_data_ptr <= 0;
- else if ( !Rx_dv_dl1 )
- Rx_odd_data_ptr <= 0;
- else
- Rx_odd_data_ptr <= !Rx_odd_data_ptr;
-
- always @ ( posedge MAC_rx_clk or posedge rst_mac_rx )
- if ( rst_mac_rx )
- MRxD <= 0;
- else if( Line_loop_en )
- MRxD <= Txd;
- else if( Speed[2] && Rx_dv_dl2 )
- MRxD <= Rxd_dl2;
- else if( Rx_dv_dl1 && Rx_odd_data_ptr )
- MRxD <={ Rxd_dl1[3:0], Rxd_dl2[3:0] };
-
-endmodule
diff --git a/eth/rtl/verilog/RMON.v b/eth/rtl/verilog/RMON.v deleted file mode 100644 index 18a84beb5..000000000 --- a/eth/rtl/verilog/RMON.v +++ /dev/null @@ -1,163 +0,0 @@ -//////////////////////////////////////////////////////////////////////
-//// ////
-//// RMON.v ////
-//// ////
-//// This file is part of the Ethernet IP core project ////
-//// http://www.opencores.org/projects.cgi/web/ethernet_tri_mode/////
-//// ////
-//// Author(s): ////
-//// - Jon Gao (gaojon@yahoo.com) ////
-//// ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// Copyright (C) 2001 Authors ////
-//// ////
-//// This source file may be used and distributed without ////
-//// restriction provided that this copyright statement is not ////
-//// removed from the file and that any derivative work contains ////
-//// the original copyright notice and the associated disclaimer. ////
-//// ////
-//// This source file is free software; you can redistribute it ////
-//// and/or modify it under the terms of the GNU Lesser General ////
-//// Public License as published by the Free Software Foundation; ////
-//// either version 2.1 of the License, or (at your option) any ////
-//// later version. ////
-//// ////
-//// This source is distributed in the hope that it will be ////
-//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
-//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-//// PURPOSE. See the GNU Lesser General Public License for more ////
-//// details. ////
-//// ////
-//// You should have received a copy of the GNU Lesser General ////
-//// Public License along with this source; if not, download it ////
-//// from http://www.opencores.org/lgpl.shtml ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//
-// CVS Revision History
-//
-// $Log: RMON.v,v $
-// Revision 1.4 2006/06/25 04:58:56 maverickist
-// no message
-//
-// Revision 1.3 2006/01/19 14:07:53 maverickist
-// verification is complete.
-//
-// Revision 1.2 2005/12/16 06:44:16 Administrator
-// replaced tab with space.
-// passed 9.6k length frame test.
-//
-// Revision 1.1.1.1 2005/12/13 01:51:44 Administrator
-// no message
-//
-
-module RMON
- (input Clk ,
- input Reset ,
- //Tx_RMON
- input [2:0] Tx_pkt_type_rmon ,
- input [15:0] Tx_pkt_length_rmon ,
- input Tx_apply_rmon ,
- input [2:0] Tx_pkt_err_type_rmon,
- //Tx_RMON
- input [2:0] Rx_pkt_type_rmon ,
- input [15:0] Rx_pkt_length_rmon ,
- input Rx_apply_rmon ,
- input [2:0] Rx_pkt_err_type_rmon,
- //CPU
- input [5:0] CPU_rd_addr ,
- input CPU_rd_apply ,
- output CPU_rd_grant ,
- output [31:0] CPU_rd_dout
- );
-
- // ******************************************************************************
- // interface signals
- // ******************************************************************************
- wire Reg_apply_0 ;
- wire [4:0] Reg_addr_0 ;
- wire [15:0] Reg_data_0 ;
- wire Reg_next_0 ;
- wire Reg_apply_1 ;
- wire [4:0] Reg_addr_1 ;
- wire [15:0] Reg_data_1 ;
- wire Reg_next_1 ;
- wire [5:0] Addra ;
- wire [31:0] Dina ;
- reg [31:0] Douta ;
- wire Wea ;
-
- // ******************************************************************************
-
- RMON_addr_gen U_0_Rx_RMON_addr_gen
- (.Clk (Clk ),
- .Reset (Reset ),
- //RMON
- .Pkt_type_rmon (Rx_pkt_type_rmon ),
- .Pkt_length_rmon (Rx_pkt_length_rmon ),
- .Apply_rmon (Rx_apply_rmon ),
- .Pkt_err_type_rmon (Rx_pkt_err_type_rmon ),
- //Rmon_ctrl
- .Reg_apply (Reg_apply_0 ),
- .Reg_addr (Reg_addr_0 ),
- .Reg_data (Reg_data_0 ),
- .Reg_next (Reg_next_0 ),
- //CPU
- .Reg_drop_apply ( ) );
-
- RMON_addr_gen U_0_Tx_RMON_addr_gen
- (.Clk (Clk ),
- .Reset (Reset ),
- //RMON
- .Pkt_type_rmon (Tx_pkt_type_rmon ),
- .Pkt_length_rmon (Tx_pkt_length_rmon ),
- .Apply_rmon (Tx_apply_rmon ),
- .Pkt_err_type_rmon (Tx_pkt_err_type_rmon ),
- //Rmon_ctrl
- .Reg_apply (Reg_apply_1 ),
- .Reg_addr (Reg_addr_1 ),
- .Reg_data (Reg_data_1 ),
- .Reg_next (Reg_next_1 ),
- //CPU
- .Reg_drop_apply ( ) );
-
- RMON_ctrl U_RMON_ctrl
- (.Clk (Clk ),
- .Reset (Reset ),
- //RMON_ctrl
- .Reg_apply_0 (Reg_apply_0 ),
- .Reg_addr_0 (Reg_addr_0 ),
- .Reg_data_0 (Reg_data_0 ),
- .Reg_next_0 (Reg_next_0 ),
- .Reg_apply_1 (Reg_apply_1 ),
- .Reg_addr_1 (Reg_addr_1 ),
- .Reg_data_1 (Reg_data_1 ),
- .Reg_next_1 (Reg_next_1 ),
- //dual-port ram
- .Addra (Addra ),
- .Dina (Dina ),
- .Douta (Douta ),
- .Wea (Wea ),
- //CPU
- .CPU_rd_addr (CPU_rd_addr ),
- .CPU_rd_apply (CPU_rd_apply ),
- .CPU_rd_grant (CPU_rd_grant ),
- .CPU_rd_dout (CPU_rd_dout ) );
-
- reg [31:0] RMON_ram [0:63];
- wire [31:0] Douta_imm = RMON_ram[Addra];
- integer i;
- initial
- for(i=0;i<64;i=i+1)
- RMON_ram[i] = 32'd0;
-
- always @(posedge Clk)
- if(Wea)
- RMON_ram[Addra] <= Dina;
-
- always @(posedge Clk)
- Douta <= Douta_imm;
-
-endmodule // RMON
diff --git a/eth/rtl/verilog/RMON/RMON_addr_gen.v b/eth/rtl/verilog/RMON/RMON_addr_gen.v deleted file mode 100644 index 9da8d1f80..000000000 --- a/eth/rtl/verilog/RMON/RMON_addr_gen.v +++ /dev/null @@ -1,295 +0,0 @@ -//////////////////////////////////////////////////////////////////////
-//// ////
-//// RMON_addr_gen.v ////
-//// ////
-//// This file is part of the Ethernet IP core project ////
-//// http://www.opencores.org/projects.cgi/web/ethernet_tri_mode/////
-//// ////
-//// Author(s): ////
-//// - Jon Gao (gaojon@yahoo.com) ////
-//// ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// Copyright (C) 2001 Authors ////
-//// ////
-//// This source file may be used and distributed without ////
-//// restriction provided that this copyright statement is not ////
-//// removed from the file and that any derivative work contains ////
-//// the original copyright notice and the associated disclaimer. ////
-//// ////
-//// This source file is free software; you can redistribute it ////
-//// and/or modify it under the terms of the GNU Lesser General ////
-//// Public License as published by the Free Software Foundation; ////
-//// either version 2.1 of the License, or (at your option) any ////
-//// later version. ////
-//// ////
-//// This source is distributed in the hope that it will be ////
-//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
-//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-//// PURPOSE. See the GNU Lesser General Public License for more ////
-//// details. ////
-//// ////
-//// You should have received a copy of the GNU Lesser General ////
-//// Public License along with this source; if not, download it ////
-//// from http://www.opencores.org/lgpl.shtml ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//
-// CVS Revision History
-//
-// $Log: RMON_addr_gen.v,v $
-// Revision 1.4 2006/06/25 04:58:57 maverickist
-// no message
-//
-// Revision 1.3 2006/01/19 14:07:55 maverickist
-// verification is complete.
-//
-// Revision 1.2 2005/12/16 06:44:19 Administrator
-// replaced tab with space.
-// passed 9.6k length frame test.
-//
-// Revision 1.1.1.1 2005/12/13 01:51:45 Administrator
-// no message
-//
-module RMON_addr_gen(
-Clk ,
-Reset ,
-//RMON
-Pkt_type_rmon ,
-Pkt_length_rmon ,
-Apply_rmon ,//pluse signal looks like eop
-Pkt_err_type_rmon ,
-//
-Reg_apply ,
-Reg_addr ,
-Reg_data ,
-Reg_next ,
-//CPU
-Reg_drop_apply
-);
-input Clk ;
-input Reset ;
- //RMON
-input [2:0] Pkt_type_rmon ;
-input [15:0] Pkt_length_rmon ;
-input Apply_rmon ;//pluse signal looks like eop
-input [2:0] Pkt_err_type_rmon ;
- //RMON_ctrl
-output Reg_apply ;
-output [4:0] Reg_addr ;
-output [15:0] Reg_data ;
-input Reg_next ;
- //CPU
-output Reg_drop_apply ;
-
-//******************************************************************************
-//internal signals
-//******************************************************************************
-parameter StateIdle =4'd0;
-parameter StatePktLength =4'd1;
-parameter StatePktNumber =4'd2;
-parameter StatePktType =4'd3;
-parameter StatePktRange =4'd4;
-
-reg [3:0] CurrentState /* synthesys syn_keep=1 */;
-reg [3:0] NextState;
-
-reg [2:0] PktTypeReg ;
-reg [15:0] PktLengthReg ;
-reg [2:0] PktErrTypeReg ;
-
-reg Reg_apply ;
-reg [4:0] Reg_addr ;
-reg [15:0] Reg_data ;
-reg Reg_drop_apply ;
-//******************************************************************************
-//register boundery signals
-
-//******************************************************************************
-reg Apply_rmon_dl1;
-reg Apply_rmon_dl2;
-reg Apply_rmon_pulse;
-reg [2:0] Pkt_type_rmon_dl1 ;
-reg [15:0] Pkt_length_rmon_dl1 ;
-reg [2:0] Pkt_err_type_rmon_dl1 ;
-
-always @(posedge Clk or posedge Reset)
- if (Reset)
- begin
- Pkt_type_rmon_dl1 <=0;
- Pkt_length_rmon_dl1 <=0;
- Pkt_err_type_rmon_dl1 <=0;
- end
- else
- begin
- Pkt_type_rmon_dl1 <=Pkt_type_rmon ;
- Pkt_length_rmon_dl1 <=Pkt_length_rmon ;
- Pkt_err_type_rmon_dl1 <=Pkt_err_type_rmon ;
- end
-
-always @(posedge Clk or posedge Reset)
- if (Reset)
- begin
- Apply_rmon_dl1 <=0;
- Apply_rmon_dl2 <=0;
- end
- else
- begin
- Apply_rmon_dl1 <=Apply_rmon;
- Apply_rmon_dl2 <=Apply_rmon_dl1;
- end
-
-always @(Apply_rmon_dl1 or Apply_rmon_dl2)
- if (Apply_rmon_dl1&!Apply_rmon_dl2)
- Apply_rmon_pulse =1;
- else
- Apply_rmon_pulse =0;
-
-
-
-always @(posedge Clk or posedge Reset)
- if (Reset)
- begin
- PktTypeReg <=0;
- PktLengthReg <=0;
- PktErrTypeReg <=0;
- end
- else if (Apply_rmon_pulse&&CurrentState==StateIdle)
- begin
- PktTypeReg <=Pkt_type_rmon_dl1 ;
- PktLengthReg <=Pkt_length_rmon_dl1 ;
- PktErrTypeReg <=Pkt_err_type_rmon_dl1 ;
- end
-
-
-//******************************************************************************
-//State Machine
-//******************************************************************************
-always @(posedge Clk or posedge Reset)
- if (Reset)
- CurrentState <=StateIdle;
- else
- CurrentState <=NextState;
-
-always @(CurrentState or Apply_rmon_pulse or Reg_next)
- case (CurrentState)
- StateIdle:
- if (Apply_rmon_pulse)
- NextState =StatePktLength;
- else
- NextState =StateIdle;
- StatePktLength:
- if (Reg_next)
- NextState =StatePktNumber;
- else
- NextState =CurrentState;
- StatePktNumber:
- if (Reg_next)
- NextState =StatePktType;
- else
- NextState =CurrentState;
- StatePktType:
- if (Reg_next)
- NextState =StatePktRange;
- else
- NextState =CurrentState;
- StatePktRange:
- if (Reg_next)
- NextState =StateIdle;
- else
- NextState =CurrentState;
- default:
- NextState =StateIdle;
- endcase
-
-//******************************************************************************
-//gen output signals
-//******************************************************************************
-//Reg_apply
-always @ (CurrentState)
- if (CurrentState==StatePktLength||CurrentState==StatePktNumber||
- CurrentState==StatePktType||CurrentState==StatePktRange)
- Reg_apply =1;
- else
- Reg_apply =0;
-
-//Reg_addr
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- Reg_addr <=0;
- else case (CurrentState)
- StatePktLength:
- Reg_addr <=5'd00;
- StatePktNumber:
- Reg_addr <=5'd01;
- StatePktType:
- case(PktTypeReg)
- 3'b011:
- Reg_addr <=5'd02; //broadcast
- 3'b001:
- Reg_addr <=5'd03; //multicast
- 3'b100:
- Reg_addr <=5'd16; //pause frame
- default:
- Reg_addr <=5'd04; //unicast
- endcase
- StatePktRange:
- case(PktErrTypeReg)
- 3'b001:
- Reg_addr <=5'd05;
- 3'b010:
- Reg_addr <=5'd06;
- 3'b011:
- Reg_addr <=5'd07;
- 3'b100:
- if (PktLengthReg<64)
- Reg_addr <=5'd08;
- else if (PktLengthReg==64)
- Reg_addr <=5'd09;
- else if (PktLengthReg<128)
- Reg_addr <=5'd10;
- else if (PktLengthReg<256)
- Reg_addr <=5'd11;
- else if (PktLengthReg<512)
- Reg_addr <=5'd12;
- else if (PktLengthReg<1024)
- Reg_addr <=5'd13;
- else if (PktLengthReg<1519)
- Reg_addr <=5'd14;
- else
- Reg_addr <=5'd15;
- default:
- Reg_addr <=5'd05;
- endcase
- default:
- Reg_addr <=5'd05;
- endcase
-
-//Reg_data
-always @ (CurrentState or PktLengthReg)
- case (CurrentState)
- StatePktLength:
- Reg_data =PktLengthReg;
- StatePktNumber:
- Reg_data =1;
- StatePktType:
- Reg_data =1;
- StatePktRange:
- Reg_data =1;
- default:
- Reg_data =0;
- endcase
-
-//Reg_drop_apply
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- Reg_drop_apply <=0;
- else if (CurrentState!=StateIdle&&Apply_rmon_pulse)
- Reg_drop_apply <=1;
- else
- Reg_drop_apply <=0;
-
-
-endmodule
-
diff --git a/eth/rtl/verilog/RMON/RMON_ctrl.v b/eth/rtl/verilog/RMON/RMON_ctrl.v deleted file mode 100644 index 4fc038dc8..000000000 --- a/eth/rtl/verilog/RMON/RMON_ctrl.v +++ /dev/null @@ -1,283 +0,0 @@ -//////////////////////////////////////////////////////////////////////
-//// ////
-//// RMON_ctrl.v ////
-//// ////
-//// This file is part of the Ethernet IP core project ////
-//// http://www.opencores.org/projects.cgi/web/ethernet_tri_mode/////
-//// ////
-//// Author(s): ////
-//// - Jon Gao (gaojon@yahoo.com) ////
-//// ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// Copyright (C) 2001 Authors ////
-//// ////
-//// This source file may be used and distributed without ////
-//// restriction provided that this copyright statement is not ////
-//// removed from the file and that any derivative work contains ////
-//// the original copyright notice and the associated disclaimer. ////
-//// ////
-//// This source file is free software; you can redistribute it ////
-//// and/or modify it under the terms of the GNU Lesser General ////
-//// Public License as published by the Free Software Foundation; ////
-//// either version 2.1 of the License, or (at your option) any ////
-//// later version. ////
-//// ////
-//// This source is distributed in the hope that it will be ////
-//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
-//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-//// PURPOSE. See the GNU Lesser General Public License for more ////
-//// details. ////
-//// ////
-//// You should have received a copy of the GNU Lesser General ////
-//// Public License along with this source; if not, download it ////
-//// from http://www.opencores.org/lgpl.shtml ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//
-// CVS Revision History
-//
-// $Log: RMON_ctrl.v,v $
-// Revision 1.4 2006/06/25 04:58:57 maverickist
-// no message
-//
-// Revision 1.3 2006/01/19 14:07:55 maverickist
-// verification is complete.
-//
-// Revision 1.2 2005/12/16 06:44:19 Administrator
-// replaced tab with space.
-// passed 9.6k length frame test.
-//
-// Revision 1.1.1.1 2005/12/13 01:51:45 Administrator
-// no message
-//
-module RMON_ctrl (
-Clk ,
-Reset ,
-//RMON_ctrl
-Reg_apply_0 ,
-Reg_addr_0 ,
-Reg_data_0 ,
-Reg_next_0 ,
-Reg_apply_1 ,
-Reg_addr_1 ,
-Reg_data_1 ,
-Reg_next_1 ,
-//dual-port ram
-Addra ,
-Dina ,
-Douta ,
-Wea ,
-//CPU
-CPU_rd_addr ,
-CPU_rd_apply ,
-CPU_rd_grant ,
-CPU_rd_dout
-
-);
-input Clk ;
-input Reset ;
- //RMON_ctrl
-input Reg_apply_0 ;
-input [4:0] Reg_addr_0 ;
-input [15:0] Reg_data_0 ;
-output Reg_next_0 ;
-input Reg_apply_1 ;
-input [4:0] Reg_addr_1 ;
-input [15:0] Reg_data_1 ;
-output Reg_next_1 ;
- //dual-port ram
- //port-a for Rmon
-output [5:0] Addra ;
-output [31:0] Dina ;
-input [31:0] Douta ;
-output Wea ;
- //CPU
-input [5:0] CPU_rd_addr ;
-input CPU_rd_apply ;
-output CPU_rd_grant ;
-output [31:0] CPU_rd_dout ;
-
-
-
-
-//******************************************************************************
-//internal signals
-//******************************************************************************
-
-parameter StateCPU =4'd00;
-parameter StateMAC0 =4'd01;
-parameter StateMAC1 =4'd02;
-
-
-reg [3:0] CurrentState /* synthesys syn_keep=1 */;
-reg [3:0] NextState;
-reg [3:0] CurrentState_reg;
-
-reg [4:0] StepCounter;
-reg [5:0] Addra ;
-reg [31:0] Dina;
-reg Reg_next_0 ;
-reg Reg_next_1 ;
-reg Write;
-reg Read;
-reg Pipeline;
-reg [31:0] CPU_rd_dout ;
-reg CPU_rd_apply_reg ;
-//******************************************************************************
-//State Machine
-//******************************************************************************
-
-always @(posedge Clk or posedge Reset)
- if (Reset)
- CurrentState <=StateMAC0;
- else
- CurrentState <=NextState;
-
-always @(posedge Clk or posedge Reset)
- if (Reset)
- CurrentState_reg <=StateMAC0;
- else if(CurrentState!=StateCPU)
- CurrentState_reg <=CurrentState;
-
-always @(CurrentState or CPU_rd_apply_reg or Reg_apply_0 or CurrentState_reg
- or Reg_apply_1
- or StepCounter
- )
- case(CurrentState)
- StateMAC0:
- if(!Reg_apply_0&&CPU_rd_apply_reg)
- NextState =StateCPU;
- else if(!Reg_apply_0)
- NextState =StateMAC1;
- else
- NextState =CurrentState;
- StateMAC1:
- if(!Reg_apply_1&&CPU_rd_apply_reg)
- NextState =StateCPU;
- else if(!Reg_apply_1)
- NextState =StateMAC0;
- else
- NextState =CurrentState;
- StateCPU:
- if (StepCounter==3)
- case (CurrentState_reg)
- StateMAC0 :NextState =StateMAC0 ;
- StateMAC1 :NextState =StateMAC1 ;
- default :NextState =StateMAC0;
- endcase
- else
- NextState =CurrentState;
-
- default:
- NextState =StateMAC0;
- endcase
-
-
-
-always @(posedge Clk or posedge Reset)
- if (Reset)
- StepCounter <=0;
- else if(NextState!=CurrentState)
- StepCounter <=0;
- else if (StepCounter!=4'hf)
- StepCounter <=StepCounter + 1;
-
-//******************************************************************************
-//temp signals
-//******************************************************************************
-always @(StepCounter)
- if( StepCounter==1||StepCounter==4||
- StepCounter==7||StepCounter==10)
- Read =1;
- else
- Read =0;
-
-always @(StepCounter or CurrentState)
- if( StepCounter==2||StepCounter==5||
- StepCounter==8||StepCounter==11)
- Pipeline =1;
- else
- Pipeline =0;
-
-always @(StepCounter or CurrentState)
- if( StepCounter==3||StepCounter==6||
- StepCounter==9||StepCounter==12)
- Write =1;
- else
- Write =0;
-
-
-//******************************************************************************
-//gen output signals
-//******************************************************************************
-//Addra
-always @(*)
- case(CurrentState)
- StateMAC0 : Addra={1'd0 ,Reg_addr_0 };
- StateMAC1 : Addra={1'd1 ,Reg_addr_1 };
- StateCPU: Addra=CPU_rd_addr;
- default: Addra=0;
- endcase
-
-//Dina
-always @(posedge Clk or posedge Reset)
- if (Reset)
- Dina <=0;
- else
- case(CurrentState)
- StateMAC0 : Dina<=Douta+Reg_data_0 ;
- StateMAC1 : Dina<=Douta+Reg_data_1 ;
- StateCPU: Dina<=0;
- default: Dina<=0;
- endcase
-
-assign Wea =Write;
-//Reg_next
-always @(CurrentState or Pipeline)
- if(CurrentState==StateMAC0)
- Reg_next_0 =Pipeline;
- else
- Reg_next_0 =0;
-
-always @(CurrentState or Pipeline)
- if(CurrentState==StateMAC1)
- Reg_next_1 =Pipeline;
- else
- Reg_next_1 =0;
-
-
-//CPU_rd_grant
-reg CPU_rd_apply_dl1;
-reg CPU_rd_apply_dl2;
-//rising edge
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- begin
- CPU_rd_apply_dl1 <=0;
- CPU_rd_apply_dl2 <=0;
- end
- else
- begin
- CPU_rd_apply_dl1 <=CPU_rd_apply;
- CPU_rd_apply_dl2 <=CPU_rd_apply_dl1;
- end
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- CPU_rd_apply_reg <=0;
- else if (CPU_rd_apply_dl1&!CPU_rd_apply_dl2)
- CPU_rd_apply_reg <=1;
- else if (CurrentState==StateCPU&&Write)
- CPU_rd_apply_reg <=0;
-
-assign CPU_rd_grant = CPU_rd_apply & CPU_rd_apply_dl1 & CPU_rd_apply_dl2 & !CPU_rd_apply_reg;
-
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- CPU_rd_dout <=0;
- else if (Pipeline&&CurrentState==StateCPU)
- CPU_rd_dout <=Douta;
-
-endmodule
diff --git a/eth/rtl/verilog/Reg_int.v b/eth/rtl/verilog/Reg_int.v deleted file mode 100644 index bdf73d8e5..000000000 --- a/eth/rtl/verilog/Reg_int.v +++ /dev/null @@ -1,275 +0,0 @@ -module Reg_int (
- // Wishbone compliant core host interface
- input CLK_I, // Wishbone interface clock (nominally 50 MHz)
- input RST_I, // Active high (async) reset of the Wishbone interface
- input STB_I, // Active high module-select
- input CYC_I, // Active high cycle-enable
- input [6:0] ADR_I, // Module register address
- input WE_I, // Active high for writes, low for reads
- input [31:0] DAT_I, // Write data
- output reg [31:0] DAT_O, // Read data
- output reg ACK_O, // Acknowledge output – single high pulse
-
- // Tx host interface
- output [4:0] Tx_Hwmark,
- output [4:0] Tx_Lwmark,
- output MAC_tx_add_en,
- output FullDuplex,
- output [3:0] MaxRetry,
- output [5:0] IFGset,
- output [7:0] MAC_tx_add_prom_data,
- output [2:0] MAC_tx_add_prom_add,
- output MAC_tx_add_prom_wr,
-
- // Rx host interface
- output MAC_rx_add_chk_en,
- output [7:0] MAC_rx_add_prom_data,
- output [2:0] MAC_rx_add_prom_add,
- output MAC_rx_add_prom_wr,
- output broadcast_filter_en,
- output [15:0] broadcast_bucket_depth,
- output [15:0] broadcast_bucket_interval,
- output RX_APPEND_CRC,
- output [4:0] Rx_Hwmark,
- output [4:0] Rx_Lwmark,
- output CRC_chk_en,
- output [5:0] RX_IFG_SET,
- output [15:0] RX_MAX_LENGTH, // Default 1518
- output [6:0] RX_MIN_LENGTH, // Default 64
-
- // Flow control settings
- output pause_frame_send_en,
- output [15:0] pause_quanta_set,
- output tx_pause_en,
- output [15:0] fc_hwmark,
- output [15:0] fc_lwmark,
- output [15:0] fc_padtime,
-
- // RMON host interface
- output [5:0] CPU_rd_addr,
- output CPU_rd_apply,
- input CPU_rd_grant,
- input [31:0] CPU_rd_dout,
-
- //Phy int host interface
- output Line_loop_en,
- output [2:0] Speed,
-
- //MII to CPU
- output [7:0] Divider, // Divider for the host clock
- output [15:0] CtrlData, // Control Data (to be written to the PHY reg.)
- output [4:0] Rgad, // Register Address (within the PHY)
- output [4:0] Fiad, // PHY Address
- output NoPre, // No Preamble (no 32-bit preamble)
- output WCtrlData, // Write Control Data operation
- output RStat, // Read Status operation
- output ScanStat, // Scan Status operation
- input Busy, // Busy Signal
- input LinkFail, // Link Integrity Signal
- input Nvalid, // Invalid Status (qualifier for the valid scan result)
- input [15:0] Prsd, // Read Status Data (data read from the PHY)
- input WCtrlDataStart, // This signals resets the WCTRLDATA bit in the MIIM Command register
- input RStatStart, // This signal resets the RSTAT BIT in the MIIM Command register
- input UpdateMIIRX_DATAReg // Updates MII RX_DATA register with read data
-);
-
- // New registers for controlling the MII interface
- wire [8:0] MIIMODER;
- reg [2:0] MIICOMMAND;
- wire [12:0] MIIADDRESS;
- wire [15:0] MIITX_DATA;
- reg [15:0] MIIRX_DATA;
- wire [2:0] MIISTATUS;
-
- // New registers for controlling the MII interface
-
- // MIIMODER
- assign NoPre = MIIMODER[8];
- assign Divider = MIIMODER[7:0];
- // MIICOMMAND
- assign WCtrlData = MIICOMMAND[2];
- assign RStat = MIICOMMAND[1];
- assign ScanStat = MIICOMMAND[0];
- // MIIADDRESS
- assign Rgad = MIIADDRESS[12:8];
- assign Fiad = MIIADDRESS[4:0];
- // MIITX_DATA
- assign CtrlData = MIITX_DATA[15:0];
- // MIISTATUS
- assign MIISTATUS[2:0] = { 13'b0, Nvalid, Busy, LinkFail };
-
- wire Wr;
-
- RegCPUData #( 5 ) U_0_000( Tx_Hwmark , 7'd000, 5'h09, RST_I, CLK_I, Wr, ADR_I, DAT_I[4:0] );
- RegCPUData #( 5 ) U_0_001( Tx_Lwmark , 7'd001, 5'h08, RST_I, CLK_I, Wr, ADR_I, DAT_I[4:0] );
- RegCPUData #( 1 ) U_0_002( pause_frame_send_en , 7'd002, 1'h0, RST_I, CLK_I, Wr, ADR_I, DAT_I[0:0] );
- RegCPUData #( 16 ) U_0_003( pause_quanta_set , 7'd003, 16'h01af, RST_I, CLK_I, Wr, ADR_I, DAT_I[15:0] );
- RegCPUData #( 6 ) U_0_004( IFGset , 7'd004, 6'h0c, RST_I, CLK_I, Wr, ADR_I, DAT_I[5:0] );
- RegCPUData #( 1 ) U_0_005( FullDuplex , 7'd005, 1'h1, RST_I, CLK_I, Wr, ADR_I, DAT_I[0:0] );
- RegCPUData #( 4 ) U_0_006( MaxRetry , 7'd006, 4'h2, RST_I, CLK_I, Wr, ADR_I, DAT_I[3:0] );
- RegCPUData #( 1 ) U_0_007( MAC_tx_add_en , 7'd007, 1'h0, RST_I, CLK_I, Wr, ADR_I, DAT_I[0:0] );
- RegCPUData #( 8 ) U_0_008( MAC_tx_add_prom_data , 7'd008, 8'h00, RST_I, CLK_I, Wr, ADR_I, DAT_I[7:0] );
- RegCPUData #( 3 ) U_0_009( MAC_tx_add_prom_add , 7'd009, 3'h0, RST_I, CLK_I, Wr, ADR_I, DAT_I[2:0] );
- RegCPUData #( 1 ) U_0_010( MAC_tx_add_prom_wr , 7'd010, 1'h0, RST_I, CLK_I, Wr, ADR_I, DAT_I[0:0] );
- RegCPUData #( 1 ) U_0_011( tx_pause_en , 7'd011, 1'h1, RST_I, CLK_I, Wr, ADR_I, DAT_I[0:0] );
- RegCPUData #( 16 ) U_0_012( fc_hwmark , 7'd012, 1'h0, RST_I, CLK_I, Wr, ADR_I, DAT_I[15:0] );
- RegCPUData #( 16 ) U_0_013( fc_lwmark , 7'd013, 1'h0, RST_I, CLK_I, Wr, ADR_I, DAT_I[15:0] );
- RegCPUData #( 1 ) U_0_014( MAC_rx_add_chk_en , 7'd014, 1'h0, RST_I, CLK_I, Wr, ADR_I, DAT_I[0:0] );
- RegCPUData #( 8 ) U_0_015( MAC_rx_add_prom_data , 7'd015, 8'h00, RST_I, CLK_I, Wr, ADR_I, DAT_I[7:0] );
- RegCPUData #( 3 ) U_0_016( MAC_rx_add_prom_add , 7'd016, 3'h0, RST_I, CLK_I, Wr, ADR_I, DAT_I[2:0] );
- RegCPUData #( 1 ) U_0_017( MAC_rx_add_prom_wr , 7'd017, 1'h0, RST_I, CLK_I, Wr, ADR_I, DAT_I[0:0] );
- RegCPUData #( 1 ) U_0_018( broadcast_filter_en , 7'd018, 1'h0, RST_I, CLK_I, Wr, ADR_I, DAT_I[0:0] );
- RegCPUData #( 16 ) U_0_019( broadcast_bucket_depth , 7'd019, 16'h0000, RST_I, CLK_I, Wr, ADR_I, DAT_I[15:0] );
- RegCPUData #( 16 ) U_0_020( broadcast_bucket_interval , 7'd020, 16'h0000, RST_I, CLK_I, Wr, ADR_I, DAT_I[15:0] );
- RegCPUData #( 1 ) U_0_021( RX_APPEND_CRC , 7'd021, 1'h0, RST_I, CLK_I, Wr, ADR_I, DAT_I[0:0] );
- RegCPUData #( 5 ) U_0_022( Rx_Hwmark , 7'd022, 5'h1a, RST_I, CLK_I, Wr, ADR_I, DAT_I[4:0] );
- RegCPUData #( 5 ) U_0_023( Rx_Lwmark , 7'd023, 5'h10, RST_I, CLK_I, Wr, ADR_I, DAT_I[4:0] );
- RegCPUData #( 1 ) U_0_024( CRC_chk_en , 7'd024, 1'h1, RST_I, CLK_I, Wr, ADR_I, DAT_I[0:0] );
- RegCPUData #( 6 ) U_0_025( RX_IFG_SET , 7'd025, 6'h0c, RST_I, CLK_I, Wr, ADR_I, DAT_I[5:0] );
- RegCPUData #( 16 ) U_0_026( RX_MAX_LENGTH , 7'd026, 16'h2710, RST_I, CLK_I, Wr, ADR_I, DAT_I[15:0] );
- RegCPUData #( 7 ) U_0_027( RX_MIN_LENGTH , 7'd027, 7'h40, RST_I, CLK_I, Wr, ADR_I, DAT_I[6:0] );
- RegCPUData #( 6 ) U_0_028( CPU_rd_addr , 7'd028, 6'h00, RST_I, CLK_I, Wr, ADR_I, DAT_I[5:0] );
- RegCPUData #( 1 ) U_0_029( CPU_rd_apply , 7'd029, 1'h0, RST_I, CLK_I, Wr, ADR_I, DAT_I[0:0] );
-//RegCPUData #( 1 ) U_0_030( CPU_rd_grant , 7'd030, 1'h0, RST_I, CLK_I, Wr, ADR_I, DAT_I[0:0] );
-//RegCPUData #( 16 ) U_0_031( CPU_rd_dout_l , 7'd031, 16'h0000, RST_I, CLK_I, Wr, ADR_I, DAT_I[15:0] );
-//RegCPUData #( 16 ) U_0_032( CPU_rd_dout_h , 7'd032, 16'h0000, RST_I, CLK_I, Wr, ADR_I, DAT_I[15:0] );
- RegCPUData #( 1 ) U_0_033( Line_loop_en , 7'd033, 1'h0, RST_I, CLK_I, Wr, ADR_I, DAT_I[0:0] );
- RegCPUData #( 3 ) U_0_034( Speed , 7'd034, 3'h0, RST_I, CLK_I, Wr, ADR_I, DAT_I[2:0] );
-
- // New registers for controlling the MDIO interface
- RegCPUData #( 9 ) U_0_035( MIIMODER , 7'd035, 9'h064, RST_I, CLK_I, Wr, ADR_I, DAT_I[8:0] );
- // Reg #36 is MIICOMMAND - implemented separately below
- RegCPUData #( 13 ) U_0_037( MIIADDRESS , 7'd037, 13'h0000, RST_I, CLK_I, Wr, ADR_I, DAT_I[12:0] );
- RegCPUData #( 16 ) U_0_038( MIITX_DATA , 7'd038, 16'h0000, RST_I, CLK_I, Wr, ADR_I, DAT_I[15:0] );
-
- // New FC register
- RegCPUData #( 16 ) U_0_041( fc_padtime , 7'd041, 1'h0, RST_I, CLK_I, Wr, ADR_I, DAT_I[15:0] );
-
- // Asserted in first clock of 2-cycle access, negated otherwise
- wire Access = ~ACK_O & STB_I & CYC_I;
-
- // Asserted in first clock of 2-cycle write access, negated otherwise
- assign Wr = Access & WE_I;
-
- // MIICOMMAND register - needs special treatment because of auto-resetting bits
- always @ ( posedge RST_I or posedge CLK_I )
- if ( RST_I )
- MIICOMMAND <= 0;
- else
- begin
- if ( Wr & ( ADR_I == 7'd036 ) )
- // Write access
- MIICOMMAND <= DAT_I;
- else
- begin
- if ( WCtrlDataStart )
- MIICOMMAND[2] <= 0;
- if ( RStatStart )
- MIICOMMAND[1] <= 0;
- end
- end
-
- // MIIRX_DATA register
- always @ ( posedge RST_I or posedge CLK_I )
- if ( RST_I )
- MIIRX_DATA <= 0;
- else
- if ( UpdateMIIRX_DATAReg )
- MIIRX_DATA <= Prsd;
-
- // ACK_O is asserted in second clock of 2-cycle access, negated otherwise
- always @ ( posedge RST_I or posedge CLK_I )
- if ( RST_I )
- ACK_O <= 0;
- else
- ACK_O <= Access;
-
- always @ ( posedge RST_I or posedge CLK_I )
- if(RST_I)
- DAT_O <= 0;
- else
- begin
- DAT_O <=0;
- if ( Access & ~WE_I )
- casez ( ADR_I )
- 7'd00: DAT_O <= Tx_Hwmark;
- 7'd01: DAT_O <= Tx_Lwmark;
- 7'd02: DAT_O <= pause_frame_send_en;
- 7'd03: DAT_O <= pause_quanta_set;
- 7'd04: DAT_O <= IFGset;
- 7'd05: DAT_O <= FullDuplex;
- 7'd06: DAT_O <= MaxRetry;
- 7'd07: DAT_O <= MAC_tx_add_en;
- 7'd08: DAT_O <= MAC_tx_add_prom_data;
- 7'd09: DAT_O <= MAC_tx_add_prom_add;
- 7'd10: DAT_O <= MAC_tx_add_prom_wr;
- 7'd11: DAT_O <= tx_pause_en;
- 7'd12: DAT_O <= fc_hwmark;
- 7'd13: DAT_O <= fc_lwmark;
- 7'd14: DAT_O <= MAC_rx_add_chk_en;
- 7'd15: DAT_O <= MAC_rx_add_prom_data;
- 7'd16: DAT_O <= MAC_rx_add_prom_add;
- 7'd17: DAT_O <= MAC_rx_add_prom_wr;
- 7'd18: DAT_O <= broadcast_filter_en;
- 7'd19: DAT_O <= broadcast_bucket_depth;
- 7'd20: DAT_O <= broadcast_bucket_interval;
- 7'd21: DAT_O <= RX_APPEND_CRC;
- 7'd22: DAT_O <= Rx_Hwmark;
- 7'd23: DAT_O <= Rx_Lwmark;
- 7'd24: DAT_O <= CRC_chk_en;
- 7'd25: DAT_O <= RX_IFG_SET;
- 7'd26: DAT_O <= RX_MAX_LENGTH;
- 7'd27: DAT_O <= RX_MIN_LENGTH;
- 7'd28: DAT_O <= CPU_rd_addr;
- 7'd29: DAT_O <= CPU_rd_apply;
- 7'd30: DAT_O <= CPU_rd_grant;
- 7'd31: DAT_O <= CPU_rd_dout;
- //7'd32: DAT_O <= CPU_rd_dout[31:16];
- 7'd33: DAT_O <= Line_loop_en;
- 7'd34: DAT_O <= Speed;
-
- // New registers for controlling MII interface
- 7'd35: DAT_O <= MIIMODER;
- 7'd36: DAT_O <= MIICOMMAND;
- 7'd37: DAT_O <= MIIADDRESS;
- 7'd38: DAT_O <= MIITX_DATA;
- 7'd39: DAT_O <= MIIRX_DATA;
- 7'd40: DAT_O <= MIISTATUS;
- 7'd41: DAT_O <= fc_padtime;
- endcase
- end
-
-endmodule
-
-module RegCPUData(
- RegOut,
- RegAddr,
- RegInit,
-
- Reset,
- Clk,
- Wr,
- Addr,
- WrData
-);
-
- parameter WIDTH = 16;
-
- output reg [WIDTH-1:0] RegOut;
- input [6:0] RegAddr;
- input [WIDTH-1:0] RegInit;
-
- input Reset;
- input Clk;
- input Wr;
- input [6:0] Addr;
- input [WIDTH-1:0] WrData;
-
- always @( posedge Reset or posedge Clk )
- if ( Reset )
- RegOut <= RegInit;
- else
- if ( Wr && ( Addr == RegAddr ) )
- RegOut <= WrData;
-
-endmodule
diff --git a/eth/rtl/verilog/TECH/eth_clk_div2.v b/eth/rtl/verilog/TECH/eth_clk_div2.v deleted file mode 100644 index 994907d44..000000000 --- a/eth/rtl/verilog/TECH/eth_clk_div2.v +++ /dev/null @@ -1,71 +0,0 @@ -//////////////////////////////////////////////////////////////////////
-//// ////
-//// eth_clk_div2.v ////
-//// ////
-//// This file is part of the Ethernet IP core project ////
-//// http://www.opencores.org/projects.cgi/web/ethernet_tri_mode/////
-//// ////
-//// Author(s): ////
-//// - Jon Gao (gaojon@yahoo.com) ////
-//// ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// Copyright (C) 2001 Authors ////
-//// ////
-//// This source file may be used and distributed without ////
-//// restriction provided that this copyright statement is not ////
-//// removed from the file and that any derivative work contains ////
-//// the original copyright notice and the associated disclaimer. ////
-//// ////
-//// This source file is free software; you can redistribute it ////
-//// and/or modify it under the terms of the GNU Lesser General ////
-//// Public License as published by the Free Software Foundation; ////
-//// either version 2.1 of the License, or (at your option) any ////
-//// later version. ////
-//// ////
-//// This source is distributed in the hope that it will be ////
-//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
-//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-//// PURPOSE. See the GNU Lesser General Public License for more ////
-//// details. ////
-//// ////
-//// You should have received a copy of the GNU Lesser General ////
-//// Public License along with this source; if not, download it ////
-//// from http://www.opencores.org/lgpl.shtml ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//
-// CVS Revision History
-//
-// $Log: CLK_DIV2.v,v $
-// Revision 1.3 2006/01/19 14:07:56 maverickist
-// verification is complete.
-//
-// Revision 1.2 2005/12/16 06:44:20 Administrator
-// replaced tab with space.
-// passed 9.6k length frame test.
-//
-// Revision 1.1.1.1 2005/12/13 01:51:44 Administrator
-// no message
-//
-
-
-//////////////////////////////////////////////////////////////////////
-// This file can only used for simulation .
-// You need to replace it with your own element according to technology
-//////////////////////////////////////////////////////////////////////
-
-module eth_clk_div2 (
- input Reset,
- input IN,
- output reg OUT
-);
-
-always @ (posedge IN or posedge Reset)
- if (Reset)
- OUT <= 0;
- else
- OUT <= ~OUT;
-
-endmodule
diff --git a/eth/rtl/verilog/TECH/eth_clk_switch.v b/eth/rtl/verilog/TECH/eth_clk_switch.v deleted file mode 100644 index c5375743f..000000000 --- a/eth/rtl/verilog/TECH/eth_clk_switch.v +++ /dev/null @@ -1,81 +0,0 @@ -//////////////////////////////////////////////////////////////////////
-//// ////
-//// eth_clk_switch.v ////
-//// ////
-//// This file is part of the Ethernet IP core project ////
-//// http://www.opencores.org/projects.cgi/web/ethernet_tri_mode/////
-//// ////
-//// Author(s): ////
-//// - Jon Gao (gaojon@yahoo.com) ////
-//// ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// Copyright (C) 2001 Authors ////
-//// ////
-//// This source file may be used and distributed without ////
-//// restriction provided that this copyright statement is not ////
-//// removed from the file and that any derivative work contains ////
-//// the original copyright notice and the associated disclaimer. ////
-//// ////
-//// This source file is free software; you can redistribute it ////
-//// and/or modify it under the terms of the GNU Lesser General ////
-//// Public License as published by the Free Software Foundation; ////
-//// either version 2.1 of the License, or (at your option) any ////
-//// later version. ////
-//// ////
-//// This source is distributed in the hope that it will be ////
-//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
-//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-//// PURPOSE. See the GNU Lesser General Public License for more ////
-//// details. ////
-//// ////
-//// You should have received a copy of the GNU Lesser General ////
-//// Public License along with this source; if not, download it ////
-//// from http://www.opencores.org/lgpl.shtml ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//
-// CVS Revision History
-//
-// $Log: CLK_SWITCH.v,v $
-// Revision 1.3 2006/01/19 14:07:56 maverickist
-// verification is complete.
-//
-// Revision 1.2 2005/12/16 06:44:20 Administrator
-// replaced tab with space.
-// passed 9.6k length frame test.
-//
-// Revision 1.1.1.1 2005/12/13 01:51:44 Administrator
-// no message
-//
-
-`include "header.vh"
-
-//////////////////////////////////////////////////////////////////////
-// This file can only used for simulation .
-// You need to replace it with your own element according to technology
-//////////////////////////////////////////////////////////////////////
-module eth_clk_switch (
- input IN_0,
- input IN_1,
- input SW,
- output OUT
-);
-
-`ifdef MAC_TARGET_XILINX
-
- BUFGMUX U_BUFGMUX (
- .O ( OUT ),
- .I0( IN_0 ),
- .I1( IN_1 ),
- .S ( SW )
- );
-
-`else
-
- assign OUT = SW ? IN_1 : IN_0;
-
-`endif
-
-endmodule
diff --git a/eth/rtl/verilog/TECH/xilinx/BUFGMUX.v b/eth/rtl/verilog/TECH/xilinx/BUFGMUX.v deleted file mode 100644 index f5bb4a74a..000000000 --- a/eth/rtl/verilog/TECH/xilinx/BUFGMUX.v +++ /dev/null @@ -1,64 +0,0 @@ -// $Header: /devl/xcs/repo/env/Databases/CAEInterfaces/verunilibs/data/unisims/BUFGMUX.v,v 1.9.34.2 2005/10/21 20:45:30 wloo Exp $ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 1995/2004 Xilinx, Inc. -// All Right Reserved. -/////////////////////////////////////////////////////////////////////////////// -// ____ ____ -// / /\/ / -// /___/ \ / Vendor : Xilinx -// \ \ \/ Version : 7.1i (H.19) -// \ \ Description : Xilinx Functional Simulation Library Component -// / / Global Clock Mux Buffer with Output State 0 -// /___/ /\ Filename : BUFGMUX.v -// \ \ / \ Timestamp : Thu Mar 25 16:42:14 PST 2004 -// \___\/\___\ -// -// Revision: -// 03/23/04 - Initial version. - -`timescale 100 ps / 10 ps - -module BUFGMUX (O, I0, I1, S); - - output O; - - input I0, I1, S; - - reg q0, q1; - reg q0_enable, q1_enable; - - tri0 GSR = glbl.GSR; - - bufif1 B0 (O, I0, q0); - bufif1 B1 (O, I1, q1); - pulldown P1 (O); - - always @(GSR or I0 or S or q0_enable) - if (GSR) - q0 <= 1; - else if (!I0) - q0 <= !S && q0_enable; - - always @(GSR or I1 or S or q1_enable) - if (GSR) - q1 <= 0; - else if (!I1) - q1 <= S && q1_enable; - - always @(GSR or q1 or I0) - if (GSR) - q0_enable <= 1; - else if (q1) - q0_enable <= 0; - else if (I0) - q0_enable <= !q1; - - always @(GSR or q0 or I1) - if (GSR) - q1_enable <= 0; - else if (q0) - q1_enable <= 0; - else if (I1) - q1_enable <= !q0; - -endmodule diff --git a/eth/rtl/verilog/TECH/xilinx/RAMB16_S36_S36.v b/eth/rtl/verilog/TECH/xilinx/RAMB16_S36_S36.v deleted file mode 100644 index 80545a9b8..000000000 --- a/eth/rtl/verilog/TECH/xilinx/RAMB16_S36_S36.v +++ /dev/null @@ -1,2204 +0,0 @@ -// $Header: /devl/xcs/repo/env/Databases/CAEInterfaces/verunilibs/data/unisims/RAMB16_S36_S36.v,v 1.9 2005/03/14 22:54:41 wloo Exp $ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 1995/2005 Xilinx, Inc. -// All Right Reserved. -/////////////////////////////////////////////////////////////////////////////// -// ____ ____ -// / /\/ / -// /___/ \ / Vendor : Xilinx -// \ \ \/ Version : 8.1i (I.13) -// \ \ Description : Xilinx Functional Simulation Library Component -// / / 16K-Bit Data and 2K-Bit Parity Dual Port Block RAM -// /___/ /\ Filename : RAMB16_S36_S36.v -// \ \ / \ Timestamp : Thu Mar 10 16:43:36 PST 2005 -// \___\/\___\ -// -// Revision: -// 03/23/04 - Initial version. -// End Revision - -`ifdef legacy_model - -`timescale 1 ps / 1 ps - -module RAMB16_S36_S36 (DOA, DOB, DOPA, DOPB, ADDRA, ADDRB, CLKA, CLKB, DIA, DIB, DIPA, DIPB, ENA, ENB, SSRA, SSRB, WEA, WEB); - - parameter INIT_A = 36'h0; - parameter INIT_B = 36'h0; - parameter SRVAL_A = 36'h0; - parameter SRVAL_B = 36'h0; - parameter WRITE_MODE_A = "WRITE_FIRST"; - parameter WRITE_MODE_B = "WRITE_FIRST"; - parameter SIM_COLLISION_CHECK = "ALL"; - localparam SETUP_ALL = 1000; - localparam SETUP_READ_FIRST = 3000; - - parameter INIT_00 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_01 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_02 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_03 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_04 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_05 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_06 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_07 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_08 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_09 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_0A = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_0B = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_0C = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_0D = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_0E = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_0F = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_10 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_11 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_12 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_13 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_14 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_15 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_16 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_17 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_18 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_19 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_1A = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_1B = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_1C = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_1D = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_1E = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_1F = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_20 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_21 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_22 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_23 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_24 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_25 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_26 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_27 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_28 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_29 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_2A = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_2B = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_2C = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_2D = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_2E = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_2F = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_30 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_31 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_32 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_33 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_34 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_35 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_36 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_37 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_38 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_39 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_3A = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_3B = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_3C = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_3D = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_3E = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_3F = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INITP_00 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INITP_01 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INITP_02 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INITP_03 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INITP_04 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INITP_05 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INITP_06 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INITP_07 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - - output [31:0] DOA; - output [3:0] DOPA; - reg [31:0] doa_out; - reg [3:0] dopa_out; - wire doa_out0, doa_out1, doa_out2, doa_out3, doa_out4, doa_out5, doa_out6, doa_out7, doa_out8, doa_out9, doa_out10, doa_out11, doa_out12, doa_out13, doa_out14, doa_out15, doa_out16, doa_out17, doa_out18, doa_out19, doa_out20, doa_out21, doa_out22, doa_out23, doa_out24, doa_out25, doa_out26, doa_out27, doa_out28, doa_out29, doa_out30, doa_out31; - wire dopa0_out, dopa1_out, dopa2_out, dopa3_out; - - input [8:0] ADDRA; - input [31:0] DIA; - input [3:0] DIPA; - input ENA, CLKA, WEA, SSRA; - - output [31:0] DOB; - output [3:0] DOPB; - reg [31:0] dob_out; - reg [3:0] dopb_out; - wire dob_out0, dob_out1, dob_out2, dob_out3, dob_out4, dob_out5, dob_out6, dob_out7, dob_out8, dob_out9, dob_out10, dob_out11, dob_out12, dob_out13, dob_out14, dob_out15, dob_out16, dob_out17, dob_out18, dob_out19, dob_out20, dob_out21, dob_out22, dob_out23, dob_out24, dob_out25, dob_out26, dob_out27, dob_out28, dob_out29, dob_out30, dob_out31; - wire dopb0_out, dopb1_out, dopb2_out, dopb3_out; - - input [8:0] ADDRB; - input [31:0] DIB; - input [3:0] DIPB; - input ENB, CLKB, WEB, SSRB; - - reg [18431:0] mem; - reg [8:0] count; - reg [1:0] wr_mode_a, wr_mode_b; - - reg [5:0] dmi, dbi; - reg [5:0] pmi, pbi; - - wire [8:0] addra_int; - reg [8:0] addra_reg; - wire [31:0] dia_int; - wire [3:0] dipa_int; - wire ena_int, clka_int, wea_int, ssra_int; - reg ena_reg, wea_reg, ssra_reg; - wire [8:0] addrb_int; - reg [8:0] addrb_reg; - wire [31:0] dib_int; - wire [3:0] dipb_int; - wire enb_int, clkb_int, web_int, ssrb_int; - reg display_flag; - reg enb_reg, web_reg, ssrb_reg; - - time time_clka, time_clkb; - time time_clka_clkb; - time time_clkb_clka; - - reg setup_all_a_b; - reg setup_all_b_a; - reg setup_zero; - reg setup_rf_a_b; - reg setup_rf_b_a; - reg [1:0] data_collision, data_collision_a_b, data_collision_b_a; - reg memory_collision, memory_collision_a_b, memory_collision_b_a; - reg address_collision, address_collision_a_b, address_collision_b_a; - reg change_clka; - reg change_clkb; - - wire [14:0] data_addra_int; - wire [14:0] data_addra_reg; - wire [14:0] data_addrb_int; - wire [14:0] data_addrb_reg; - wire [15:0] parity_addra_int; - wire [15:0] parity_addra_reg; - wire [15:0] parity_addrb_int; - wire [15:0] parity_addrb_reg; - - tri0 GSR = glbl.GSR; - - always @(GSR) - if (GSR) begin - assign doa_out = INIT_A[31:0]; - assign dopa_out = INIT_A[35:32]; - assign dob_out = INIT_B[31:0]; - assign dopb_out = INIT_B[35:32]; - end - else begin - deassign doa_out; - deassign dopa_out; - deassign dob_out; - deassign dopb_out; - end - - buf b_doa_out0 (doa_out0, doa_out[0]); - buf b_doa_out1 (doa_out1, doa_out[1]); - buf b_doa_out2 (doa_out2, doa_out[2]); - buf b_doa_out3 (doa_out3, doa_out[3]); - buf b_doa_out4 (doa_out4, doa_out[4]); - buf b_doa_out5 (doa_out5, doa_out[5]); - buf b_doa_out6 (doa_out6, doa_out[6]); - buf b_doa_out7 (doa_out7, doa_out[7]); - buf b_doa_out8 (doa_out8, doa_out[8]); - buf b_doa_out9 (doa_out9, doa_out[9]); - buf b_doa_out10 (doa_out10, doa_out[10]); - buf b_doa_out11 (doa_out11, doa_out[11]); - buf b_doa_out12 (doa_out12, doa_out[12]); - buf b_doa_out13 (doa_out13, doa_out[13]); - buf b_doa_out14 (doa_out14, doa_out[14]); - buf b_doa_out15 (doa_out15, doa_out[15]); - buf b_doa_out16 (doa_out16, doa_out[16]); - buf b_doa_out17 (doa_out17, doa_out[17]); - buf b_doa_out18 (doa_out18, doa_out[18]); - buf b_doa_out19 (doa_out19, doa_out[19]); - buf b_doa_out20 (doa_out20, doa_out[20]); - buf b_doa_out21 (doa_out21, doa_out[21]); - buf b_doa_out22 (doa_out22, doa_out[22]); - buf b_doa_out23 (doa_out23, doa_out[23]); - buf b_doa_out24 (doa_out24, doa_out[24]); - buf b_doa_out25 (doa_out25, doa_out[25]); - buf b_doa_out26 (doa_out26, doa_out[26]); - buf b_doa_out27 (doa_out27, doa_out[27]); - buf b_doa_out28 (doa_out28, doa_out[28]); - buf b_doa_out29 (doa_out29, doa_out[29]); - buf b_doa_out30 (doa_out30, doa_out[30]); - buf b_doa_out31 (doa_out31, doa_out[31]); - buf b_dopa_out0 (dopa_out0, dopa_out[0]); - buf b_dopa_out1 (dopa_out1, dopa_out[1]); - buf b_dopa_out2 (dopa_out2, dopa_out[2]); - buf b_dopa_out3 (dopa_out3, dopa_out[3]); - buf b_dob_out0 (dob_out0, dob_out[0]); - buf b_dob_out1 (dob_out1, dob_out[1]); - buf b_dob_out2 (dob_out2, dob_out[2]); - buf b_dob_out3 (dob_out3, dob_out[3]); - buf b_dob_out4 (dob_out4, dob_out[4]); - buf b_dob_out5 (dob_out5, dob_out[5]); - buf b_dob_out6 (dob_out6, dob_out[6]); - buf b_dob_out7 (dob_out7, dob_out[7]); - buf b_dob_out8 (dob_out8, dob_out[8]); - buf b_dob_out9 (dob_out9, dob_out[9]); - buf b_dob_out10 (dob_out10, dob_out[10]); - buf b_dob_out11 (dob_out11, dob_out[11]); - buf b_dob_out12 (dob_out12, dob_out[12]); - buf b_dob_out13 (dob_out13, dob_out[13]); - buf b_dob_out14 (dob_out14, dob_out[14]); - buf b_dob_out15 (dob_out15, dob_out[15]); - buf b_dob_out16 (dob_out16, dob_out[16]); - buf b_dob_out17 (dob_out17, dob_out[17]); - buf b_dob_out18 (dob_out18, dob_out[18]); - buf b_dob_out19 (dob_out19, dob_out[19]); - buf b_dob_out20 (dob_out20, dob_out[20]); - buf b_dob_out21 (dob_out21, dob_out[21]); - buf b_dob_out22 (dob_out22, dob_out[22]); - buf b_dob_out23 (dob_out23, dob_out[23]); - buf b_dob_out24 (dob_out24, dob_out[24]); - buf b_dob_out25 (dob_out25, dob_out[25]); - buf b_dob_out26 (dob_out26, dob_out[26]); - buf b_dob_out27 (dob_out27, dob_out[27]); - buf b_dob_out28 (dob_out28, dob_out[28]); - buf b_dob_out29 (dob_out29, dob_out[29]); - buf b_dob_out30 (dob_out30, dob_out[30]); - buf b_dob_out31 (dob_out31, dob_out[31]); - buf b_dopb_out0 (dopb_out0, dopb_out[0]); - buf b_dopb_out1 (dopb_out1, dopb_out[1]); - buf b_dopb_out2 (dopb_out2, dopb_out[2]); - buf b_dopb_out3 (dopb_out3, dopb_out[3]); - - buf b_doa0 (DOA[0], doa_out0); - buf b_doa1 (DOA[1], doa_out1); - buf b_doa2 (DOA[2], doa_out2); - buf b_doa3 (DOA[3], doa_out3); - buf b_doa4 (DOA[4], doa_out4); - buf b_doa5 (DOA[5], doa_out5); - buf b_doa6 (DOA[6], doa_out6); - buf b_doa7 (DOA[7], doa_out7); - buf b_doa8 (DOA[8], doa_out8); - buf b_doa9 (DOA[9], doa_out9); - buf b_doa10 (DOA[10], doa_out10); - buf b_doa11 (DOA[11], doa_out11); - buf b_doa12 (DOA[12], doa_out12); - buf b_doa13 (DOA[13], doa_out13); - buf b_doa14 (DOA[14], doa_out14); - buf b_doa15 (DOA[15], doa_out15); - buf b_doa16 (DOA[16], doa_out16); - buf b_doa17 (DOA[17], doa_out17); - buf b_doa18 (DOA[18], doa_out18); - buf b_doa19 (DOA[19], doa_out19); - buf b_doa20 (DOA[20], doa_out20); - buf b_doa21 (DOA[21], doa_out21); - buf b_doa22 (DOA[22], doa_out22); - buf b_doa23 (DOA[23], doa_out23); - buf b_doa24 (DOA[24], doa_out24); - buf b_doa25 (DOA[25], doa_out25); - buf b_doa26 (DOA[26], doa_out26); - buf b_doa27 (DOA[27], doa_out27); - buf b_doa28 (DOA[28], doa_out28); - buf b_doa29 (DOA[29], doa_out29); - buf b_doa30 (DOA[30], doa_out30); - buf b_doa31 (DOA[31], doa_out31); - buf b_dopa0 (DOPA[0], dopa_out0); - buf b_dopa1 (DOPA[1], dopa_out1); - buf b_dopa2 (DOPA[2], dopa_out2); - buf b_dopa3 (DOPA[3], dopa_out3); - buf b_dob0 (DOB[0], dob_out0); - buf b_dob1 (DOB[1], dob_out1); - buf b_dob2 (DOB[2], dob_out2); - buf b_dob3 (DOB[3], dob_out3); - buf b_dob4 (DOB[4], dob_out4); - buf b_dob5 (DOB[5], dob_out5); - buf b_dob6 (DOB[6], dob_out6); - buf b_dob7 (DOB[7], dob_out7); - buf b_dob8 (DOB[8], dob_out8); - buf b_dob9 (DOB[9], dob_out9); - buf b_dob10 (DOB[10], dob_out10); - buf b_dob11 (DOB[11], dob_out11); - buf b_dob12 (DOB[12], dob_out12); - buf b_dob13 (DOB[13], dob_out13); - buf b_dob14 (DOB[14], dob_out14); - buf b_dob15 (DOB[15], dob_out15); - buf b_dob16 (DOB[16], dob_out16); - buf b_dob17 (DOB[17], dob_out17); - buf b_dob18 (DOB[18], dob_out18); - buf b_dob19 (DOB[19], dob_out19); - buf b_dob20 (DOB[20], dob_out20); - buf b_dob21 (DOB[21], dob_out21); - buf b_dob22 (DOB[22], dob_out22); - buf b_dob23 (DOB[23], dob_out23); - buf b_dob24 (DOB[24], dob_out24); - buf b_dob25 (DOB[25], dob_out25); - buf b_dob26 (DOB[26], dob_out26); - buf b_dob27 (DOB[27], dob_out27); - buf b_dob28 (DOB[28], dob_out28); - buf b_dob29 (DOB[29], dob_out29); - buf b_dob30 (DOB[30], dob_out30); - buf b_dob31 (DOB[31], dob_out31); - buf b_dopb0 (DOPB[0], dopb_out0); - buf b_dopb1 (DOPB[1], dopb_out1); - buf b_dopb2 (DOPB[2], dopb_out2); - buf b_dopb3 (DOPB[3], dopb_out3); - - buf b_addra_0 (addra_int[0], ADDRA[0]); - buf b_addra_1 (addra_int[1], ADDRA[1]); - buf b_addra_2 (addra_int[2], ADDRA[2]); - buf b_addra_3 (addra_int[3], ADDRA[3]); - buf b_addra_4 (addra_int[4], ADDRA[4]); - buf b_addra_5 (addra_int[5], ADDRA[5]); - buf b_addra_6 (addra_int[6], ADDRA[6]); - buf b_addra_7 (addra_int[7], ADDRA[7]); - buf b_addra_8 (addra_int[8], ADDRA[8]); - buf b_dia_0 (dia_int[0], DIA[0]); - buf b_dia_1 (dia_int[1], DIA[1]); - buf b_dia_2 (dia_int[2], DIA[2]); - buf b_dia_3 (dia_int[3], DIA[3]); - buf b_dia_4 (dia_int[4], DIA[4]); - buf b_dia_5 (dia_int[5], DIA[5]); - buf b_dia_6 (dia_int[6], DIA[6]); - buf b_dia_7 (dia_int[7], DIA[7]); - buf b_dia_8 (dia_int[8], DIA[8]); - buf b_dia_9 (dia_int[9], DIA[9]); - buf b_dia_10 (dia_int[10], DIA[10]); - buf b_dia_11 (dia_int[11], DIA[11]); - buf b_dia_12 (dia_int[12], DIA[12]); - buf b_dia_13 (dia_int[13], DIA[13]); - buf b_dia_14 (dia_int[14], DIA[14]); - buf b_dia_15 (dia_int[15], DIA[15]); - buf b_dia_16 (dia_int[16], DIA[16]); - buf b_dia_17 (dia_int[17], DIA[17]); - buf b_dia_18 (dia_int[18], DIA[18]); - buf b_dia_19 (dia_int[19], DIA[19]); - buf b_dia_20 (dia_int[20], DIA[20]); - buf b_dia_21 (dia_int[21], DIA[21]); - buf b_dia_22 (dia_int[22], DIA[22]); - buf b_dia_23 (dia_int[23], DIA[23]); - buf b_dia_24 (dia_int[24], DIA[24]); - buf b_dia_25 (dia_int[25], DIA[25]); - buf b_dia_26 (dia_int[26], DIA[26]); - buf b_dia_27 (dia_int[27], DIA[27]); - buf b_dia_28 (dia_int[28], DIA[28]); - buf b_dia_29 (dia_int[29], DIA[29]); - buf b_dia_30 (dia_int[30], DIA[30]); - buf b_dia_31 (dia_int[31], DIA[31]); - buf b_dipa_0 (dipa_int[0], DIPA[0]); - buf b_dipa_1 (dipa_int[1], DIPA[1]); - buf b_dipa_2 (dipa_int[2], DIPA[2]); - buf b_dipa_3 (dipa_int[3], DIPA[3]); - buf b_ena (ena_int, ENA); - buf b_clka (clka_int, CLKA); - buf b_ssra (ssra_int, SSRA); - buf b_wea (wea_int, WEA); - buf b_addrb_0 (addrb_int[0], ADDRB[0]); - buf b_addrb_1 (addrb_int[1], ADDRB[1]); - buf b_addrb_2 (addrb_int[2], ADDRB[2]); - buf b_addrb_3 (addrb_int[3], ADDRB[3]); - buf b_addrb_4 (addrb_int[4], ADDRB[4]); - buf b_addrb_5 (addrb_int[5], ADDRB[5]); - buf b_addrb_6 (addrb_int[6], ADDRB[6]); - buf b_addrb_7 (addrb_int[7], ADDRB[7]); - buf b_addrb_8 (addrb_int[8], ADDRB[8]); - buf b_dib_0 (dib_int[0], DIB[0]); - buf b_dib_1 (dib_int[1], DIB[1]); - buf b_dib_2 (dib_int[2], DIB[2]); - buf b_dib_3 (dib_int[3], DIB[3]); - buf b_dib_4 (dib_int[4], DIB[4]); - buf b_dib_5 (dib_int[5], DIB[5]); - buf b_dib_6 (dib_int[6], DIB[6]); - buf b_dib_7 (dib_int[7], DIB[7]); - buf b_dib_8 (dib_int[8], DIB[8]); - buf b_dib_9 (dib_int[9], DIB[9]); - buf b_dib_10 (dib_int[10], DIB[10]); - buf b_dib_11 (dib_int[11], DIB[11]); - buf b_dib_12 (dib_int[12], DIB[12]); - buf b_dib_13 (dib_int[13], DIB[13]); - buf b_dib_14 (dib_int[14], DIB[14]); - buf b_dib_15 (dib_int[15], DIB[15]); - buf b_dib_16 (dib_int[16], DIB[16]); - buf b_dib_17 (dib_int[17], DIB[17]); - buf b_dib_18 (dib_int[18], DIB[18]); - buf b_dib_19 (dib_int[19], DIB[19]); - buf b_dib_20 (dib_int[20], DIB[20]); - buf b_dib_21 (dib_int[21], DIB[21]); - buf b_dib_22 (dib_int[22], DIB[22]); - buf b_dib_23 (dib_int[23], DIB[23]); - buf b_dib_24 (dib_int[24], DIB[24]); - buf b_dib_25 (dib_int[25], DIB[25]); - buf b_dib_26 (dib_int[26], DIB[26]); - buf b_dib_27 (dib_int[27], DIB[27]); - buf b_dib_28 (dib_int[28], DIB[28]); - buf b_dib_29 (dib_int[29], DIB[29]); - buf b_dib_30 (dib_int[30], DIB[30]); - buf b_dib_31 (dib_int[31], DIB[31]); - buf b_dipb_0 (dipb_int[0], DIPB[0]); - buf b_dipb_1 (dipb_int[1], DIPB[1]); - buf b_dipb_2 (dipb_int[2], DIPB[2]); - buf b_dipb_3 (dipb_int[3], DIPB[3]); - buf b_enb (enb_int, ENB); - buf b_clkb (clkb_int, CLKB); - buf b_ssrb (ssrb_int, SSRB); - buf b_web (web_int, WEB); - - initial begin - for (count = 0; count < 256; count = count + 1) begin - mem[count] <= INIT_00[count]; - mem[256 * 1 + count] <= INIT_01[count]; - mem[256 * 2 + count] <= INIT_02[count]; - mem[256 * 3 + count] <= INIT_03[count]; - mem[256 * 4 + count] <= INIT_04[count]; - mem[256 * 5 + count] <= INIT_05[count]; - mem[256 * 6 + count] <= INIT_06[count]; - mem[256 * 7 + count] <= INIT_07[count]; - mem[256 * 8 + count] <= INIT_08[count]; - mem[256 * 9 + count] <= INIT_09[count]; - mem[256 * 10 + count] <= INIT_0A[count]; - mem[256 * 11 + count] <= INIT_0B[count]; - mem[256 * 12 + count] <= INIT_0C[count]; - mem[256 * 13 + count] <= INIT_0D[count]; - mem[256 * 14 + count] <= INIT_0E[count]; - mem[256 * 15 + count] <= INIT_0F[count]; - mem[256 * 16 + count] <= INIT_10[count]; - mem[256 * 17 + count] <= INIT_11[count]; - mem[256 * 18 + count] <= INIT_12[count]; - mem[256 * 19 + count] <= INIT_13[count]; - mem[256 * 20 + count] <= INIT_14[count]; - mem[256 * 21 + count] <= INIT_15[count]; - mem[256 * 22 + count] <= INIT_16[count]; - mem[256 * 23 + count] <= INIT_17[count]; - mem[256 * 24 + count] <= INIT_18[count]; - mem[256 * 25 + count] <= INIT_19[count]; - mem[256 * 26 + count] <= INIT_1A[count]; - mem[256 * 27 + count] <= INIT_1B[count]; - mem[256 * 28 + count] <= INIT_1C[count]; - mem[256 * 29 + count] <= INIT_1D[count]; - mem[256 * 30 + count] <= INIT_1E[count]; - mem[256 * 31 + count] <= INIT_1F[count]; - mem[256 * 32 + count] <= INIT_20[count]; - mem[256 * 33 + count] <= INIT_21[count]; - mem[256 * 34 + count] <= INIT_22[count]; - mem[256 * 35 + count] <= INIT_23[count]; - mem[256 * 36 + count] <= INIT_24[count]; - mem[256 * 37 + count] <= INIT_25[count]; - mem[256 * 38 + count] <= INIT_26[count]; - mem[256 * 39 + count] <= INIT_27[count]; - mem[256 * 40 + count] <= INIT_28[count]; - mem[256 * 41 + count] <= INIT_29[count]; - mem[256 * 42 + count] <= INIT_2A[count]; - mem[256 * 43 + count] <= INIT_2B[count]; - mem[256 * 44 + count] <= INIT_2C[count]; - mem[256 * 45 + count] <= INIT_2D[count]; - mem[256 * 46 + count] <= INIT_2E[count]; - mem[256 * 47 + count] <= INIT_2F[count]; - mem[256 * 48 + count] <= INIT_30[count]; - mem[256 * 49 + count] <= INIT_31[count]; - mem[256 * 50 + count] <= INIT_32[count]; - mem[256 * 51 + count] <= INIT_33[count]; - mem[256 * 52 + count] <= INIT_34[count]; - mem[256 * 53 + count] <= INIT_35[count]; - mem[256 * 54 + count] <= INIT_36[count]; - mem[256 * 55 + count] <= INIT_37[count]; - mem[256 * 56 + count] <= INIT_38[count]; - mem[256 * 57 + count] <= INIT_39[count]; - mem[256 * 58 + count] <= INIT_3A[count]; - mem[256 * 59 + count] <= INIT_3B[count]; - mem[256 * 60 + count] <= INIT_3C[count]; - mem[256 * 61 + count] <= INIT_3D[count]; - mem[256 * 62 + count] <= INIT_3E[count]; - mem[256 * 63 + count] <= INIT_3F[count]; - mem[256 * 64 + count] <= INITP_00[count]; - mem[256 * 65 + count] <= INITP_01[count]; - mem[256 * 66 + count] <= INITP_02[count]; - mem[256 * 67 + count] <= INITP_03[count]; - mem[256 * 68 + count] <= INITP_04[count]; - mem[256 * 69 + count] <= INITP_05[count]; - mem[256 * 70 + count] <= INITP_06[count]; - mem[256 * 71 + count] <= INITP_07[count]; - end - address_collision <= 0; - address_collision_a_b <= 0; - address_collision_b_a <= 0; - change_clka <= 0; - change_clkb <= 0; - data_collision <= 0; - data_collision_a_b <= 0; - data_collision_b_a <= 0; - memory_collision <= 0; - memory_collision_a_b <= 0; - memory_collision_b_a <= 0; - setup_all_a_b <= 0; - setup_all_b_a <= 0; - setup_zero <= 0; - setup_rf_a_b <= 0; - setup_rf_b_a <= 0; - end - - assign data_addra_int = addra_int * 32; - assign data_addra_reg = addra_reg * 32; - assign data_addrb_int = addrb_int * 32; - assign data_addrb_reg = addrb_reg * 32; - assign parity_addra_int = 16384 + addra_int * 4; - assign parity_addra_reg = 16384 + addra_reg * 4; - assign parity_addrb_int = 16384 + addrb_int * 4; - assign parity_addrb_reg = 16384 + addrb_reg * 4; - - - initial begin - - display_flag = 1; - - case (SIM_COLLISION_CHECK) - - "NONE" : begin - assign setup_all_a_b = 1'b0; - assign setup_all_b_a = 1'b0; - assign setup_zero = 1'b0; - assign setup_rf_a_b = 1'b0; - assign setup_rf_b_a = 1'b0; - assign display_flag = 0; - end - "WARNING_ONLY" : begin - assign data_collision = 2'b00; - assign data_collision_a_b = 2'b00; - assign data_collision_b_a = 2'b00; - assign memory_collision = 1'b0; - assign memory_collision_a_b = 1'b0; - assign memory_collision_b_a = 1'b0; - end - "GENERATE_X_ONLY" : begin - assign display_flag = 0; - end - "ALL" : ; - default : begin - $display("Attribute Syntax Error : The Attribute SIM_COLLISION_CHECK on RAMB16_S36_S36 instance %m is set to %s. Legal values for this attribute are ALL, NONE, WARNING_ONLY or GENERATE_X_ONLY.", SIM_COLLISION_CHECK); - $finish; - end - - endcase // case(SIM_COLLISION_CHECK) - - end // initial begin - - - always @(posedge clka_int) begin - time_clka = $time; - #0 time_clkb_clka = time_clka - time_clkb; - change_clka = ~change_clka; - end - - always @(posedge clkb_int) begin - time_clkb = $time; - #0 time_clka_clkb = time_clkb - time_clka; - change_clkb = ~change_clkb; - end - - always @(change_clkb) begin - if ((0 < time_clka_clkb) && (time_clka_clkb < SETUP_ALL)) - setup_all_a_b = 1; - if ((0 < time_clka_clkb) && (time_clka_clkb < SETUP_READ_FIRST)) - setup_rf_a_b = 1; - end - - always @(change_clka) begin - if ((0 < time_clkb_clka) && (time_clkb_clka < SETUP_ALL)) - setup_all_b_a = 1; - if ((0 < time_clkb_clka) && (time_clkb_clka < SETUP_READ_FIRST)) - setup_rf_b_a = 1; - end - - always @(change_clkb or change_clka) begin - if ((time_clkb_clka == 0) && (time_clka_clkb == 0)) - setup_zero = 1; - end - - always @(posedge setup_zero) begin - if ((ena_int == 1) && (wea_int == 1) && - (enb_int == 1) && (web_int == 1) && - (data_addra_int[14:5] == data_addrb_int[14:5])) - memory_collision <= 1; - end - - always @(posedge setup_all_a_b or posedge setup_rf_a_b) begin - if ((ena_reg == 1) && (wea_reg == 1) && - (enb_int == 1) && (web_int == 1) && - (data_addra_reg[14:5] == data_addrb_int[14:5])) - memory_collision_a_b <= 1; - end - - always @(posedge setup_all_b_a or posedge setup_rf_b_a) begin - if ((ena_int == 1) && (wea_int == 1) && - (enb_reg == 1) && (web_reg == 1) && - (data_addra_int[14:5] == data_addrb_reg[14:5])) - memory_collision_b_a <= 1; - end - - always @(posedge setup_all_a_b) begin - if (data_addra_reg[14:5] == data_addrb_int[14:5]) begin - if ((ena_reg == 1) && (enb_int == 1)) begin - case ({wr_mode_a, wr_mode_b, wea_reg, web_int}) - 6'b000011 : begin data_collision_a_b <= 2'b11; display_wa_wb; end - 6'b000111 : begin data_collision_a_b <= 2'b11; display_wa_wb; end - 6'b001011 : begin data_collision_a_b <= 2'b10; display_wa_wb; end -// 6'b010011 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b010111 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b011011 : begin data_collision_a_b <= 2'b00; display_wa_wb; end - 6'b100011 : begin data_collision_a_b <= 2'b01; display_wa_wb; end - 6'b100111 : begin data_collision_a_b <= 2'b01; display_wa_wb; end - 6'b101011 : begin display_wa_wb; end - 6'b000001 : begin data_collision_a_b <= 2'b10; display_ra_wb; end -// 6'b000101 : begin data_collision_a_b <= 2'b00; display_ra_wb; end - 6'b001001 : begin data_collision_a_b <= 2'b10; display_ra_wb; end - 6'b010001 : begin data_collision_a_b <= 2'b10; display_ra_wb; end -// 6'b010101 : begin data_collision_a_b <= 2'b00; display_ra_wb; end - 6'b011001 : begin data_collision_a_b <= 2'b10; display_ra_wb; end - 6'b100001 : begin data_collision_a_b <= 2'b10; display_ra_wb; end -// 6'b100101 : begin data_collision_a_b <= 2'b00; display_ra_wb; end - 6'b101001 : begin data_collision_a_b <= 2'b10; display_ra_wb; end - 6'b000010 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - 6'b000110 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - 6'b001010 : begin data_collision_a_b <= 2'b01; display_wa_rb; end -// 6'b010010 : begin data_collision_a_b <= 2'b00; display_wa_rb; end -// 6'b010110 : begin data_collision_a_b <= 2'b00; display_wa_rb; end -// 6'b011010 : begin data_collision_a_b <= 2'b00; display_wa_rb; end - 6'b100010 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - 6'b100110 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - 6'b101010 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - endcase - end - end - setup_all_a_b <= 0; - end - - - always @(posedge setup_all_b_a) begin - if (data_addra_int[14:5] == data_addrb_reg[14:5]) begin - if ((ena_int == 1) && (enb_reg == 1)) begin - case ({wr_mode_a, wr_mode_b, wea_int, web_reg}) - 6'b000011 : begin data_collision_b_a <= 2'b11; display_wa_wb; end -// 6'b000111 : begin data_collision_b_a <= 2'b00; display_wa_wb; end - 6'b001011 : begin data_collision_b_a <= 2'b10; display_wa_wb; end - 6'b010011 : begin data_collision_b_a <= 2'b11; display_wa_wb; end -// 6'b010111 : begin data_collision_b_a <= 2'b00; display_wa_wb; end - 6'b011011 : begin data_collision_b_a <= 2'b10; display_wa_wb; end - 6'b100011 : begin data_collision_b_a <= 2'b01; display_wa_wb; end - 6'b100111 : begin data_collision_b_a <= 2'b01; display_wa_wb; end - 6'b101011 : begin display_wa_wb; end - 6'b000001 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b000101 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b001001 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b010001 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b010101 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b011001 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b100001 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b100101 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b101001 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b000010 : begin data_collision_b_a <= 2'b01; display_wa_rb; end - 6'b000110 : begin data_collision_b_a <= 2'b01; display_wa_rb; end - 6'b001010 : begin data_collision_b_a <= 2'b01; display_wa_rb; end -// 6'b010010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b010110 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b011010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end - 6'b100010 : begin data_collision_b_a <= 2'b01; display_wa_rb; end - 6'b100110 : begin data_collision_b_a <= 2'b01; display_wa_rb; end - 6'b101010 : begin data_collision_b_a <= 2'b01; display_wa_rb; end - endcase - end - end - setup_all_b_a <= 0; - end - - - always @(posedge setup_zero) begin - if (data_addra_int[14:5] == data_addrb_int[14:5]) begin - if ((ena_int == 1) && (enb_int == 1)) begin - case ({wr_mode_a, wr_mode_b, wea_int, web_int}) - 6'b000011 : begin data_collision <= 2'b11; display_wa_wb; end - 6'b000111 : begin data_collision <= 2'b11; display_wa_wb; end - 6'b001011 : begin data_collision <= 2'b10; display_wa_wb; end - 6'b010011 : begin data_collision <= 2'b11; display_wa_wb; end - 6'b010111 : begin data_collision <= 2'b11; display_wa_wb; end - 6'b011011 : begin data_collision <= 2'b10; display_wa_wb; end - 6'b100011 : begin data_collision <= 2'b01; display_wa_wb; end - 6'b100111 : begin data_collision <= 2'b01; display_wa_wb; end - 6'b101011 : begin display_wa_wb; end - 6'b000001 : begin data_collision <= 2'b10; display_ra_wb; end -// 6'b000101 : begin data_collision <= 2'b00; display_ra_wb; end - 6'b001001 : begin data_collision <= 2'b10; display_ra_wb; end - 6'b010001 : begin data_collision <= 2'b10; display_ra_wb; end -// 6'b010101 : begin data_collision <= 2'b00; display_ra_wb; end - 6'b011001 : begin data_collision <= 2'b10; display_ra_wb; end - 6'b100001 : begin data_collision <= 2'b10; display_ra_wb; end -// 6'b100101 : begin data_collision <= 2'b00; display_ra_wb; end - 6'b101001 : begin data_collision <= 2'b10; display_ra_wb; end - 6'b000010 : begin data_collision <= 2'b01; display_wa_rb; end - 6'b000110 : begin data_collision <= 2'b01; display_wa_rb; end - 6'b001010 : begin data_collision <= 2'b01; display_wa_rb; end -// 6'b010010 : begin data_collision <= 2'b00; display_wa_rb; end -// 6'b010110 : begin data_collision <= 2'b00; display_wa_rb; end -// 6'b011010 : begin data_collision <= 2'b00; display_wa_rb; end - 6'b100010 : begin data_collision <= 2'b01; display_wa_rb; end - 6'b100110 : begin data_collision <= 2'b01; display_wa_rb; end - 6'b101010 : begin data_collision <= 2'b01; display_wa_rb; end - endcase - end - end - setup_zero <= 0; - end - - task display_ra_wb; - begin - if (display_flag) - $display("Memory Collision Error on RAMB16_S36_S36:%m at simulation time %.3f ns\nA read was performed on address %h (hex) of Port A while a write was requested to the same address on Port B. The write will be successful however the read value on Port A is unknown until the next CLKA cycle.", $time/1000.0, addra_int); - end - endtask - - task display_wa_rb; - begin - if (display_flag) - $display("Memory Collision Error on RAMB16_S36_S36:%m at simulation time %.3f ns\nA read was performed on address %h (hex) of Port B while a write was requested to the same address on Port A. The write will be successful however the read value on Port B is unknown until the next CLKB cycle.", $time/1000.0, addrb_int); - end - endtask - - task display_wa_wb; - begin - if (display_flag) - $display("Memory Collision Error on RAMB16_S36_S36:%m at simulation time %.3f ns\nA write was requested to the same address simultaneously at both Port A and Port B of the RAM. The contents written to the RAM at address location %h (hex) of Port A and address location %h (hex) of Port B are unknown.", $time/1000.0, addra_int, addrb_int); - end - endtask - - - always @(posedge setup_rf_a_b) begin - if (data_addra_reg[14:5] == data_addrb_int[14:5]) begin - if ((ena_reg == 1) && (enb_int == 1)) begin - case ({wr_mode_a, wr_mode_b, wea_reg, web_int}) -// 6'b000011 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b000111 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b001011 : begin data_collision_a_b <= 2'b00; display_wa_wb; end - 6'b010011 : begin data_collision_a_b <= 2'b11; display_wa_wb; end - 6'b010111 : begin data_collision_a_b <= 2'b11; display_wa_wb; end - 6'b011011 : begin data_collision_a_b <= 2'b10; display_wa_wb; end -// 6'b100011 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b100111 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b101011 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b000001 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b000101 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b001001 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b010001 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b010101 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b011001 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b100001 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b100101 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b101001 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b000010 : begin data_collision_a_b <= 2'b00; display_wa_rb; end -// 6'b000110 : begin data_collision_a_b <= 2'b00; display_wa_rb; end -// 6'b001010 : begin data_collision_a_b <= 2'b00; display_wa_rb; end - 6'b010010 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - 6'b010110 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - 6'b011010 : begin data_collision_a_b <= 2'b01; display_wa_rb; end -// 6'b100010 : begin data_collision_a_b <= 2'b00; display_wa_rb; end -// 6'b100110 : begin data_collision_a_b <= 2'b00; display_wa_rb; end -// 6'b101010 : begin data_collision_a_b <= 2'b00; display_wa_rb; end - endcase - end - end - setup_rf_a_b <= 0; - end - - - always @(posedge setup_rf_b_a) begin - if (data_addra_int[14:5] == data_addrb_reg[14:5]) begin - if ((ena_int == 1) && (enb_reg == 1)) begin - case ({wr_mode_a, wr_mode_b, wea_int, web_reg}) -// 6'b000011 : begin data_collision_b_a <= 2'b00; display_wa_wb; end - 6'b000111 : begin data_collision_b_a <= 2'b11; display_wa_wb; end -// 6'b001011 : begin data_collision_b_a <= 2'b00; display_wa_wb; end -// 6'b010011 : begin data_collision_b_a <= 2'b00; display_wa_wb; end - 6'b010111 : begin data_collision_b_a <= 2'b11; display_wa_wb; end -// 6'b011011 : begin data_collision_b_a <= 2'b00; display_wa_wb; end -// 6'b100011 : begin data_collision_b_a <= 2'b00; display_wa_wb; end - 6'b100111 : begin data_collision_b_a <= 2'b01; display_wa_wb; end -// 6'b101011 : begin data_collision_b_a <= 2'b00; display_wa_wb; end -// 6'b000001 : begin data_collision_b_a <= 2'b00; display_ra_wb; end - 6'b000101 : begin data_collision_b_a <= 2'b10; display_ra_wb; end -// 6'b001001 : begin data_collision_b_a <= 2'b00; display_ra_wb; end -// 6'b010001 : begin data_collision_b_a <= 2'b00; display_ra_wb; end - 6'b010101 : begin data_collision_b_a <= 2'b10; display_ra_wb; end -// 6'b011001 : begin data_collision_b_a <= 2'b00; display_ra_wb; end -// 6'b100001 : begin data_collision_b_a <= 2'b00; display_ra_wb; end - 6'b100101 : begin data_collision_b_a <= 2'b10; display_ra_wb; end -// 6'b101001 : begin data_collision_b_a <= 2'b00; display_ra_wb; end -// 6'b000010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b000110 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b001010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b010010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b010110 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b011010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b100010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b100110 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b101010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end - endcase - end - end - setup_rf_b_a <= 0; - end - - - always @(posedge clka_int) begin - addra_reg <= addra_int; - ena_reg <= ena_int; - ssra_reg <= ssra_int; - wea_reg <= wea_int; - end - - always @(posedge clkb_int) begin - addrb_reg <= addrb_int; - enb_reg <= enb_int; - ssrb_reg <= ssrb_int; - web_reg <= web_int; - end - - // Data - always @(posedge memory_collision) begin - for (dmi = 0; dmi < 32; dmi = dmi + 1) begin - mem[data_addra_int + dmi] <= 1'bX; - end - memory_collision <= 0; - end - - always @(posedge memory_collision_a_b) begin - for (dmi = 0; dmi < 32; dmi = dmi + 1) begin - mem[data_addra_reg + dmi] <= 1'bX; - end - memory_collision_a_b <= 0; - end - - always @(posedge memory_collision_b_a) begin - for (dmi = 0; dmi < 32; dmi = dmi + 1) begin - mem[data_addra_int + dmi] <= 1'bX; - end - memory_collision_b_a <= 0; - end - - always @(posedge data_collision[1]) begin - if (ssra_int == 0) begin - doa_out <= 32'bX; - end - data_collision[1] <= 0; - end - - always @(posedge data_collision[0]) begin - if (ssrb_int == 0) begin - dob_out <= 32'bX; - end - data_collision[0] <= 0; - end - - always @(posedge data_collision_a_b[1]) begin - if (ssra_reg == 0) begin - doa_out <= 32'bX; - end - data_collision_a_b[1] <= 0; - end - - always @(posedge data_collision_a_b[0]) begin - if (ssrb_int == 0) begin - dob_out <= 32'bX; - end - data_collision_a_b[0] <= 0; - end - - always @(posedge data_collision_b_a[1]) begin - if (ssra_int == 0) begin - doa_out <= 32'bX; - end - data_collision_b_a[1] <= 0; - end - - always @(posedge data_collision_b_a[0]) begin - if (ssrb_reg == 0) begin - dob_out <= 32'bX; - end - data_collision_b_a[0] <= 0; - end - - - // Parity - always @(posedge memory_collision) begin - for (pmi = 0; pmi < 4; pmi = pmi + 1) begin - mem[parity_addra_int + pmi] <= 1'bX; - end - end - - always @(posedge memory_collision_a_b) begin - for (pmi = 0; pmi < 4; pmi = pmi + 1) begin - mem[parity_addra_reg + pmi] <= 1'bX; - end - end - - always @(posedge memory_collision_b_a) begin - for (pmi = 0; pmi < 4; pmi = pmi + 1) begin - mem[parity_addra_int + pmi] <= 1'bX; - end - end - - always @(posedge data_collision[1]) begin - if (ssra_int == 0) begin - dopa_out <= 4'bX; - end - end - - always @(posedge data_collision[0]) begin - if (ssrb_int == 0) begin - dopb_out <= 4'bX; - end - end - - always @(posedge data_collision_a_b[1]) begin - if (ssra_reg == 0) begin - dopa_out <= 4'bX; - end - end - - always @(posedge data_collision_a_b[0]) begin - if (ssrb_int == 0) begin - dopb_out <= 4'bX; - end - end - - always @(posedge data_collision_b_a[1]) begin - if (ssra_int == 0) begin - dopa_out <= 4'bX; - end - end - - always @(posedge data_collision_b_a[0]) begin - if (ssrb_reg == 0) begin - dopb_out <= 4'bX; - end - end - - - initial begin - case (WRITE_MODE_A) - "WRITE_FIRST" : wr_mode_a <= 2'b00; - "READ_FIRST" : wr_mode_a <= 2'b01; - "NO_CHANGE" : wr_mode_a <= 2'b10; - default : begin - $display("Attribute Syntax Error : The Attribute WRITE_MODE_A on RAMB16_S36_S36 instance %m is set to %s. Legal values for this attribute are WRITE_FIRST, READ_FIRST or NO_CHANGE.", WRITE_MODE_A); - $finish; - end - endcase - end - - initial begin - case (WRITE_MODE_B) - "WRITE_FIRST" : wr_mode_b <= 2'b00; - "READ_FIRST" : wr_mode_b <= 2'b01; - "NO_CHANGE" : wr_mode_b <= 2'b10; - default : begin - $display("Attribute Syntax Error : The Attribute WRITE_MODE_B on RAMB16_S36_S36 instance %m is set to %s. Legal values for this attribute are WRITE_FIRST, READ_FIRST or NO_CHANGE.", WRITE_MODE_B); - $finish; - end - endcase - end - - // Port A - always @(posedge clka_int) begin - if (ena_int == 1'b1) begin - if (ssra_int == 1'b1) begin - doa_out[0] <= SRVAL_A[0]; - doa_out[1] <= SRVAL_A[1]; - doa_out[2] <= SRVAL_A[2]; - doa_out[3] <= SRVAL_A[3]; - doa_out[4] <= SRVAL_A[4]; - doa_out[5] <= SRVAL_A[5]; - doa_out[6] <= SRVAL_A[6]; - doa_out[7] <= SRVAL_A[7]; - doa_out[8] <= SRVAL_A[8]; - doa_out[9] <= SRVAL_A[9]; - doa_out[10] <= SRVAL_A[10]; - doa_out[11] <= SRVAL_A[11]; - doa_out[12] <= SRVAL_A[12]; - doa_out[13] <= SRVAL_A[13]; - doa_out[14] <= SRVAL_A[14]; - doa_out[15] <= SRVAL_A[15]; - doa_out[16] <= SRVAL_A[16]; - doa_out[17] <= SRVAL_A[17]; - doa_out[18] <= SRVAL_A[18]; - doa_out[19] <= SRVAL_A[19]; - doa_out[20] <= SRVAL_A[20]; - doa_out[21] <= SRVAL_A[21]; - doa_out[22] <= SRVAL_A[22]; - doa_out[23] <= SRVAL_A[23]; - doa_out[24] <= SRVAL_A[24]; - doa_out[25] <= SRVAL_A[25]; - doa_out[26] <= SRVAL_A[26]; - doa_out[27] <= SRVAL_A[27]; - doa_out[28] <= SRVAL_A[28]; - doa_out[29] <= SRVAL_A[29]; - doa_out[30] <= SRVAL_A[30]; - doa_out[31] <= SRVAL_A[31]; - dopa_out[0] <= SRVAL_A[32]; - dopa_out[1] <= SRVAL_A[33]; - dopa_out[2] <= SRVAL_A[34]; - dopa_out[3] <= SRVAL_A[35]; - end - else begin - if (wea_int == 1'b1) begin - if (wr_mode_a == 2'b00) begin - doa_out <= dia_int; - dopa_out <= dipa_int; - end - else if (wr_mode_a == 2'b01) begin - doa_out[0] <= mem[data_addra_int + 0]; - doa_out[1] <= mem[data_addra_int + 1]; - doa_out[2] <= mem[data_addra_int + 2]; - doa_out[3] <= mem[data_addra_int + 3]; - doa_out[4] <= mem[data_addra_int + 4]; - doa_out[5] <= mem[data_addra_int + 5]; - doa_out[6] <= mem[data_addra_int + 6]; - doa_out[7] <= mem[data_addra_int + 7]; - doa_out[8] <= mem[data_addra_int + 8]; - doa_out[9] <= mem[data_addra_int + 9]; - doa_out[10] <= mem[data_addra_int + 10]; - doa_out[11] <= mem[data_addra_int + 11]; - doa_out[12] <= mem[data_addra_int + 12]; - doa_out[13] <= mem[data_addra_int + 13]; - doa_out[14] <= mem[data_addra_int + 14]; - doa_out[15] <= mem[data_addra_int + 15]; - doa_out[16] <= mem[data_addra_int + 16]; - doa_out[17] <= mem[data_addra_int + 17]; - doa_out[18] <= mem[data_addra_int + 18]; - doa_out[19] <= mem[data_addra_int + 19]; - doa_out[20] <= mem[data_addra_int + 20]; - doa_out[21] <= mem[data_addra_int + 21]; - doa_out[22] <= mem[data_addra_int + 22]; - doa_out[23] <= mem[data_addra_int + 23]; - doa_out[24] <= mem[data_addra_int + 24]; - doa_out[25] <= mem[data_addra_int + 25]; - doa_out[26] <= mem[data_addra_int + 26]; - doa_out[27] <= mem[data_addra_int + 27]; - doa_out[28] <= mem[data_addra_int + 28]; - doa_out[29] <= mem[data_addra_int + 29]; - doa_out[30] <= mem[data_addra_int + 30]; - doa_out[31] <= mem[data_addra_int + 31]; - dopa_out[0] <= mem[parity_addra_int + 0]; - dopa_out[1] <= mem[parity_addra_int + 1]; - dopa_out[2] <= mem[parity_addra_int + 2]; - dopa_out[3] <= mem[parity_addra_int + 3]; - end - end - else begin - doa_out[0] <= mem[data_addra_int + 0]; - doa_out[1] <= mem[data_addra_int + 1]; - doa_out[2] <= mem[data_addra_int + 2]; - doa_out[3] <= mem[data_addra_int + 3]; - doa_out[4] <= mem[data_addra_int + 4]; - doa_out[5] <= mem[data_addra_int + 5]; - doa_out[6] <= mem[data_addra_int + 6]; - doa_out[7] <= mem[data_addra_int + 7]; - doa_out[8] <= mem[data_addra_int + 8]; - doa_out[9] <= mem[data_addra_int + 9]; - doa_out[10] <= mem[data_addra_int + 10]; - doa_out[11] <= mem[data_addra_int + 11]; - doa_out[12] <= mem[data_addra_int + 12]; - doa_out[13] <= mem[data_addra_int + 13]; - doa_out[14] <= mem[data_addra_int + 14]; - doa_out[15] <= mem[data_addra_int + 15]; - doa_out[16] <= mem[data_addra_int + 16]; - doa_out[17] <= mem[data_addra_int + 17]; - doa_out[18] <= mem[data_addra_int + 18]; - doa_out[19] <= mem[data_addra_int + 19]; - doa_out[20] <= mem[data_addra_int + 20]; - doa_out[21] <= mem[data_addra_int + 21]; - doa_out[22] <= mem[data_addra_int + 22]; - doa_out[23] <= mem[data_addra_int + 23]; - doa_out[24] <= mem[data_addra_int + 24]; - doa_out[25] <= mem[data_addra_int + 25]; - doa_out[26] <= mem[data_addra_int + 26]; - doa_out[27] <= mem[data_addra_int + 27]; - doa_out[28] <= mem[data_addra_int + 28]; - doa_out[29] <= mem[data_addra_int + 29]; - doa_out[30] <= mem[data_addra_int + 30]; - doa_out[31] <= mem[data_addra_int + 31]; - dopa_out[0] <= mem[parity_addra_int + 0]; - dopa_out[1] <= mem[parity_addra_int + 1]; - dopa_out[2] <= mem[parity_addra_int + 2]; - dopa_out[3] <= mem[parity_addra_int + 3]; - end - end - end - end - - always @(posedge clka_int) begin - if (ena_int == 1'b1 && wea_int == 1'b1) begin - mem[data_addra_int + 0] <= dia_int[0]; - mem[data_addra_int + 1] <= dia_int[1]; - mem[data_addra_int + 2] <= dia_int[2]; - mem[data_addra_int + 3] <= dia_int[3]; - mem[data_addra_int + 4] <= dia_int[4]; - mem[data_addra_int + 5] <= dia_int[5]; - mem[data_addra_int + 6] <= dia_int[6]; - mem[data_addra_int + 7] <= dia_int[7]; - mem[data_addra_int + 8] <= dia_int[8]; - mem[data_addra_int + 9] <= dia_int[9]; - mem[data_addra_int + 10] <= dia_int[10]; - mem[data_addra_int + 11] <= dia_int[11]; - mem[data_addra_int + 12] <= dia_int[12]; - mem[data_addra_int + 13] <= dia_int[13]; - mem[data_addra_int + 14] <= dia_int[14]; - mem[data_addra_int + 15] <= dia_int[15]; - mem[data_addra_int + 16] <= dia_int[16]; - mem[data_addra_int + 17] <= dia_int[17]; - mem[data_addra_int + 18] <= dia_int[18]; - mem[data_addra_int + 19] <= dia_int[19]; - mem[data_addra_int + 20] <= dia_int[20]; - mem[data_addra_int + 21] <= dia_int[21]; - mem[data_addra_int + 22] <= dia_int[22]; - mem[data_addra_int + 23] <= dia_int[23]; - mem[data_addra_int + 24] <= dia_int[24]; - mem[data_addra_int + 25] <= dia_int[25]; - mem[data_addra_int + 26] <= dia_int[26]; - mem[data_addra_int + 27] <= dia_int[27]; - mem[data_addra_int + 28] <= dia_int[28]; - mem[data_addra_int + 29] <= dia_int[29]; - mem[data_addra_int + 30] <= dia_int[30]; - mem[data_addra_int + 31] <= dia_int[31]; - mem[parity_addra_int + 0] <= dipa_int[0]; - mem[parity_addra_int + 1] <= dipa_int[1]; - mem[parity_addra_int + 2] <= dipa_int[2]; - mem[parity_addra_int + 3] <= dipa_int[3]; - end - end - - // Port B - always @(posedge clkb_int) begin - if (enb_int == 1'b1) begin - if (ssrb_int == 1'b1) begin - dob_out[0] <= SRVAL_B[0]; - dob_out[1] <= SRVAL_B[1]; - dob_out[2] <= SRVAL_B[2]; - dob_out[3] <= SRVAL_B[3]; - dob_out[4] <= SRVAL_B[4]; - dob_out[5] <= SRVAL_B[5]; - dob_out[6] <= SRVAL_B[6]; - dob_out[7] <= SRVAL_B[7]; - dob_out[8] <= SRVAL_B[8]; - dob_out[9] <= SRVAL_B[9]; - dob_out[10] <= SRVAL_B[10]; - dob_out[11] <= SRVAL_B[11]; - dob_out[12] <= SRVAL_B[12]; - dob_out[13] <= SRVAL_B[13]; - dob_out[14] <= SRVAL_B[14]; - dob_out[15] <= SRVAL_B[15]; - dob_out[16] <= SRVAL_B[16]; - dob_out[17] <= SRVAL_B[17]; - dob_out[18] <= SRVAL_B[18]; - dob_out[19] <= SRVAL_B[19]; - dob_out[20] <= SRVAL_B[20]; - dob_out[21] <= SRVAL_B[21]; - dob_out[22] <= SRVAL_B[22]; - dob_out[23] <= SRVAL_B[23]; - dob_out[24] <= SRVAL_B[24]; - dob_out[25] <= SRVAL_B[25]; - dob_out[26] <= SRVAL_B[26]; - dob_out[27] <= SRVAL_B[27]; - dob_out[28] <= SRVAL_B[28]; - dob_out[29] <= SRVAL_B[29]; - dob_out[30] <= SRVAL_B[30]; - dob_out[31] <= SRVAL_B[31]; - dopb_out[0] <= SRVAL_B[32]; - dopb_out[1] <= SRVAL_B[33]; - dopb_out[2] <= SRVAL_B[34]; - dopb_out[3] <= SRVAL_B[35]; - end - else begin - if (web_int == 1'b1) begin - if (wr_mode_b == 2'b00) begin - dob_out <= dib_int; - dopb_out <= dipb_int; - end - else if (wr_mode_b == 2'b01) begin - dob_out[0] <= mem[data_addrb_int + 0]; - dob_out[1] <= mem[data_addrb_int + 1]; - dob_out[2] <= mem[data_addrb_int + 2]; - dob_out[3] <= mem[data_addrb_int + 3]; - dob_out[4] <= mem[data_addrb_int + 4]; - dob_out[5] <= mem[data_addrb_int + 5]; - dob_out[6] <= mem[data_addrb_int + 6]; - dob_out[7] <= mem[data_addrb_int + 7]; - dob_out[8] <= mem[data_addrb_int + 8]; - dob_out[9] <= mem[data_addrb_int + 9]; - dob_out[10] <= mem[data_addrb_int + 10]; - dob_out[11] <= mem[data_addrb_int + 11]; - dob_out[12] <= mem[data_addrb_int + 12]; - dob_out[13] <= mem[data_addrb_int + 13]; - dob_out[14] <= mem[data_addrb_int + 14]; - dob_out[15] <= mem[data_addrb_int + 15]; - dob_out[16] <= mem[data_addrb_int + 16]; - dob_out[17] <= mem[data_addrb_int + 17]; - dob_out[18] <= mem[data_addrb_int + 18]; - dob_out[19] <= mem[data_addrb_int + 19]; - dob_out[20] <= mem[data_addrb_int + 20]; - dob_out[21] <= mem[data_addrb_int + 21]; - dob_out[22] <= mem[data_addrb_int + 22]; - dob_out[23] <= mem[data_addrb_int + 23]; - dob_out[24] <= mem[data_addrb_int + 24]; - dob_out[25] <= mem[data_addrb_int + 25]; - dob_out[26] <= mem[data_addrb_int + 26]; - dob_out[27] <= mem[data_addrb_int + 27]; - dob_out[28] <= mem[data_addrb_int + 28]; - dob_out[29] <= mem[data_addrb_int + 29]; - dob_out[30] <= mem[data_addrb_int + 30]; - dob_out[31] <= mem[data_addrb_int + 31]; - dopb_out[0] <= mem[parity_addrb_int + 0]; - dopb_out[1] <= mem[parity_addrb_int + 1]; - dopb_out[2] <= mem[parity_addrb_int + 2]; - dopb_out[3] <= mem[parity_addrb_int + 3]; - end - end - else begin - dob_out[0] <= mem[data_addrb_int + 0]; - dob_out[1] <= mem[data_addrb_int + 1]; - dob_out[2] <= mem[data_addrb_int + 2]; - dob_out[3] <= mem[data_addrb_int + 3]; - dob_out[4] <= mem[data_addrb_int + 4]; - dob_out[5] <= mem[data_addrb_int + 5]; - dob_out[6] <= mem[data_addrb_int + 6]; - dob_out[7] <= mem[data_addrb_int + 7]; - dob_out[8] <= mem[data_addrb_int + 8]; - dob_out[9] <= mem[data_addrb_int + 9]; - dob_out[10] <= mem[data_addrb_int + 10]; - dob_out[11] <= mem[data_addrb_int + 11]; - dob_out[12] <= mem[data_addrb_int + 12]; - dob_out[13] <= mem[data_addrb_int + 13]; - dob_out[14] <= mem[data_addrb_int + 14]; - dob_out[15] <= mem[data_addrb_int + 15]; - dob_out[16] <= mem[data_addrb_int + 16]; - dob_out[17] <= mem[data_addrb_int + 17]; - dob_out[18] <= mem[data_addrb_int + 18]; - dob_out[19] <= mem[data_addrb_int + 19]; - dob_out[20] <= mem[data_addrb_int + 20]; - dob_out[21] <= mem[data_addrb_int + 21]; - dob_out[22] <= mem[data_addrb_int + 22]; - dob_out[23] <= mem[data_addrb_int + 23]; - dob_out[24] <= mem[data_addrb_int + 24]; - dob_out[25] <= mem[data_addrb_int + 25]; - dob_out[26] <= mem[data_addrb_int + 26]; - dob_out[27] <= mem[data_addrb_int + 27]; - dob_out[28] <= mem[data_addrb_int + 28]; - dob_out[29] <= mem[data_addrb_int + 29]; - dob_out[30] <= mem[data_addrb_int + 30]; - dob_out[31] <= mem[data_addrb_int + 31]; - dopb_out[0] <= mem[parity_addrb_int + 0]; - dopb_out[1] <= mem[parity_addrb_int + 1]; - dopb_out[2] <= mem[parity_addrb_int + 2]; - dopb_out[3] <= mem[parity_addrb_int + 3]; - end - end - end - end - - always @(posedge clkb_int) begin - if (enb_int == 1'b1 && web_int == 1'b1) begin - mem[data_addrb_int + 0] <= dib_int[0]; - mem[data_addrb_int + 1] <= dib_int[1]; - mem[data_addrb_int + 2] <= dib_int[2]; - mem[data_addrb_int + 3] <= dib_int[3]; - mem[data_addrb_int + 4] <= dib_int[4]; - mem[data_addrb_int + 5] <= dib_int[5]; - mem[data_addrb_int + 6] <= dib_int[6]; - mem[data_addrb_int + 7] <= dib_int[7]; - mem[data_addrb_int + 8] <= dib_int[8]; - mem[data_addrb_int + 9] <= dib_int[9]; - mem[data_addrb_int + 10] <= dib_int[10]; - mem[data_addrb_int + 11] <= dib_int[11]; - mem[data_addrb_int + 12] <= dib_int[12]; - mem[data_addrb_int + 13] <= dib_int[13]; - mem[data_addrb_int + 14] <= dib_int[14]; - mem[data_addrb_int + 15] <= dib_int[15]; - mem[data_addrb_int + 16] <= dib_int[16]; - mem[data_addrb_int + 17] <= dib_int[17]; - mem[data_addrb_int + 18] <= dib_int[18]; - mem[data_addrb_int + 19] <= dib_int[19]; - mem[data_addrb_int + 20] <= dib_int[20]; - mem[data_addrb_int + 21] <= dib_int[21]; - mem[data_addrb_int + 22] <= dib_int[22]; - mem[data_addrb_int + 23] <= dib_int[23]; - mem[data_addrb_int + 24] <= dib_int[24]; - mem[data_addrb_int + 25] <= dib_int[25]; - mem[data_addrb_int + 26] <= dib_int[26]; - mem[data_addrb_int + 27] <= dib_int[27]; - mem[data_addrb_int + 28] <= dib_int[28]; - mem[data_addrb_int + 29] <= dib_int[29]; - mem[data_addrb_int + 30] <= dib_int[30]; - mem[data_addrb_int + 31] <= dib_int[31]; - mem[parity_addrb_int + 0] <= dipb_int[0]; - mem[parity_addrb_int + 1] <= dipb_int[1]; - mem[parity_addrb_int + 2] <= dipb_int[2]; - mem[parity_addrb_int + 3] <= dipb_int[3]; - end - end - - specify - (CLKA *> DOA) = (100, 100); - (CLKA *> DOPA) = (100, 100); - (CLKB *> DOB) = (100, 100); - (CLKB *> DOPB) = (100, 100); - endspecify - -endmodule - -`else - -// $Header: /devl/xcs/repo/env/Databases/CAEInterfaces/verunilibs/data/unisims/RAMB16_S36_S36.v,v 1.9 2005/03/14 22:54:41 wloo Exp $ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 1995/2005 Xilinx, Inc. -// All Right Reserved. -/////////////////////////////////////////////////////////////////////////////// -// ____ ____ -// / /\/ / -// /___/ \ / Vendor : Xilinx -// \ \ \/ Version : 8.1i (I.13) -// \ \ Description : Xilinx Timing Simulation Library Component -// / / 16K-Bit Data and 2K-Bit Parity Dual Port Block RAM -// /___/ /\ Filename : RAMB16_S36_S36.v -// \ \ / \ Timestamp : Thu Mar 10 16:44:01 PST 2005 -// \___\/\___\ -// -// Revision: -// 03/23/04 - Initial version. -// 03/10/05 - Initialized outputs. -// End Revision - -`timescale 1 ps/1 ps - -module RAMB16_S36_S36 (DOA, DOB, DOPA, DOPB, ADDRA, ADDRB, CLKA, CLKB, DIA, DIB, DIPA, DIPB, ENA, ENB, SSRA, SSRB, WEA, WEB); - - parameter INIT_A = 36'h0; - parameter INIT_B = 36'h0; - parameter SRVAL_A = 36'h0; - parameter SRVAL_B = 36'h0; - parameter WRITE_MODE_A = "WRITE_FIRST"; - parameter WRITE_MODE_B = "WRITE_FIRST"; - parameter SIM_COLLISION_CHECK = "ALL"; - localparam SETUP_ALL = 1000; - localparam SETUP_READ_FIRST = 3000; - - parameter INIT_00 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_01 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_02 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_03 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_04 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_05 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_06 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_07 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_08 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_09 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_0A = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_0B = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_0C = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_0D = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_0E = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_0F = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_10 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_11 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_12 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_13 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_14 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_15 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_16 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_17 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_18 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_19 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_1A = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_1B = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_1C = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_1D = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_1E = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_1F = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_20 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_21 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_22 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_23 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_24 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_25 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_26 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_27 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_28 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_29 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_2A = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_2B = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_2C = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_2D = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_2E = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_2F = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_30 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_31 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_32 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_33 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_34 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_35 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_36 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_37 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_38 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_39 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_3A = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_3B = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_3C = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_3D = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_3E = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INIT_3F = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INITP_00 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INITP_01 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INITP_02 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INITP_03 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INITP_04 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INITP_05 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INITP_06 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - parameter INITP_07 = 256'h0000000000000000000000000000000000000000000000000000000000000000; - - output [31:0] DOA; - output [3:0] DOPA; - output [31:0] DOB; - output [3:0] DOPB; - - input [8:0] ADDRA; - input [31:0] DIA; - input [3:0] DIPA; - input ENA, CLKA, WEA, SSRA; - input [8:0] ADDRB; - input [31:0] DIB; - input [3:0] DIPB; - input ENB, CLKB, WEB, SSRB; - - reg [31:0] doa_out = INIT_A[31:0]; - reg [3:0] dopa_out = INIT_A[35:32]; - reg [31:0] dob_out = INIT_B[31:0]; - reg [3:0] dopb_out = INIT_B[35:32]; - - reg [31:0] mem [511:0]; - reg [3:0] memp [511:0]; - - reg [8:0] count, countp; - reg [1:0] wr_mode_a, wr_mode_b; - - reg [5:0] dmi, dbi; - reg [5:0] pmi, pbi; - - wire [8:0] addra_int; - reg [8:0] addra_reg; - wire [31:0] dia_int; - wire [3:0] dipa_int; - wire ena_int, clka_int, wea_int, ssra_int; - reg ena_reg, wea_reg, ssra_reg; - wire [8:0] addrb_int; - reg [8:0] addrb_reg; - wire [31:0] dib_int; - wire [3:0] dipb_int; - wire enb_int, clkb_int, web_int, ssrb_int; - reg display_flag, output_flag; - reg enb_reg, web_reg, ssrb_reg; - - time time_clka, time_clkb; - time time_clka_clkb; - time time_clkb_clka; - - reg setup_all_a_b; - reg setup_all_b_a; - reg setup_zero; - reg setup_rf_a_b; - reg setup_rf_b_a; - reg [1:0] data_collision, data_collision_a_b, data_collision_b_a; - reg memory_collision, memory_collision_a_b, memory_collision_b_a; - reg change_clka; - reg change_clkb; - - wire [14:0] data_addra_int; - wire [14:0] data_addra_reg; - wire [14:0] data_addrb_int; - wire [14:0] data_addrb_reg; - - wire dia_enable = ena_int && wea_int; - wire dib_enable = enb_int && web_int; - - tri0 GSR = glbl.GSR; - wire gsr_int; - - buf b_gsr (gsr_int, GSR); - - buf b_doa [31:0] (DOA, doa_out); - buf b_dopa [3:0] (DOPA, dopa_out); - buf b_addra [8:0] (addra_int, ADDRA); - buf b_dia [31:0] (dia_int, DIA); - buf b_dipa [3:0] (dipa_int, DIPA); - buf b_ena (ena_int, ENA); - buf b_clka (clka_int, CLKA); - buf b_ssra (ssra_int, SSRA); - buf b_wea (wea_int, WEA); - - buf b_dob [31:0] (DOB, dob_out); - buf b_dopb [3:0] (DOPB, dopb_out); - buf b_addrb [8:0] (addrb_int, ADDRB); - buf b_dib [31:0] (dib_int, DIB); - buf b_dipb [3:0] (dipb_int, DIPB); - buf b_enb (enb_int, ENB); - buf b_clkb (clkb_int, CLKB); - buf b_ssrb (ssrb_int, SSRB); - buf b_web (web_int, WEB); - - - always @(gsr_int) - if (gsr_int) begin - assign {dopa_out, doa_out} = INIT_A; - assign {dopb_out, dob_out} = INIT_B; - end - else begin - deassign doa_out; - deassign dopa_out; - deassign dob_out; - deassign dopb_out; - end - - initial begin : initialize_mems - -`ifdef UNDEFINED - for (count = 0; count < 8; count = count + 1) begin - mem[count] = INIT_00[(count * 32) +: 32]; - mem[8 * 1 + count] = INIT_01[(count * 32) +: 32]; - mem[8 * 2 + count] = INIT_02[(count * 32) +: 32]; - mem[8 * 3 + count] = INIT_03[(count * 32) +: 32]; - mem[8 * 4 + count] = INIT_04[(count * 32) +: 32]; - mem[8 * 5 + count] = INIT_05[(count * 32) +: 32]; - mem[8 * 6 + count] = INIT_06[(count * 32) +: 32]; - mem[8 * 7 + count] = INIT_07[(count * 32) +: 32]; - mem[8 * 8 + count] = INIT_08[(count * 32) +: 32]; - mem[8 * 9 + count] = INIT_09[(count * 32) +: 32]; - mem[8 * 10 + count] = INIT_0A[(count * 32) +: 32]; - mem[8 * 11 + count] = INIT_0B[(count * 32) +: 32]; - mem[8 * 12 + count] = INIT_0C[(count * 32) +: 32]; - mem[8 * 13 + count] = INIT_0D[(count * 32) +: 32]; - mem[8 * 14 + count] = INIT_0E[(count * 32) +: 32]; - mem[8 * 15 + count] = INIT_0F[(count * 32) +: 32]; - mem[8 * 16 + count] = INIT_10[(count * 32) +: 32]; - mem[8 * 17 + count] = INIT_11[(count * 32) +: 32]; - mem[8 * 18 + count] = INIT_12[(count * 32) +: 32]; - mem[8 * 19 + count] = INIT_13[(count * 32) +: 32]; - mem[8 * 20 + count] = INIT_14[(count * 32) +: 32]; - mem[8 * 21 + count] = INIT_15[(count * 32) +: 32]; - mem[8 * 22 + count] = INIT_16[(count * 32) +: 32]; - mem[8 * 23 + count] = INIT_17[(count * 32) +: 32]; - mem[8 * 24 + count] = INIT_18[(count * 32) +: 32]; - mem[8 * 25 + count] = INIT_19[(count * 32) +: 32]; - mem[8 * 26 + count] = INIT_1A[(count * 32) +: 32]; - mem[8 * 27 + count] = INIT_1B[(count * 32) +: 32]; - mem[8 * 28 + count] = INIT_1C[(count * 32) +: 32]; - mem[8 * 29 + count] = INIT_1D[(count * 32) +: 32]; - mem[8 * 30 + count] = INIT_1E[(count * 32) +: 32]; - mem[8 * 31 + count] = INIT_1F[(count * 32) +: 32]; - mem[8 * 32 + count] = INIT_20[(count * 32) +: 32]; - mem[8 * 33 + count] = INIT_21[(count * 32) +: 32]; - mem[8 * 34 + count] = INIT_22[(count * 32) +: 32]; - mem[8 * 35 + count] = INIT_23[(count * 32) +: 32]; - mem[8 * 36 + count] = INIT_24[(count * 32) +: 32]; - mem[8 * 37 + count] = INIT_25[(count * 32) +: 32]; - mem[8 * 38 + count] = INIT_26[(count * 32) +: 32]; - mem[8 * 39 + count] = INIT_27[(count * 32) +: 32]; - mem[8 * 40 + count] = INIT_28[(count * 32) +: 32]; - mem[8 * 41 + count] = INIT_29[(count * 32) +: 32]; - mem[8 * 42 + count] = INIT_2A[(count * 32) +: 32]; - mem[8 * 43 + count] = INIT_2B[(count * 32) +: 32]; - mem[8 * 44 + count] = INIT_2C[(count * 32) +: 32]; - mem[8 * 45 + count] = INIT_2D[(count * 32) +: 32]; - mem[8 * 46 + count] = INIT_2E[(count * 32) +: 32]; - mem[8 * 47 + count] = INIT_2F[(count * 32) +: 32]; - mem[8 * 48 + count] = INIT_30[(count * 32) +: 32]; - mem[8 * 49 + count] = INIT_31[(count * 32) +: 32]; - mem[8 * 50 + count] = INIT_32[(count * 32) +: 32]; - mem[8 * 51 + count] = INIT_33[(count * 32) +: 32]; - mem[8 * 52 + count] = INIT_34[(count * 32) +: 32]; - mem[8 * 53 + count] = INIT_35[(count * 32) +: 32]; - mem[8 * 54 + count] = INIT_36[(count * 32) +: 32]; - mem[8 * 55 + count] = INIT_37[(count * 32) +: 32]; - mem[8 * 56 + count] = INIT_38[(count * 32) +: 32]; - mem[8 * 57 + count] = INIT_39[(count * 32) +: 32]; - mem[8 * 58 + count] = INIT_3A[(count * 32) +: 32]; - mem[8 * 59 + count] = INIT_3B[(count * 32) +: 32]; - mem[8 * 60 + count] = INIT_3C[(count * 32) +: 32]; - mem[8 * 61 + count] = INIT_3D[(count * 32) +: 32]; - mem[8 * 62 + count] = INIT_3E[(count * 32) +: 32]; - mem[8 * 63 + count] = INIT_3F[(count * 32) +: 32]; - end -`else - integer i; - for (i = 0; i < 512; i = i + 1) - begin - mem[i] = 0; - memp[i] = 0; - end - -`endif - -// initiate parity start -`ifdef UNDEFINED - for (countp = 0; countp < 64; countp = countp + 1) begin - memp[countp] = INITP_00[(countp * 4) +: 4]; - memp[64 * 1 + countp] = INITP_01[(countp * 4) +: 4]; - memp[64 * 2 + countp] = INITP_02[(countp * 4) +: 4]; - memp[64 * 3 + countp] = INITP_03[(countp * 4) +: 4]; - memp[64 * 4 + countp] = INITP_04[(countp * 4) +: 4]; - memp[64 * 5 + countp] = INITP_05[(countp * 4) +: 4]; - memp[64 * 6 + countp] = INITP_06[(countp * 4) +: 4]; - memp[64 * 7 + countp] = INITP_07[(countp * 4) +: 4]; - end -`endif -// initiate parity end - - change_clka <= 0; - change_clkb <= 0; - data_collision <= 0; - data_collision_a_b <= 0; - data_collision_b_a <= 0; - memory_collision <= 0; - memory_collision_a_b <= 0; - memory_collision_b_a <= 0; - setup_all_a_b <= 0; - setup_all_b_a <= 0; - setup_zero <= 0; - setup_rf_a_b <= 0; - setup_rf_b_a <= 0; - end - - assign data_addra_int = addra_int * 32; - assign data_addra_reg = addra_reg * 32; - assign data_addrb_int = addrb_int * 32; - assign data_addrb_reg = addrb_reg * 32; - - - initial begin - - display_flag = 1; - output_flag = 1; - - case (SIM_COLLISION_CHECK) - - "NONE" : begin - output_flag = 0; - display_flag = 0; - end - "WARNING_ONLY" : output_flag = 0; - "GENERATE_ONLY" : display_flag = 0; - "ALL" : ; - - default : begin - $display("Attribute Syntax Error : The Attribute SIM_COLLISION_CHECK on RAMB16_S36_S36 instance %m is set to %s. Legal values for this attribute are ALL, NONE, WARNING_ONLY or GENERATE_ONLY.", SIM_COLLISION_CHECK); - $finish; - end - - endcase // case(SIM_COLLISION_CHECK) - - end // initial begin - - - always @(posedge clka_int) begin - if ((output_flag || display_flag)) begin - time_clka = $time; - #0 time_clkb_clka = time_clka - time_clkb; - change_clka = ~change_clka; - end - end - - always @(posedge clkb_int) begin - if ((output_flag || display_flag)) begin - time_clkb = $time; - #0 time_clka_clkb = time_clkb - time_clka; - change_clkb = ~change_clkb; - end - end - - always @(change_clkb) begin - if ((0 < time_clka_clkb) && (time_clka_clkb < SETUP_ALL)) - setup_all_a_b = 1; - if ((0 < time_clka_clkb) && (time_clka_clkb < SETUP_READ_FIRST)) - setup_rf_a_b = 1; - end - - always @(change_clka) begin - if ((0 < time_clkb_clka) && (time_clkb_clka < SETUP_ALL)) - setup_all_b_a = 1; - if ((0 < time_clkb_clka) && (time_clkb_clka < SETUP_READ_FIRST)) - setup_rf_b_a = 1; - end - - always @(change_clkb or change_clka) begin - if ((time_clkb_clka == 0) && (time_clka_clkb == 0)) - setup_zero = 1; - end - - always @(posedge setup_zero) begin - if ((ena_int == 1) && (wea_int == 1) && - (enb_int == 1) && (web_int == 1) && - (data_addra_int[14:5] == data_addrb_int[14:5])) - memory_collision <= 1; - end - - always @(posedge setup_all_a_b or posedge setup_rf_a_b) begin - if ((ena_reg == 1) && (wea_reg == 1) && - (enb_int == 1) && (web_int == 1) && - (data_addra_reg[14:5] == data_addrb_int[14:5])) - memory_collision_a_b <= 1; - end - - always @(posedge setup_all_b_a or posedge setup_rf_b_a) begin - if ((ena_int == 1) && (wea_int == 1) && - (enb_reg == 1) && (web_reg == 1) && - (data_addra_int[14:5] == data_addrb_reg[14:5])) - memory_collision_b_a <= 1; - end - - always @(posedge setup_all_a_b) begin - if (data_addra_reg[14:5] == data_addrb_int[14:5]) begin - if ((ena_reg == 1) && (enb_int == 1)) begin - case ({wr_mode_a, wr_mode_b, wea_reg, web_int}) - 6'b000011 : begin data_collision_a_b <= 2'b11; display_wa_wb; end - 6'b000111 : begin data_collision_a_b <= 2'b11; display_wa_wb; end - 6'b001011 : begin data_collision_a_b <= 2'b10; display_wa_wb; end -// 6'b010011 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b010111 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b011011 : begin data_collision_a_b <= 2'b00; display_wa_wb; end - 6'b100011 : begin data_collision_a_b <= 2'b01; display_wa_wb; end - 6'b100111 : begin data_collision_a_b <= 2'b01; display_wa_wb; end - 6'b101011 : begin display_wa_wb; end - 6'b000001 : begin data_collision_a_b <= 2'b10; display_ra_wb; end -// 6'b000101 : begin data_collision_a_b <= 2'b00; display_ra_wb; end - 6'b001001 : begin data_collision_a_b <= 2'b10; display_ra_wb; end - 6'b010001 : begin data_collision_a_b <= 2'b10; display_ra_wb; end -// 6'b010101 : begin data_collision_a_b <= 2'b00; display_ra_wb; end - 6'b011001 : begin data_collision_a_b <= 2'b10; display_ra_wb; end - 6'b100001 : begin data_collision_a_b <= 2'b10; display_ra_wb; end -// 6'b100101 : begin data_collision_a_b <= 2'b00; display_ra_wb; end - 6'b101001 : begin data_collision_a_b <= 2'b10; display_ra_wb; end - 6'b000010 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - 6'b000110 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - 6'b001010 : begin data_collision_a_b <= 2'b01; display_wa_rb; end -// 6'b010010 : begin data_collision_a_b <= 2'b00; display_wa_rb; end -// 6'b010110 : begin data_collision_a_b <= 2'b00; display_wa_rb; end -// 6'b011010 : begin data_collision_a_b <= 2'b00; display_wa_rb; end - 6'b100010 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - 6'b100110 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - 6'b101010 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - endcase - end - end - setup_all_a_b <= 0; - end - - - always @(posedge setup_all_b_a) begin - if (data_addra_int[14:5] == data_addrb_reg[14:5]) begin - if ((ena_int == 1) && (enb_reg == 1)) begin - case ({wr_mode_a, wr_mode_b, wea_int, web_reg}) - 6'b000011 : begin data_collision_b_a <= 2'b11; display_wa_wb; end -// 6'b000111 : begin data_collision_b_a <= 2'b00; display_wa_wb; end - 6'b001011 : begin data_collision_b_a <= 2'b10; display_wa_wb; end - 6'b010011 : begin data_collision_b_a <= 2'b11; display_wa_wb; end -// 6'b010111 : begin data_collision_b_a <= 2'b00; display_wa_wb; end - 6'b011011 : begin data_collision_b_a <= 2'b10; display_wa_wb; end - 6'b100011 : begin data_collision_b_a <= 2'b01; display_wa_wb; end - 6'b100111 : begin data_collision_b_a <= 2'b01; display_wa_wb; end - 6'b101011 : begin display_wa_wb; end - 6'b000001 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b000101 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b001001 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b010001 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b010101 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b011001 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b100001 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b100101 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b101001 : begin data_collision_b_a <= 2'b10; display_ra_wb; end - 6'b000010 : begin data_collision_b_a <= 2'b01; display_wa_rb; end - 6'b000110 : begin data_collision_b_a <= 2'b01; display_wa_rb; end - 6'b001010 : begin data_collision_b_a <= 2'b01; display_wa_rb; end -// 6'b010010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b010110 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b011010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end - 6'b100010 : begin data_collision_b_a <= 2'b01; display_wa_rb; end - 6'b100110 : begin data_collision_b_a <= 2'b01; display_wa_rb; end - 6'b101010 : begin data_collision_b_a <= 2'b01; display_wa_rb; end - endcase - end - end - setup_all_b_a <= 0; - end - - - always @(posedge setup_zero) begin - if (data_addra_int[14:5] == data_addrb_int[14:5]) begin - if ((ena_int == 1) && (enb_int == 1)) begin - case ({wr_mode_a, wr_mode_b, wea_int, web_int}) - 6'b000011 : begin data_collision <= 2'b11; display_wa_wb; end - 6'b000111 : begin data_collision <= 2'b11; display_wa_wb; end - 6'b001011 : begin data_collision <= 2'b10; display_wa_wb; end - 6'b010011 : begin data_collision <= 2'b11; display_wa_wb; end - 6'b010111 : begin data_collision <= 2'b11; display_wa_wb; end - 6'b011011 : begin data_collision <= 2'b10; display_wa_wb; end - 6'b100011 : begin data_collision <= 2'b01; display_wa_wb; end - 6'b100111 : begin data_collision <= 2'b01; display_wa_wb; end - 6'b101011 : begin display_wa_wb; end - 6'b000001 : begin data_collision <= 2'b10; display_ra_wb; end -// 6'b000101 : begin data_collision <= 2'b00; display_ra_wb; end - 6'b001001 : begin data_collision <= 2'b10; display_ra_wb; end - 6'b010001 : begin data_collision <= 2'b10; display_ra_wb; end -// 6'b010101 : begin data_collision <= 2'b00; display_ra_wb; end - 6'b011001 : begin data_collision <= 2'b10; display_ra_wb; end - 6'b100001 : begin data_collision <= 2'b10; display_ra_wb; end -// 6'b100101 : begin data_collision <= 2'b00; display_ra_wb; end - 6'b101001 : begin data_collision <= 2'b10; display_ra_wb; end - 6'b000010 : begin data_collision <= 2'b01; display_wa_rb; end - 6'b000110 : begin data_collision <= 2'b01; display_wa_rb; end - 6'b001010 : begin data_collision <= 2'b01; display_wa_rb; end -// 6'b010010 : begin data_collision <= 2'b00; display_wa_rb; end -// 6'b010110 : begin data_collision <= 2'b00; display_wa_rb; end -// 6'b011010 : begin data_collision <= 2'b00; display_wa_rb; end - 6'b100010 : begin data_collision <= 2'b01; display_wa_rb; end - 6'b100110 : begin data_collision <= 2'b01; display_wa_rb; end - 6'b101010 : begin data_collision <= 2'b01; display_wa_rb; end - endcase - end - end - setup_zero <= 0; - end - - task display_ra_wb; - begin - if (display_flag) - $display("Memory Collision Error on RAMB16_S36_S36:%m at simulation time %.3f ns\nA read was performed on address %h (hex) of Port A while a write was requested to the same address on Port B. The write will be successful however the read value on Port A is unknown until the next CLKA cycle.", $time/1000.0, addra_int); - end - endtask - - task display_wa_rb; - begin - if (display_flag) - $display("Memory Collision Error on RAMB16_S36_S36:%m at simulation time %.3f ns\nA read was performed on address %h (hex) of Port B while a write was requested to the same address on Port A. The write will be successful however the read value on Port B is unknown until the next CLKB cycle.", $time/1000.0, addrb_int); - end - endtask - - task display_wa_wb; - begin - if (display_flag) - $display("Memory Collision Error on RAMB16_S36_S36:%m at simulation time %.3f ns\nA write was requested to the same address simultaneously at both Port A and Port B of the RAM. The contents written to the RAM at address location %h (hex) of Port A and address location %h (hex) of Port B are unknown.", $time/1000.0, addra_int, addrb_int); - end - endtask - - - always @(posedge setup_rf_a_b) begin - if (data_addra_reg[14:5] == data_addrb_int[14:5]) begin - if ((ena_reg == 1) && (enb_int == 1)) begin - case ({wr_mode_a, wr_mode_b, wea_reg, web_int}) -// 6'b000011 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b000111 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b001011 : begin data_collision_a_b <= 2'b00; display_wa_wb; end - 6'b010011 : begin data_collision_a_b <= 2'b11; display_wa_wb; end - 6'b010111 : begin data_collision_a_b <= 2'b11; display_wa_wb; end - 6'b011011 : begin data_collision_a_b <= 2'b10; display_wa_wb; end -// 6'b100011 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b100111 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b101011 : begin data_collision_a_b <= 2'b00; display_wa_wb; end -// 6'b000001 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b000101 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b001001 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b010001 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b010101 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b011001 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b100001 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b100101 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b101001 : begin data_collision_a_b <= 2'b00; display_ra_wb; end -// 6'b000010 : begin data_collision_a_b <= 2'b00; display_wa_rb; end -// 6'b000110 : begin data_collision_a_b <= 2'b00; display_wa_rb; end -// 6'b001010 : begin data_collision_a_b <= 2'b00; display_wa_rb; end - 6'b010010 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - 6'b010110 : begin data_collision_a_b <= 2'b01; display_wa_rb; end - 6'b011010 : begin data_collision_a_b <= 2'b01; display_wa_rb; end -// 6'b100010 : begin data_collision_a_b <= 2'b00; display_wa_rb; end -// 6'b100110 : begin data_collision_a_b <= 2'b00; display_wa_rb; end -// 6'b101010 : begin data_collision_a_b <= 2'b00; display_wa_rb; end - endcase - end - end - setup_rf_a_b <= 0; - end - - - always @(posedge setup_rf_b_a) begin - if (data_addra_int[14:5] == data_addrb_reg[14:5]) begin - if ((ena_int == 1) && (enb_reg == 1)) begin - case ({wr_mode_a, wr_mode_b, wea_int, web_reg}) -// 6'b000011 : begin data_collision_b_a <= 2'b00; display_wa_wb; end - 6'b000111 : begin data_collision_b_a <= 2'b11; display_wa_wb; end -// 6'b001011 : begin data_collision_b_a <= 2'b00; display_wa_wb; end -// 6'b010011 : begin data_collision_b_a <= 2'b00; display_wa_wb; end - 6'b010111 : begin data_collision_b_a <= 2'b11; display_wa_wb; end -// 6'b011011 : begin data_collision_b_a <= 2'b00; display_wa_wb; end -// 6'b100011 : begin data_collision_b_a <= 2'b00; display_wa_wb; end - 6'b100111 : begin data_collision_b_a <= 2'b01; display_wa_wb; end -// 6'b101011 : begin data_collision_b_a <= 2'b00; display_wa_wb; end -// 6'b000001 : begin data_collision_b_a <= 2'b00; display_ra_wb; end - 6'b000101 : begin data_collision_b_a <= 2'b10; display_ra_wb; end -// 6'b001001 : begin data_collision_b_a <= 2'b00; display_ra_wb; end -// 6'b010001 : begin data_collision_b_a <= 2'b00; display_ra_wb; end - 6'b010101 : begin data_collision_b_a <= 2'b10; display_ra_wb; end -// 6'b011001 : begin data_collision_b_a <= 2'b00; display_ra_wb; end -// 6'b100001 : begin data_collision_b_a <= 2'b00; display_ra_wb; end - 6'b100101 : begin data_collision_b_a <= 2'b10; display_ra_wb; end -// 6'b101001 : begin data_collision_b_a <= 2'b00; display_ra_wb; end -// 6'b000010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b000110 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b001010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b010010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b010110 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b011010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b100010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b100110 : begin data_collision_b_a <= 2'b00; display_wa_rb; end -// 6'b101010 : begin data_collision_b_a <= 2'b00; display_wa_rb; end - endcase - end - end - setup_rf_b_a <= 0; - end - - - always @(posedge clka_int) begin - if ((output_flag || display_flag)) begin - addra_reg <= addra_int; - ena_reg <= ena_int; - ssra_reg <= ssra_int; - wea_reg <= wea_int; - end - end - - always @(posedge clkb_int) begin - if ((output_flag || display_flag)) begin - addrb_reg <= addrb_int; - enb_reg <= enb_int; - ssrb_reg <= ssrb_int; - web_reg <= web_int; - end - end - - - // Data - always @(posedge memory_collision) begin - if ((output_flag || display_flag)) begin - mem[addra_int] <= 32'bx; - memory_collision <= 0; - end - - end - - always @(posedge memory_collision_a_b) begin - if ((output_flag || display_flag)) begin - mem[addra_reg] <= 32'bx; - memory_collision_a_b <= 0; - end - end - - always @(posedge memory_collision_b_a) begin - if ((output_flag || display_flag)) begin - mem[addra_int] <= 32'bx; - memory_collision_b_a <= 0; - end - end - - always @(posedge data_collision[1]) begin - if (ssra_int == 0 && output_flag) begin - doa_out <= #100 32'bX; - end - data_collision[1] <= 0; - end - - always @(posedge data_collision[0]) begin - if (ssrb_int == 0 && output_flag) begin - dob_out <= #100 32'bX; - end - data_collision[0] <= 0; - end - - always @(posedge data_collision_a_b[1]) begin - if (ssra_reg == 0 && output_flag) begin - doa_out <= #100 32'bX; - end - data_collision_a_b[1] <= 0; - end - - always @(posedge data_collision_a_b[0]) begin - if (ssrb_int == 0 && output_flag) begin - dob_out <= #100 32'bX; - end - data_collision_a_b[0] <= 0; - end - - always @(posedge data_collision_b_a[1]) begin - if (ssra_int == 0 && output_flag) begin - doa_out <= #100 32'bX; - end - data_collision_b_a[1] <= 0; - end - - always @(posedge data_collision_b_a[0]) begin - if (ssrb_reg == 0 && output_flag) begin - dob_out <= #100 32'bX; - end - data_collision_b_a[0] <= 0; - end - -// x parity start - always @(posedge memory_collision) begin - if ((output_flag || display_flag)) - memp[addra_int] <= 4'bx; - end - - always @(posedge memory_collision_a_b) begin - if ((output_flag || display_flag)) - memp[addra_reg] <= 4'bx; - end - - always @(posedge memory_collision_b_a) begin - if ((output_flag || display_flag)) - memp[addra_int] <= 4'bx; - end - - always @(posedge data_collision[1]) begin - if (ssra_int == 0 && output_flag) begin - dopa_out <= #100 4'bX; - end - end - - always @(posedge data_collision_a_b[1]) begin - if (ssra_reg == 0 && output_flag) begin - dopa_out <= #100 4'bX; - end - end - - - always @(posedge data_collision_b_a[1]) begin - if (ssra_int == 0 && output_flag) begin - dopa_out <= #100 4'bX; - end - end - - always @(posedge data_collision[0]) begin - if (ssrb_int == 0 && output_flag) begin - dopb_out <= #100 4'bx; - end - end - - always @(posedge data_collision_a_b[0]) begin - if (ssrb_int == 0 && output_flag) begin - dopb_out <= #100 4'bx; - end - end - - always @(posedge data_collision_b_a[0]) begin - if (ssrb_reg == 0 && output_flag) begin - dopb_out <= #100 4'bx; - end - end -// x parity end - - initial begin - case (WRITE_MODE_A) - "WRITE_FIRST" : wr_mode_a <= 2'b00; - "READ_FIRST" : wr_mode_a <= 2'b01; - "NO_CHANGE" : wr_mode_a <= 2'b10; - default : begin - $display("Attribute Syntax Error : The Attribute WRITE_MODE_A on RAMB16_S36_S36 instance %m is set to %s. Legal values for this attribute are WRITE_FIRST, READ_FIRST or NO_CHANGE.", WRITE_MODE_A); - $finish; - end - endcase - end - - initial begin - case (WRITE_MODE_B) - "WRITE_FIRST" : wr_mode_b <= 2'b00; - "READ_FIRST" : wr_mode_b <= 2'b01; - "NO_CHANGE" : wr_mode_b <= 2'b10; - default : begin - $display("Attribute Syntax Error : The Attribute WRITE_MODE_B on RAMB16_S36_S36 instance %m is set to %s. Legal values for this attribute are WRITE_FIRST, READ_FIRST or NO_CHANGE.", WRITE_MODE_B); - $finish; - end - endcase - end - - - // Port A - always @(posedge clka_int) begin - - if (ena_int == 1'b1) begin - - if (ssra_int == 1'b1) begin - {dopa_out, doa_out} <= #100 SRVAL_A; - end - else begin - if (wea_int == 1'b1) begin - if (wr_mode_a == 2'b00) begin - doa_out <= #100 dia_int; - dopa_out <= #100 dipa_int; - end - else if (wr_mode_a == 2'b01) begin - - doa_out <= #100 mem[addra_int]; - dopa_out <= #100 memp[addra_int]; - - end - end - else begin - - doa_out <= #100 mem[addra_int]; - dopa_out <= #100 memp[addra_int]; - - end - end - - // memory - if (wea_int == 1'b1) begin - mem[addra_int] <= dia_int; - memp[addra_int] <= dipa_int; - end - - end - end - - - // Port B - always @(posedge clkb_int) begin - - if (enb_int == 1'b1) begin - - if (ssrb_int == 1'b1) begin - {dopb_out, dob_out} <= #100 SRVAL_B; - end - else begin - if (web_int == 1'b1) begin - if (wr_mode_b == 2'b00) begin - dob_out <= #100 dib_int; - dopb_out <= #100 dipb_int; - end - else if (wr_mode_b == 2'b01) begin - dob_out <= #100 mem[addrb_int]; - dopb_out <= #100 memp[addrb_int]; - end - end - else begin - dob_out <= #100 mem[addrb_int]; - dopb_out <= #100 memp[addrb_int]; - end - end - - // memory - if (web_int == 1'b1) begin - mem[addrb_int] <= dib_int; - memp[addrb_int] <= dipb_int; - end - - end - end - - -endmodule - -`endif diff --git a/eth/rtl/verilog/elastic_buffer.v b/eth/rtl/verilog/elastic_buffer.v deleted file mode 100644 index 56c821b7e..000000000 --- a/eth/rtl/verilog/elastic_buffer.v +++ /dev/null @@ -1,93 +0,0 @@ - - -module elastic_buffer - ( input rx_clk, - input tx_clk, - input rst, - - input [7:0] rxd, - input rx_dv, - input rx_er, - input crs, - input col, - - output [7:0] rxd_ret, - output rx_dv_ret, - output rx_er_ret, - output crs_ret, - output col_ret ); - - reg [3:0] addr_wr,addr_wr_gray,awg_d1,awg_d2,addr_wr_gray_ret,awgr_d1,addr_wr_ungray,addr_rd; - - reg [11:0] buffer [0:15]; - integer i; - initial - for(i=0;i<16;i=i+1) - buffer[i] <= 0; - - reg [7:0] rxd_d1, rxd_d2; - reg rx_dv_d1,rx_er_d1,crs_d1,col_d1, rx_dv_d2,rx_er_d2,crs_d2,col_d2; - wire rx_dv_ret_adv; - reg rx_dv_ontime; - - always @(posedge rx_clk) - {col_d1,crs_d1,rx_er_d1,rx_dv_d1,rxd_d1} <= {col,crs,rx_er,rx_dv,rxd}; - - always @(posedge rx_clk) - {col_d2,crs_d2,rx_er_d2,rx_dv_d2,rxd_d2} <= {col_d1,crs_d1,rx_er_d1,rx_dv_d1,rxd_d1}; - - always @(posedge rx_clk) - buffer[addr_wr] <= {col_d2,crs_d2,rx_er_d2,rx_dv_d1,rxd_d2}; - - always @(posedge rx_clk or posedge rst) - if(rst) addr_wr <= 0; - else addr_wr <= addr_wr + 1; - - always @(posedge rx_clk) - begin - addr_wr_gray <= {addr_wr[3],^addr_wr[3:2],^addr_wr[2:1],^addr_wr[1:0]}; - awg_d1 <= addr_wr_gray; - awg_d2 <= awg_d1; - end - - always @(posedge tx_clk) - begin - addr_wr_gray_ret <= awg_d2; - awgr_d1 <= addr_wr_gray_ret; - addr_wr_ungray <= {awgr_d1[3],^awgr_d1[3:2],^awgr_d1[3:1],^awgr_d1[3:0]}; - end - - wire [3:0] addr_delta = addr_rd-addr_wr_ungray; - reg [1:0] direction; - localparam retard = 2'd0; - localparam good = 2'd1; - localparam advance = 2'd2; - localparam wayoff = 2'd3; - - always @* - case(addr_delta) - 4'd1, 4'd2, 4'd3, 4'd4, 4'd5 : direction <= retard; - 4'd15, 4'd14, 4'd13, 4'd12, 4'd11 : direction <= advance; - 4'd0 : direction <= good; - default : direction <= wayoff; - endcase // case(addr_delta) - - always @(posedge tx_clk or posedge rst) - if(rst) - addr_rd <= 0; - else if(rx_dv_ret_adv | rx_dv_ontime) - addr_rd <= addr_rd + 1; - else - case(direction) - retard : addr_rd <= addr_rd; - advance : addr_rd <= addr_rd + 2; - good : addr_rd <= addr_rd + 1; - wayoff : addr_rd <= addr_wr_ungray; - endcase // case(direction) - - assign {col_ret,crs_ret,rx_er_ret,rx_dv_ret_adv,rxd_ret} = buffer[addr_rd]; - always @(posedge tx_clk) - rx_dv_ontime <= rx_dv_ret_adv; - - assign rx_dv_ret = rx_dv_ontime; -endmodule // elastic_buffer diff --git a/eth/rtl/verilog/elastic_buffer_tb.v b/eth/rtl/verilog/elastic_buffer_tb.v deleted file mode 100644 index 757049ec4..000000000 --- a/eth/rtl/verilog/elastic_buffer_tb.v +++ /dev/null @@ -1,66 +0,0 @@ - -module elastic_buffer_tb; - - reg rx_clk = 0, tx_clk = 0, rst = 1; - - reg [7:0] rxd; - wire [7:0] rxd_ret; - reg rx_dv, rx_er, crs, col; - wire rx_dv_ret, rx_er_ret, crs_ret, col_ret; - - elastic_buffer elastic_buffer - (.rx_clk(rx_clk),.tx_clk(tx_clk),.rst(rst), - .rxd(rxd),.rx_dv(rx_dv),.rx_er(rx_er),.crs(crs),.col(col), - .rxd_ret(rxd_ret),.rx_dv_ret(rx_dv_ret),.rx_er_ret(rx_er_ret), - .crs_ret(crs_ret),.col_ret(col_ret) ); - - always #100 rx_clk = ~rx_clk; - always #101 tx_clk = ~tx_clk; - initial #950 rst = 0; - - initial - begin - {col,crs,rx_er,rx_dv,rxd} <= 0; - @(negedge rst); - @(posedge rx_clk); - - repeat (13) - begin - repeat (284) - @(posedge rx_clk); - SendPKT; - end - repeat (100) - @(posedge rx_clk); - $finish; - end // initial begin - - reg [7:0] rxd_ret_d1; - always @(posedge tx_clk) - rxd_ret_d1 <= rxd_ret; - - wire [7:0] diff = rxd_ret_d1 - rxd_ret; - - wire error = rx_dv_ret && (diff != 8'hFF); - - task SendPKT; - begin - {col,crs,rx_er,rx_dv,rxd} <= 0; - @(posedge rx_clk); - {col,crs,rx_er,rx_dv,rxd} <= {4'hF,8'd1}; - @(posedge rx_clk); - repeat (250) - begin - rxd <= rxd + 1; - @(posedge rx_clk); - end - {col,crs,rx_er,rx_dv,rxd} <= 0; - @(posedge rx_clk); - end - endtask // SendPKT - - initial begin - $dumpfile("elastic_buffer_tb.vcd"); - $dumpvars(0,elastic_buffer_tb); - end -endmodule // elastic_buffer_tb diff --git a/eth/rtl/verilog/eth_miim.v b/eth/rtl/verilog/eth_miim.v deleted file mode 100644 index a15c94205..000000000 --- a/eth/rtl/verilog/eth_miim.v +++ /dev/null @@ -1,470 +0,0 @@ -//////////////////////////////////////////////////////////////////////
-//// ////
-//// eth_miim.v ////
-//// ////
-//// This file is part of the Ethernet IP core project ////
-//// http://www.opencores.org/projects/ethmac/ ////
-//// ////
-//// Author(s): ////
-//// - Igor Mohor (igorM@opencores.org) ////
-//// ////
-//// All additional information is avaliable in the Readme.txt ////
-//// file. ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// Copyright (C) 2001 Authors ////
-//// ////
-//// This source file may be used and distributed without ////
-//// restriction provided that this copyright statement is not ////
-//// removed from the file and that any derivative work contains ////
-//// the original copyright notice and the associated disclaimer. ////
-//// ////
-//// This source file is free software; you can redistribute it ////
-//// and/or modify it under the terms of the GNU Lesser General ////
-//// Public License as published by the Free Software Foundation; ////
-//// either version 2.1 of the License, or (at your option) any ////
-//// later version. ////
-//// ////
-//// This source is distributed in the hope that it will be ////
-//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
-//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-//// PURPOSE. See the GNU Lesser General Public License for more ////
-//// details. ////
-//// ////
-//// You should have received a copy of the GNU Lesser General ////
-//// Public License along with this source; if not, download it ////
-//// from http://www.opencores.org/lgpl.shtml ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//
-// CVS Revision History
-//
-// $Log: eth_miim.v,v $
-// Revision 1.3 2006/01/19 14:07:53 maverickist
-// verification is complete.
-//
-// Revision 1.1.1.1 2005/12/13 01:51:44 Administrator
-// no message
-//
-// Revision 1.4 2005/08/16 12:07:57 Administrator
-// no message
-//
-// Revision 1.3 2005/05/19 07:04:29 Administrator
-// no message
-//
-// Revision 1.2 2005/04/27 15:58:46 Administrator
-// no message
-//
-// Revision 1.1.1.1 2004/12/15 06:38:54 Administrator
-// no message
-//
-// Revision 1.5 2003/05/16 10:08:27 mohor
-// Busy was set 2 cycles too late. Reported by Dennis Scott.
-//
-// Revision 1.4 2002/08/14 18:32:10 mohor
-// - Busy signal was not set on time when scan status operation was performed
-// and clock was divided with more than 2.
-// - Nvalid remains valid two more clocks (was previously cleared too soon).
-//
-// Revision 1.3 2002/01/23 10:28:16 mohor
-// Link in the header changed.
-//
-// Revision 1.2 2001/10/19 08:43:51 mohor
-// eth_timescale.v changed to timescale.v This is done because of the
-// simulation of the few cores in a one joined project.
-//
-// Revision 1.1 2001/08/06 14:44:29 mohor
-// A define FPGA added to select between Artisan RAM (for ASIC) and Block Ram (For Virtex).
-// Include files fixed to contain no path.
-// File names and module names changed ta have a eth_ prologue in the name.
-// File eth_timescale.v is used to define timescale
-// All pin names on the top module are changed to contain _I, _O or _OE at the end.
-// Bidirectional signal MDIO is changed to three signals (Mdc_O, Mdi_I, Mdo_O
-// and Mdo_OE. The bidirectional signal must be created on the top level. This
-// is done due to the ASIC tools.
-//
-// Revision 1.2 2001/08/02 09:25:31 mohor
-// Unconnected signals are now connected.
-//
-// Revision 1.1 2001/07/30 21:23:42 mohor
-// Directory structure changed. Files checked and joind together.
-//
-// Revision 1.3 2001/06/01 22:28:56 mohor
-// This files (MIIM) are fully working. They were thoroughly tested. The testbench is not updated.
-//
-//
-
-module eth_miim
-(
- Clk,
- Reset,
- Divider,
- NoPre,
- CtrlData,
- Rgad,
- Fiad,
- WCtrlData,
- RStat,
- ScanStat,
- Mdio,
- Mdc,
- Busy,
- Prsd,
- LinkFail,
- Nvalid,
- WCtrlDataStart,
- RStatStart,
- UpdateMIIRX_DATAReg
-);
-
-input Clk; // Host Clock
-input Reset; // General Reset
-input [7:0] Divider; // Divider for the host clock
-input [15:0] CtrlData; // Control Data (to be written to the PHY reg.)
-input [4:0] Rgad; // Register Address (within the PHY)
-input [4:0] Fiad; // PHY Address
-input NoPre; // No Preamble (no 32-bit preamble)
-input WCtrlData; // Write Control Data operation
-input RStat; // Read Status operation
-input ScanStat; // Scan Status operation
-inout Mdio; // MII Management Data In
-
-output Mdc; // MII Management Data Clock
-
-output Busy; // Busy Signal
-output LinkFail; // Link Integrity Signal
-output Nvalid; // Invalid Status (qualifier for the valid scan result)
-
-output [15:0] Prsd; // Read Status Data (data read from the PHY)
-
-output WCtrlDataStart; // This signals resets the WCTRLDATA bit in the MIIM Command register
-output RStatStart; // This signal resets the RSTAT BIT in the MIIM Command register
-output UpdateMIIRX_DATAReg;// Updates MII RX_DATA register with read data
-
-//parameter Tp = 1;
-
-
-reg Nvalid;
-reg EndBusy_d; // Pre-end Busy signal
-reg EndBusy; // End Busy signal (stops the operation in progress)
-
-reg WCtrlData_q1; // Write Control Data operation delayed 1 Clk cycle
-reg WCtrlData_q2; // Write Control Data operation delayed 2 Clk cycles
-reg WCtrlData_q3; // Write Control Data operation delayed 3 Clk cycles
-reg WCtrlDataStart; // Start Write Control Data Command (positive edge detected)
-reg WCtrlDataStart_q;
-reg WCtrlDataStart_q1; // Start Write Control Data Command delayed 1 Mdc cycle
-reg WCtrlDataStart_q2; // Start Write Control Data Command delayed 2 Mdc cycles
-
-reg RStat_q1; // Read Status operation delayed 1 Clk cycle
-reg RStat_q2; // Read Status operation delayed 2 Clk cycles
-reg RStat_q3; // Read Status operation delayed 3 Clk cycles
-reg RStatStart; // Start Read Status Command (positive edge detected)
-reg RStatStart_q1; // Start Read Status Command delayed 1 Mdc cycle
-reg RStatStart_q2; // Start Read Status Command delayed 2 Mdc cycles
-
-reg ScanStat_q1; // Scan Status operation delayed 1 cycle
-reg ScanStat_q2; // Scan Status operation delayed 2 cycles
-reg SyncStatMdcEn; // Scan Status operation delayed at least cycles and synchronized to MdcEn
-
-wire WriteDataOp; // Write Data Operation (positive edge detected)
-wire ReadStatusOp; // Read Status Operation (positive edge detected)
-wire ScanStatusOp; // Scan Status Operation (positive edge detected)
-wire StartOp; // Start Operation (start of any of the preceding operations)
-wire EndOp; // End of Operation
-
-reg InProgress; // Operation in progress
-reg InProgress_q1; // Operation in progress delayed 1 Mdc cycle
-reg InProgress_q2; // Operation in progress delayed 2 Mdc cycles
-reg InProgress_q3; // Operation in progress delayed 3 Mdc cycles
-
-reg WriteOp; // Write Operation Latch (When asserted, write operation is in progress)
-reg [6:0] BitCounter; // Bit Counter
-
-
-wire [3:0] ByteSelect; // Byte Select defines which byte (preamble, data, operation, etc.) is loaded and shifted through the shift register.
-wire MdcEn; // MII Management Data Clock Enable signal is asserted for one Clk period before Mdc rises.
-wire ShiftedBit; // This bit is output of the shift register and is connected to the Mdo signal
-
-
-wire LatchByte1_d2;
-wire LatchByte0_d2;
-reg LatchByte1_d;
-reg LatchByte0_d;
-reg [1:0] LatchByte; // Latch Byte selects which part of Read Status Data is updated from the shift register
-
-reg UpdateMIIRX_DATAReg;// Updates MII RX_DATA register with read data
-
-wire Mdo; // MII Management Data Output
-wire MdoEn; // MII Management Data Output Enable
-wire Mdi;
-
-assign Mdi=Mdio;
-assign Mdio=MdoEn?Mdo:1'bz;
-
-
-
-// Generation of the EndBusy signal. It is used for ending the MII Management operation.
-always @ (posedge Clk or posedge Reset)
-begin
- if(Reset)
- begin
- EndBusy_d <= 1'b0;
- EndBusy <= 1'b0;
- end
- else
- begin
- EndBusy_d <= ~InProgress_q2 & InProgress_q3;
- EndBusy <= EndBusy_d;
- end
-end
-
-
-// Update MII RX_DATA register
-always @ (posedge Clk or posedge Reset)
-begin
- if(Reset)
- UpdateMIIRX_DATAReg <= 0;
- else
- if(EndBusy & ~WCtrlDataStart_q)
- UpdateMIIRX_DATAReg <= 1;
- else
- UpdateMIIRX_DATAReg <= 0;
-end
-
-
-
-// Generation of the delayed signals used for positive edge triggering.
-always @ (posedge Clk or posedge Reset)
-begin
- if(Reset)
- begin
- WCtrlData_q1 <= 1'b0;
- WCtrlData_q2 <= 1'b0;
- WCtrlData_q3 <= 1'b0;
-
- RStat_q1 <= 1'b0;
- RStat_q2 <= 1'b0;
- RStat_q3 <= 1'b0;
-
- ScanStat_q1 <= 1'b0;
- ScanStat_q2 <= 1'b0;
- SyncStatMdcEn <= 1'b0;
- end
- else
- begin
- WCtrlData_q1 <= WCtrlData;
- WCtrlData_q2 <= WCtrlData_q1;
- WCtrlData_q3 <= WCtrlData_q2;
-
- RStat_q1 <= RStat;
- RStat_q2 <= RStat_q1;
- RStat_q3 <= RStat_q2;
-
- ScanStat_q1 <= ScanStat;
- ScanStat_q2 <= ScanStat_q1;
- if(MdcEn)
- SyncStatMdcEn <= ScanStat_q2;
- end
-end
-
-
-// Generation of the Start Commands (Write Control Data or Read Status)
-always @ (posedge Clk or posedge Reset)
-begin
- if(Reset)
- begin
- WCtrlDataStart <= 1'b0;
- WCtrlDataStart_q <= 1'b0;
- RStatStart <= 1'b0;
- end
- else
- begin
- if(EndBusy)
- begin
- WCtrlDataStart <= 1'b0;
- RStatStart <= 1'b0;
- end
- else
- begin
- if(WCtrlData_q2 & ~WCtrlData_q3)
- WCtrlDataStart <= 1'b1;
- if(RStat_q2 & ~RStat_q3)
- RStatStart <= 1'b1;
- WCtrlDataStart_q <= WCtrlDataStart;
- end
- end
-end
-
-
-// Generation of the Nvalid signal (indicates when the status is invalid)
-always @ (posedge Clk or posedge Reset)
-begin
- if(Reset)
- Nvalid <= 1'b0;
- else
- begin
- if(~InProgress_q2 & InProgress_q3)
- begin
- Nvalid <= 1'b0;
- end
- else
- begin
- if(ScanStat_q2 & ~SyncStatMdcEn)
- Nvalid <= 1'b1;
- end
- end
-end
-
-// Signals used for the generation of the Operation signals (positive edge)
-always @ (posedge Clk or posedge Reset)
-begin
- if(Reset)
- begin
- WCtrlDataStart_q1 <= 1'b0;
- WCtrlDataStart_q2 <= 1'b0;
-
- RStatStart_q1 <= 1'b0;
- RStatStart_q2 <= 1'b0;
-
- InProgress_q1 <= 1'b0;
- InProgress_q2 <= 1'b0;
- InProgress_q3 <= 1'b0;
-
- LatchByte0_d <= 1'b0;
- LatchByte1_d <= 1'b0;
-
- LatchByte <= 2'b00;
- end
- else
- begin
- if(MdcEn)
- begin
- WCtrlDataStart_q1 <= WCtrlDataStart;
- WCtrlDataStart_q2 <= WCtrlDataStart_q1;
-
- RStatStart_q1 <= RStatStart;
- RStatStart_q2 <= RStatStart_q1;
-
- LatchByte[0] <= LatchByte0_d;
- LatchByte[1] <= LatchByte1_d;
-
- LatchByte0_d <= LatchByte0_d2;
- LatchByte1_d <= LatchByte1_d2;
-
- InProgress_q1 <= InProgress;
- InProgress_q2 <= InProgress_q1;
- InProgress_q3 <= InProgress_q2;
- end
- end
-end
-
-
-// Generation of the Operation signals
-assign WriteDataOp = WCtrlDataStart_q1 & ~WCtrlDataStart_q2;
-assign ReadStatusOp = RStatStart_q1 & ~RStatStart_q2;
-assign ScanStatusOp = SyncStatMdcEn & ~InProgress & ~InProgress_q1 & ~InProgress_q2;
-assign StartOp = WriteDataOp | ReadStatusOp | ScanStatusOp;
-
-// Busy
-reg Busy;
-always @ (posedge Clk or posedge Reset)
- if (Reset)
- Busy <=0;
- else if(WCtrlData | WCtrlDataStart | RStat | RStatStart | SyncStatMdcEn | EndBusy | InProgress | InProgress_q3 | Nvalid)
- Busy <=1;
- else
- Busy <=0;
-
-//assign Busy = WCtrlData | WCtrlDataStart | RStat | RStatStart | SyncStatMdcEn | EndBusy | InProgress | InProgress_q3 | Nvalid;
-
-
-// Generation of the InProgress signal (indicates when an operation is in progress)
-// Generation of the WriteOp signal (indicates when a write is in progress)
-always @ (posedge Clk or posedge Reset)
-begin
- if(Reset)
- begin
- InProgress <= 1'b0;
- WriteOp <= 1'b0;
- end
- else
- begin
- if(MdcEn)
- begin
- if(StartOp)
- begin
- if(~InProgress)
- WriteOp <= WriteDataOp;
- InProgress <= 1'b1;
- end
- else
- begin
- if(EndOp)
- begin
- InProgress <= 1'b0;
- WriteOp <= 1'b0;
- end
- end
- end
- end
-end
-
-
-
-// Bit Counter counts from 0 to 63 (from 32 to 63 when NoPre is asserted)
-always @ (posedge Clk or posedge Reset)
-begin
- if(Reset)
- BitCounter[6:0] <= 7'h0;
- else
- begin
- if(MdcEn)
- begin
- if(InProgress)
- begin
- if(NoPre & ( BitCounter == 7'h0 ))
- BitCounter[6:0] <= 7'h21;
- else
- BitCounter[6:0] <= BitCounter[6:0] + 1'b1;
- end
- else
- BitCounter[6:0] <= 7'h0;
- end
- end
-end
-
-
-// Operation ends when the Bit Counter reaches 63
-assign EndOp = BitCounter==63;
-
-assign ByteSelect[0] = InProgress & ((NoPre & (BitCounter == 7'h0)) | (~NoPre & (BitCounter == 7'h20)));
-assign ByteSelect[1] = InProgress & (BitCounter == 7'h28);
-assign ByteSelect[2] = InProgress & WriteOp & (BitCounter == 7'h30);
-assign ByteSelect[3] = InProgress & WriteOp & (BitCounter == 7'h38);
-
-
-// Latch Byte selects which part of Read Status Data is updated from the shift register
-assign LatchByte1_d2 = InProgress & ~WriteOp & BitCounter == 7'h37;
-assign LatchByte0_d2 = InProgress & ~WriteOp & BitCounter == 7'h3F;
-
-wire MdcEn_n;
-
-// Connecting the Clock Generator Module
-eth_clockgen clkgen(.Clk(Clk), .Reset(Reset), .Divider(Divider[7:0]), .MdcEn(MdcEn), .MdcEn_n(MdcEn_n), .Mdc(Mdc)
- );
-
-// Connecting the Shift Register Module
-eth_shiftreg shftrg(.Clk(Clk), .Reset(Reset), .MdcEn_n(MdcEn_n), .Mdi(Mdi), .Fiad(Fiad), .Rgad(Rgad),
- .CtrlData(CtrlData), .WriteOp(WriteOp), .ByteSelect(ByteSelect), .LatchByte(LatchByte),
- .ShiftedBit(ShiftedBit), .Prsd(Prsd), .LinkFail(LinkFail)
- );
-
-// Connecting the Output Control Module
-eth_outputcontrol outctrl(.Clk(Clk), .Reset(Reset), .MdcEn_n(MdcEn_n), .InProgress(InProgress),
- .ShiftedBit(ShiftedBit), .BitCounter(BitCounter), .WriteOp(WriteOp), .NoPre(NoPre),
- .Mdo(Mdo), .MdoEn(MdoEn)
- );
-
-endmodule
diff --git a/eth/rtl/verilog/flow_ctrl_rx.v b/eth/rtl/verilog/flow_ctrl_rx.v deleted file mode 100644 index 6654c626b..000000000 --- a/eth/rtl/verilog/flow_ctrl_rx.v +++ /dev/null @@ -1,86 +0,0 @@ -
-// RX side of flow control -- when we are running out of RX space, send a PAUSE
-
-module flow_ctrl_rx
- (input rst,
- //host processor
- input pause_frame_send_en,
- input [15:0] pause_quanta_set,
- input [15:0] fc_hwmark,
- input [15:0] fc_lwmark,
- input [15:0] fc_padtime,
- // From MAC_rx_ctrl
- input rx_clk,
- input [15:0] rx_fifo_space,
- // MAC_tx_ctrl
- input tx_clk,
- output reg xoff_gen,
- output reg xon_gen,
- input xoff_gen_complete,
- input xon_gen_complete
- );
-
- // ******************************************************************************
- // Force our TX to send a PAUSE frame because our RX is nearly full
- // ******************************************************************************
-
- reg xon_int, xoff_int;
- reg [21:0] countdown;
-
- always @(posedge rx_clk or posedge rst)
- if(rst)
- begin
- xon_int <= 0;
- xoff_int <= 0;
- end
- else
- begin
- xon_int <= 0;
- xoff_int <= 0;
- if(pause_frame_send_en)
- if(countdown == 0)
- if(rx_fifo_space < fc_lwmark)
- xoff_int <= 1;
- else
- ;
- else
- if(rx_fifo_space > fc_hwmark)
- xon_int <= 1;
- end // else: !if(rst)
-
- reg xoff_int_d1, xon_int_d1;
-
- always @(posedge rx_clk)
- xon_int_d1 <= xon_int;
- always @(posedge rx_clk)
- xoff_int_d1 <= xoff_int;
-
- always @ (posedge tx_clk or posedge rst)
- if (rst)
- xoff_gen <=0;
- else if (xoff_gen_complete)
- xoff_gen <=0;
- else if (xoff_int | xoff_int_d1)
- xoff_gen <=1;
-
- always @ (posedge tx_clk or posedge rst)
- if (rst)
- xon_gen <=0;
- else if (xon_gen_complete)
- xon_gen <=0;
- else if (xon_int | xon_int_d1)
- xon_gen <=1;
-
- wire [21:0] pq_reduced = {pause_quanta_set,6'd0} - {6'd0,fc_padtime};
-
- always @(posedge tx_clk or posedge rst)
- if(rst)
- countdown <= 0;
- else if(xoff_gen)
- countdown <= pq_reduced;
- else if(xon_gen)
- countdown <= 0;
- else if(countdown != 0)
- countdown <= countdown - 1;
-
-endmodule // flow_ctrl
diff --git a/eth/rtl/verilog/flow_ctrl_tx.v b/eth/rtl/verilog/flow_ctrl_tx.v deleted file mode 100644 index 9f7556de4..000000000 --- a/eth/rtl/verilog/flow_ctrl_tx.v +++ /dev/null @@ -1,36 +0,0 @@ -
-// TX side of flow control -- when other side sends PAUSE, we wait
-
-module flow_ctrl_tx
- (input rst,
- input tx_clk,
- //host processor
- input tx_pause_en,
- // From MAC_rx_ctrl
- input [15:0] pause_quanta,
- input pause_quanta_val,
- // MAC_tx_ctrl
- output pause_apply,
- input pause_quanta_sub);
-
- // ******************************************************************************
- // Inhibit our TX from transmitting because they sent us a PAUSE frame
- // ******************************************************************************
-
- reg [15:0] pause_quanta_counter;
- reg pqval_d1, pqval_d2;
-
- always @(posedge tx_clk) pqval_d1 <= pause_quanta_val;
- always @(posedge tx_clk) pqval_d2 <= pqval_d1;
-
- always @ (posedge tx_clk or posedge rst)
- if (rst)
- pause_quanta_counter <= 0;
- else if (pqval_d1 & ~pqval_d2)
- pause_quanta_counter <= pause_quanta;
- else if((pause_quanta_counter!=0) & pause_quanta_sub)
- pause_quanta_counter <= pause_quanta_counter - 1;
-
- assign pause_apply = tx_pause_en & (pause_quanta_counter != 0);
-
-endmodule // flow_ctrl
diff --git a/eth/rtl/verilog/header.vh b/eth/rtl/verilog/header.vh deleted file mode 100644 index ca0b580e4..000000000 --- a/eth/rtl/verilog/header.vh +++ /dev/null @@ -1,7 +0,0 @@ -`define MAC_SOURCE_REPLACE_EN 1
-`define MAC_TARGET_CHECK_EN 1
-`define MAC_BROADCAST_FILTER_EN 1
-`define MAC_TX_FF_DEPTH 9
-`define MAC_RX_FF_DEPTH 9
-`define MAC_TARGET_XILINX 1
-// `define MAC_TARGET_ALTERA 1
diff --git a/eth/rtl/verilog/miim/eth_clockgen.v b/eth/rtl/verilog/miim/eth_clockgen.v deleted file mode 100644 index 9da732f7f..000000000 --- a/eth/rtl/verilog/miim/eth_clockgen.v +++ /dev/null @@ -1,141 +0,0 @@ -//////////////////////////////////////////////////////////////////////
-//// ////
-//// eth_clockgen.v ////
-//// ////
-//// This file is part of the Ethernet IP core project ////
-//// http://www.opencores.org/projects/ethmac/ ////
-//// ////
-//// Author(s): ////
-//// - Igor Mohor (igorM@opencores.org) ////
-//// ////
-//// All additional information is avaliable in the Readme.txt ////
-//// file. ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// Copyright (C) 2001 Authors ////
-//// ////
-//// This source file may be used and distributed without ////
-//// restriction provided that this copyright statement is not ////
-//// removed from the file and that any derivative work contains ////
-//// the original copyright notice and the associated disclaimer. ////
-//// ////
-//// This source file is free software; you can redistribute it ////
-//// and/or modify it under the terms of the GNU Lesser General ////
-//// Public License as published by the Free Software Foundation; ////
-//// either version 2.1 of the License, or (at your option) any ////
-//// later version. ////
-//// ////
-//// This source is distributed in the hope that it will be ////
-//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
-//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-//// PURPOSE. See the GNU Lesser General Public License for more ////
-//// details. ////
-//// ////
-//// You should have received a copy of the GNU Lesser General ////
-//// Public License along with this source; if not, download it ////
-//// from http://www.opencores.org/lgpl.shtml ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//
-// CVS Revision History
-//
-// $Log: eth_clockgen.v,v $
-// Revision 1.2 2005/12/13 12:54:49 maverickist
-// first simulation passed
-//
-// Revision 1.1.1.1 2005/12/13 01:51:45 Administrator
-// no message
-//
-// Revision 1.2 2005/04/27 15:58:45 Administrator
-// no message
-//
-// Revision 1.1.1.1 2004/12/15 06:38:54 Administrator
-// no message
-//
-// Revision 1.3 2002/01/23 10:28:16 mohor
-// Link in the header changed.
-//
-// Revision 1.2 2001/10/19 08:43:51 mohor
-// eth_timescale.v changed to timescale.v This is done because of the
-// simulation of the few cores in a one joined project.
-//
-// Revision 1.1 2001/08/06 14:44:29 mohor
-// A define FPGA added to select between Artisan RAM (for ASIC) and Block Ram (For Virtex).
-// Include files fixed to contain no path.
-// File names and module names changed ta have a eth_ prologue in the name.
-// File eth_timescale.v is used to define timescale
-// All pin names on the top module are changed to contain _I, _O or _OE at the end.
-// Bidirectional signal MDIO is changed to three signals (Mdc_O, Mdi_I, Mdo_O
-// and Mdo_OE. The bidirectional signal must be created on the top level. This
-// is done due to the ASIC tools.
-//
-// Revision 1.1 2001/07/30 21:23:42 mohor
-// Directory structure changed. Files checked and joind together.
-//
-// Revision 1.3 2001/06/01 22:28:55 mohor
-// This files (MIIM) are fully working. They were thoroughly tested. The testbench is not updated.
-//
-//
-
-module eth_clockgen(Clk, Reset, Divider, MdcEn, MdcEn_n, Mdc);
-
-//parameter Tp=1;
-
-input Clk; // Input clock (Host clock)
-input Reset; // Reset signal
-input [7:0] Divider; // Divider (input clock will be divided by the Divider[7:0])
-
-output Mdc; // Output clock
-output MdcEn; // Enable signal is asserted for one Clk period before Mdc rises.
-output MdcEn_n; // Enable signal is asserted for one Clk period before Mdc falls.
-
-reg Mdc;
-reg [7:0] Counter;
-
-wire CountEq0;
-wire [7:0] CounterPreset;
-wire [7:0] TempDivider;
-
-
-assign TempDivider[7:0] = (Divider[7:0]<2)? 8'h02 : Divider[7:0]; // If smaller than 2
-assign CounterPreset[7:0] = (TempDivider[7:0]>>1) -1; // We are counting half of period
-
-
-// Counter counts half period
-always @ (posedge Clk or posedge Reset)
-begin
- if(Reset)
- Counter[7:0] <= 8'h1;
- else
- begin
- if(CountEq0)
- begin
- Counter[7:0] <= CounterPreset[7:0];
- end
- else
- Counter[7:0] <= Counter - 8'h1;
- end
-end
-
-
-// Mdc is asserted every other half period
-always @ (posedge Clk or posedge Reset)
-begin
- if(Reset)
- Mdc <= 1'b0;
- else
- begin
- if(CountEq0)
- Mdc <= ~Mdc;
- end
-end
-
-
-assign CountEq0 = Counter == 8'h0;
-assign MdcEn = CountEq0 & ~Mdc;
-assign MdcEn_n = CountEq0 & Mdc;
-
-endmodule
-
-
diff --git a/eth/rtl/verilog/miim/eth_outputcontrol.v b/eth/rtl/verilog/miim/eth_outputcontrol.v deleted file mode 100644 index 3df6c560a..000000000 --- a/eth/rtl/verilog/miim/eth_outputcontrol.v +++ /dev/null @@ -1,158 +0,0 @@ -//////////////////////////////////////////////////////////////////////
-//// ////
-//// eth_outputcontrol.v ////
-//// ////
-//// This file is part of the Ethernet IP core project ////
-//// http://www.opencores.org/projects/ethmac/ ////
-//// ////
-//// Author(s): ////
-//// - Igor Mohor (igorM@opencores.org) ////
-//// ////
-//// All additional information is avaliable in the Readme.txt ////
-//// file. ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// Copyright (C) 2001 Authors ////
-//// ////
-//// This source file may be used and distributed without ////
-//// restriction provided that this copyright statement is not ////
-//// removed from the file and that any derivative work contains ////
-//// the original copyright notice and the associated disclaimer. ////
-//// ////
-//// This source file is free software; you can redistribute it ////
-//// and/or modify it under the terms of the GNU Lesser General ////
-//// Public License as published by the Free Software Foundation; ////
-//// either version 2.1 of the License, or (at your option) any ////
-//// later version. ////
-//// ////
-//// This source is distributed in the hope that it will be ////
-//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
-//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-//// PURPOSE. See the GNU Lesser General Public License for more ////
-//// details. ////
-//// ////
-//// You should have received a copy of the GNU Lesser General ////
-//// Public License along with this source; if not, download it ////
-//// from http://www.opencores.org/lgpl.shtml ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//
-// CVS Revision History
-//
-// $Log: eth_outputcontrol.v,v $
-// Revision 1.2 2005/12/13 12:54:49 maverickist
-// first simulation passed
-//
-// Revision 1.1.1.1 2005/12/13 01:51:45 Administrator
-// no message
-//
-// Revision 1.2 2005/04/27 15:58:46 Administrator
-// no message
-//
-// Revision 1.1.1.1 2004/12/15 06:38:54 Administrator
-// no message
-//
-// Revision 1.4 2002/07/09 20:11:59 mohor
-// Comment removed.
-//
-// Revision 1.3 2002/01/23 10:28:16 mohor
-// Link in the header changed.
-//
-// Revision 1.2 2001/10/19 08:43:51 mohor
-// eth_timescale.v changed to timescale.v This is done because of the
-// simulation of the few cores in a one joined project.
-//
-// Revision 1.1 2001/08/06 14:44:29 mohor
-// A define FPGA added to select between Artisan RAM (for ASIC) and Block Ram (For Virtex).
-// Include files fixed to contain no path.
-// File names and module names changed ta have a eth_ prologue in the name.
-// File eth_timescale.v is used to define timescale
-// All pin names on the top module are changed to contain _I, _O or _OE at the end.
-// Bidirectional signal MDIO is changed to three signals (Mdc_O, Mdi_I, Mdo_O
-// and Mdo_OE. The bidirectional signal must be created on the top level. This
-// is done due to the ASIC tools.
-//
-// Revision 1.1 2001/07/30 21:23:42 mohor
-// Directory structure changed. Files checked and joind together.
-//
-// Revision 1.3 2001/06/01 22:28:56 mohor
-// This files (MIIM) are fully working. They were thoroughly tested. The testbench is not updated.
-//
-//
-
-module eth_outputcontrol(Clk, Reset, InProgress, ShiftedBit, BitCounter, WriteOp, NoPre, MdcEn_n, Mdo, MdoEn);
-
-input Clk; // Host Clock
-input Reset; // General Reset
-input WriteOp; // Write Operation Latch (When asserted, write operation is in progress)
-input NoPre; // No Preamble (no 32-bit preamble)
-input InProgress; // Operation in progress
-input ShiftedBit; // This bit is output of the shift register and is connected to the Mdo signal
-input [6:0] BitCounter; // Bit Counter
-input MdcEn_n; // MII Management Data Clock Enable signal is asserted for one Clk period before Mdc falls.
-
-output Mdo; // MII Management Data Output
-output MdoEn; // MII Management Data Output Enable
-
-wire SerialEn;
-
-reg MdoEn_2d;
-reg MdoEn_d;
-reg MdoEn;
-
-reg Mdo_2d;
-reg Mdo_d;
-reg Mdo; // MII Management Data Output
-
-
-
-// Generation of the Serial Enable signal (enables the serialization of the data)
-assign SerialEn = WriteOp & InProgress & ( BitCounter>31 | ( ( BitCounter == 0 ) & NoPre ) )
- | ~WriteOp & InProgress & (( BitCounter>31 & BitCounter<46 ) | ( ( BitCounter == 0 ) & NoPre ));
-
-
-// Generation of the MdoEn signal
-always @ (posedge Clk or posedge Reset)
-begin
- if(Reset)
- begin
- MdoEn_2d <= 1'b0;
- MdoEn_d <= 1'b0;
- MdoEn <= 1'b0;
- end
- else
- begin
- if(MdcEn_n)
- begin
- MdoEn_2d <= SerialEn | InProgress & BitCounter<32;
- MdoEn_d <= MdoEn_2d;
- MdoEn <= MdoEn_d;
- end
- end
-end
-
-
-// Generation of the Mdo signal.
-always @ (posedge Clk or posedge Reset)
-begin
- if(Reset)
- begin
- Mdo_2d <= 1'b0;
- Mdo_d <= 1'b0;
- Mdo <= 1'b0;
- end
- else
- begin
- if(MdcEn_n)
- begin
- Mdo_2d <= ~SerialEn & BitCounter<32;
- Mdo_d <= ShiftedBit | Mdo_2d;
- Mdo <= Mdo_d;
- end
- end
-end
-
-
-
-endmodule
diff --git a/eth/rtl/verilog/miim/eth_shiftreg.v b/eth/rtl/verilog/miim/eth_shiftreg.v deleted file mode 100644 index 0b97bb7bc..000000000 --- a/eth/rtl/verilog/miim/eth_shiftreg.v +++ /dev/null @@ -1,159 +0,0 @@ -//////////////////////////////////////////////////////////////////////
-//// ////
-//// eth_shiftreg.v ////
-//// ////
-//// This file is part of the Ethernet IP core project ////
-//// http://www.opencores.org/projects/ethmac/ ////
-//// ////
-//// Author(s): ////
-//// - Igor Mohor (igorM@opencores.org) ////
-//// ////
-//// All additional information is avaliable in the Readme.txt ////
-//// file. ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//// ////
-//// Copyright (C) 2001 Authors ////
-//// ////
-//// This source file may be used and distributed without ////
-//// restriction provided that this copyright statement is not ////
-//// removed from the file and that any derivative work contains ////
-//// the original copyright notice and the associated disclaimer. ////
-//// ////
-//// This source file is free software; you can redistribute it ////
-//// and/or modify it under the terms of the GNU Lesser General ////
-//// Public License as published by the Free Software Foundation; ////
-//// either version 2.1 of the License, or (at your option) any ////
-//// later version. ////
-//// ////
-//// This source is distributed in the hope that it will be ////
-//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
-//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
-//// PURPOSE. See the GNU Lesser General Public License for more ////
-//// details. ////
-//// ////
-//// You should have received a copy of the GNU Lesser General ////
-//// Public License along with this source; if not, download it ////
-//// from http://www.opencores.org/lgpl.shtml ////
-//// ////
-//////////////////////////////////////////////////////////////////////
-//
-// CVS Revision History
-//
-// $Log: eth_shiftreg.v,v $
-// Revision 1.2 2005/12/13 12:54:49 maverickist
-// first simulation passed
-//
-// Revision 1.1.1.1 2005/12/13 01:51:45 Administrator
-// no message
-//
-// Revision 1.2 2005/04/27 15:58:47 Administrator
-// no message
-//
-// Revision 1.1.1.1 2004/12/15 06:38:54 Administrator
-// no message
-//
-// Revision 1.5 2002/08/14 18:16:59 mohor
-// LinkFail signal was not latching appropriate bit.
-//
-// Revision 1.4 2002/03/02 21:06:01 mohor
-// LinkFail signal was not latching appropriate bit.
-//
-// Revision 1.3 2002/01/23 10:28:16 mohor
-// Link in the header changed.
-//
-// Revision 1.2 2001/10/19 08:43:51 mohor
-// eth_timescale.v changed to timescale.v This is done because of the
-// simulation of the few cores in a one joined project.
-//
-// Revision 1.1 2001/08/06 14:44:29 mohor
-// A define FPGA added to select between Artisan RAM (for ASIC) and Block Ram (For Virtex).
-// Include files fixed to contain no path.
-// File names and module names changed ta have a eth_ prologue in the name.
-// File eth_timescale.v is used to define timescale
-// All pin names on the top module are changed to contain _I, _O or _OE at the end.
-// Bidirectional signal MDIO is changed to three signals (Mdc_O, Mdi_I, Mdo_O
-// and Mdo_OE. The bidirectional signal must be created on the top level. This
-// is done due to the ASIC tools.
-//
-// Revision 1.1 2001/07/30 21:23:42 mohor
-// Directory structure changed. Files checked and joind together.
-//
-// Revision 1.3 2001/06/01 22:28:56 mohor
-// This files (MIIM) are fully working. They were thoroughly tested. The testbench is not updated.
-//
-//
-
-module eth_shiftreg(Clk, Reset, MdcEn_n, Mdi, Fiad, Rgad, CtrlData, WriteOp, ByteSelect,
- LatchByte, ShiftedBit, Prsd, LinkFail);
-
-
-input Clk; // Input clock (Host clock)
-input Reset; // Reset signal
-input MdcEn_n; // Enable signal is asserted for one Clk period before Mdc falls.
-input Mdi; // MII input data
-input [4:0] Fiad; // PHY address
-input [4:0] Rgad; // Register address (within the selected PHY)
-input [15:0]CtrlData; // Control data (data to be written to the PHY)
-input WriteOp; // The current operation is a PHY register write operation
-input [3:0] ByteSelect; // Byte select
-input [1:0] LatchByte; // Byte select for latching (read operation)
-
-output ShiftedBit; // Bit shifted out of the shift register
-output[15:0]Prsd; // Read Status Data (data read from the PHY)
-output LinkFail; // Link Integrity Signal
-
-reg [7:0] ShiftReg; // Shift register for shifting the data in and out
-reg [15:0]Prsd;
-reg LinkFail;
-
-
-
-
-// ShiftReg[7:0] :: Shift Register Data
-always @ (posedge Clk or posedge Reset)
-begin
- if(Reset)
- begin
- ShiftReg[7:0] <= 8'h0;
- Prsd[15:0] <= 16'h0;
- LinkFail <= 1'b0;
- end
- else
- begin
- if(MdcEn_n)
- begin
- if(|ByteSelect)
- begin
- case (ByteSelect[3:0])
- 4'h1 : ShiftReg[7:0] <= {2'b01, ~WriteOp, WriteOp, Fiad[4:1]};
- 4'h2 : ShiftReg[7:0] <= {Fiad[0], Rgad[4:0], 2'b10};
- 4'h4 : ShiftReg[7:0] <= CtrlData[15:8];
- 4'h8 : ShiftReg[7:0] <= CtrlData[7:0];
- default : ShiftReg[7:0] <= 8'h0;
- endcase
- end
- else
- begin
- ShiftReg[7:0] <= {ShiftReg[6:0], Mdi};
- if(LatchByte[0])
- begin
- Prsd[7:0] <= {ShiftReg[6:0], Mdi};
- if(Rgad == 5'h01)
- LinkFail <= ~ShiftReg[1]; // this is bit [2], because it is not shifted yet
- end
- else
- begin
- if(LatchByte[1])
- Prsd[15:8] <= {ShiftReg[6:0], Mdi};
- end
- end
- end
- end
-end
-
-
-assign ShiftedBit = ShiftReg[7];
-
-
-endmodule
diff --git a/eth/rx_prot_engine.v b/eth/rx_prot_engine.v deleted file mode 100644 index d34f168d7..000000000 --- a/eth/rx_prot_engine.v +++ /dev/null @@ -1,156 +0,0 @@ - -module rx_prot_engine - #(parameter FIFO_SIZE=11) - (input clk, input rst, - - input Rx_mac_ra, - output Rx_mac_rd, - input [31:0] Rx_mac_data, - input [1:0] Rx_mac_BE, - input Rx_mac_pa, - input Rx_mac_sop, - input Rx_mac_eop, - input Rx_mac_err, - - output [31:0] wr_dat_o, - output wr_write_o, - output wr_done_o, - output wr_error_o, - input wr_ready_i, - input wr_full_i, - output wr_flag_o, - - input set_stb, - input [7:0] set_addr, - input [31:0] set_data, - - output [15:0] rx_fifo_status, - output reg [7:0] rx_seqnum, - output reg [7:0] rx_channel, - output [7:0] rx_flags - ); - - wire read, write, full, empty; - wire eop_i, err_i, eop_o, err_o, flag_i, sop_i, flag_o, sop_o; - wire [31:0] dat_i, dat_o; - reg xfer_active; - - wire [3:0] hdr_adr; - wire [31:0] hdr_dat; - - header_ram #(.REGNUM(48),.WIDTH(32)) rx_header_ram - (.clk(clk),.set_stb(set_stb),.set_addr(set_addr),.set_data(set_data), - .addr(hdr_adr),.q(hdr_dat)); - - // Buffer interface side - always @(posedge clk) - if(rst) - xfer_active <= 0; - else if(wr_ready_i & ~empty) - xfer_active <= 1; - else if(eop_o | err_o | wr_full_i) - xfer_active <= 0; - - assign wr_done_o = eop_o & wr_write_o; - assign wr_error_o = err_o & wr_write_o; - assign wr_dat_o = dat_o; - assign wr_write_o = xfer_active & ~empty; - assign read = wr_write_o; - - // FIFO in the middle - cascadefifo2 #(.WIDTH(36),.SIZE(11)) rx_prot_fifo - (.clk(clk),.rst(rst), - .datain({flag_i,sop_i,eop_i,err_i,dat_i}),.write(write),.full(full), - .dataout({flag_o,sop_o,eop_o,err_o,dat_o}),.read(read),.empty(empty), - .clear(0),.fifo_space(rx_fifo_status)); - - // MAC side - localparam ETH_TYPE = 16'hBEEF; - - reg [2:0] prot_state; - localparam PROT_IDLE = 0; - localparam PROT_HDR1 = 1; - localparam PROT_HDR2 = 2; - localparam PROT_HDR3 = 3; - localparam PROT_HDR4 = 4; - localparam PROT_HDR5 = 5; - localparam PROT_PKT = 6; - - // Things to control: flag_i, sop_i, eop_i, err_i, dat_i, write, Rx_mac_rd - // Inputs to SM: Rx_mac_sop, Rx_mac_eop, Rx_mac_ra, Rx_mac_pa, - // Rx_mac_BE, Rx_mac_err, full - - reg flag; - assign dat_i = Rx_mac_data; - assign sop_i = Rx_mac_sop; - assign eop_i = Rx_mac_eop; - assign err_i = Rx_mac_err; - assign flag_i = flag; - assign wr_flag_o = flag_o; - assign Rx_mac_rd = (prot_state != PROT_IDLE) && (~full|~Rx_mac_pa); - assign write = (prot_state != PROT_IDLE) && ~full && Rx_mac_pa; - - assign hdr_adr = {1'b0,prot_state[2:0]}; - - wire [7:0] rx_seqnum_p1 = rx_seqnum + 1; - - always @(posedge clk) - if(rst) - begin - prot_state <= PROT_IDLE; - flag <= 0; - end - else if(prot_state == PROT_IDLE) - begin - flag <= 0; - if(Rx_mac_ra) - prot_state <= PROT_HDR1; - end - else if(write) - case(prot_state) - PROT_HDR1 : - begin - prot_state <= PROT_HDR2; - if(hdr_dat != Rx_mac_data) - flag <= 1; - end - PROT_HDR2 : - begin - prot_state <= PROT_HDR3; - if(hdr_dat != Rx_mac_data) - flag <= 1; - end - PROT_HDR3 : - begin - prot_state <= PROT_HDR4; - if(hdr_dat != Rx_mac_data) - flag <= 1; - end - PROT_HDR4 : - begin - prot_state <= PROT_HDR5; - if(hdr_dat[31:16] != Rx_mac_data[31:16]) - flag <= 1; - rx_channel <= hdr_dat[15:8]; - end - PROT_HDR5 : - begin - prot_state <= PROT_PKT; - if((rx_seqnum_p1) != Rx_mac_data[15:8]) - flag <= 1; - end - PROT_PKT : - if(Rx_mac_eop | Rx_mac_err) - prot_state <= PROT_IDLE; - endcase // case(prot_state) - - always @(posedge clk) - if(rst) - rx_seqnum <= 8'hFF; - else if(set_stb & (set_addr == 54)) - rx_seqnum <= set_data[7:0]; - else if(write & (prot_state == PROT_HDR5) & ((rx_seqnum_p1) == Rx_mac_data[15:8]) & ~flag) - rx_seqnum <= rx_seqnum + 1; - - // Error cases -- Rx_mac_error, BE != 0 -endmodule // rx_prot_engine diff --git a/eth/tx_prot_engine.v b/eth/tx_prot_engine.v deleted file mode 100644 index 894d74a11..000000000 --- a/eth/tx_prot_engine.v +++ /dev/null @@ -1,144 +0,0 @@ - -module tx_prot_engine - (input clk, input rst, - - // To MAC - input Tx_mac_wa, - output Tx_mac_wr, - output [31:0] Tx_mac_data, - output [1:0] Tx_mac_BE, - output Tx_mac_sop, - output Tx_mac_eop, - - // To buffer interface - input [31:0] rd_dat_i, - output rd_read_o, - output rd_done_o, - output rd_error_o, - input rd_sop_i, - input rd_eop_i, - - // To control - input set_stb, - input [7:0] set_addr, - input [31:0] set_data, - - // Protocol Stuff - input [15:0] rx_fifo_status, - input [7:0] rx_seqnum - //input [7:0] tx_channel, - //input [7:0] tx_flags - ); - - wire [3:0] hdr_adr; - wire [31:0] hdr_dat; - wire [7:0] tx_channel; - - header_ram #(.REGNUM(32),.WIDTH(32)) tx_header_ram - (.clk(clk),.set_stb(set_stb),.set_addr(set_addr),.set_data(set_data), - .addr(hdr_adr),.q(hdr_dat)); - - setting_reg #(.my_addr(32)) sr_channel - (.clk(clk),.rst(rst),.strobe(set_stb),.addr(set_addr),.in(set_data), - .out(tx_channel),.changed()); - - // Might as well use a shortfifo here since they are basically free - wire empty, full, sfifo_write, sfifo_read; - wire [33:0] sfifo_in, sfifo_out; - - shortfifo #(.WIDTH(34)) txmac_sfifo - (.clk(clk),.rst(rst),.clear(0), - .datain(sfifo_in),.write(sfifo_write),.full(full), - .dataout(sfifo_out),.read(sfifo_read),.empty(empty)); - - // MAC side signals - // Inputs -- Tx_mac_wa, sfifo_out, empty - // outputs -- sfifo_read, Tx_mac_data, Tx_mac_wr, Tx_mac_BE, Tx_mac_sop, Tx_mac_eop - - // We are allowed to do one more write after we are told the FIFO is full - // This allows us to register the _wa signal and speed up timing. - reg tx_mac_wa_d1; - always @(posedge clk) - tx_mac_wa_d1 <= Tx_mac_wa; - - reg [2:0] prot_state; - localparam PROT_IDLE = 0; - localparam PROT_HDR1 = 1; - localparam PROT_HDR2 = 2; - localparam PROT_HDR3 = 3; - localparam PROT_HDR4 = 4; - localparam PROT_HDR5 = 5; - localparam PROT_PKT = 6; - - reg [7:0] tx_seqnum; - reg all_match; - always @(posedge clk) - if(rst) - tx_seqnum <= 0; - else if(set_stb & (set_addr == 36)) - tx_seqnum <= set_data[7:0]; - else if(tx_mac_wa_d1 & all_match & (prot_state == PROT_HDR5)) - tx_seqnum <= tx_seqnum + 1; - - always @(posedge clk) - if(rst) - prot_state <= PROT_IDLE; - else - if(tx_mac_wa_d1 & ~empty) - case(prot_state) - PROT_IDLE : - prot_state <= PROT_HDR1; - PROT_HDR1 : - prot_state <= PROT_HDR2; - PROT_HDR2 : - prot_state <= PROT_HDR3; - PROT_HDR3 : - prot_state <= PROT_HDR4; - PROT_HDR4 : - prot_state <= PROT_HDR5; - PROT_HDR5 : - prot_state <= PROT_PKT; - PROT_PKT : - if(sfifo_out[32] & ~empty) - prot_state <= PROT_IDLE; - default : - prot_state <= PROT_IDLE; - endcase // case(prot_state) - - assign hdr_adr = {1'b0,prot_state}; - wire match = (hdr_dat == sfifo_out[31:0]); - always @(posedge clk) - if(prot_state == PROT_IDLE) - all_match <= 1; - else if(tx_mac_wa_d1 & ~empty & - ((prot_state==PROT_HDR1)|(prot_state==PROT_HDR2)|(prot_state==PROT_HDR3))) - all_match <= all_match & match; - - localparam ETH_TYPE = 16'hBEEF; - assign Tx_mac_data = - ((prot_state == PROT_HDR5) & all_match) ? {rx_fifo_status,tx_seqnum,rx_seqnum} : - sfifo_out[31:0]; - assign sfifo_read = (prot_state != PROT_IDLE) & ~empty & tx_mac_wa_d1; - assign Tx_mac_wr = sfifo_read; - assign Tx_mac_BE = 0; // Since we only deal with packets that are multiples of 32 bits long - assign Tx_mac_sop = sfifo_out[33]; - assign Tx_mac_eop = sfifo_out[32]; - - // BUFFER side signals - reg xfer_active; - always @(posedge clk) - if(rst) - xfer_active <= 0; - else if(rd_eop_i & ~full) - xfer_active <= 0; - else if(rd_sop_i) - xfer_active <= 1; - - assign sfifo_in = {rd_sop_i, rd_eop_i, rd_dat_i}; - assign sfifo_write = xfer_active & ~full; - - assign rd_read_o = sfifo_write; - assign rd_done_o = 0; // Always send everything we're given? - assign rd_error_o = 0; // No possible error situations? - -endmodule // tx_prot_engine diff --git a/simple_gemac/simple_gemac_rx.v b/simple_gemac/simple_gemac_rx.v index c50791ff0..bad43a607 100644 --- a/simple_gemac/simple_gemac_rx.v +++ b/simple_gemac/simple_gemac_rx.v @@ -1,7 +1,7 @@ module simple_gemac_rx - (input clk125, input reset, + (input reset, input GMII_RX_CLK, input GMII_RX_DV, input GMII_RX_ER, input [7:0] GMII_RXD, output rx_clk, output [7:0] rx_data, output reg rx_valid, output rx_error, output reg rx_ack, input [47:0] ucast_addr, input [47:0] mcast_addr, diff --git a/simple_gemac/simple_gemac_wrapper.v b/simple_gemac/simple_gemac_wrapper.v index 7511f3fb9..71ad0cf0f 100644 --- a/simple_gemac/simple_gemac_wrapper.v +++ b/simple_gemac/simple_gemac_wrapper.v @@ -110,7 +110,7 @@ module simple_gemac_wrapper wire [35:0] tx_f36_data_int1; wire tx_f36_src_rdy_int1, tx_f36_dst_rdy_int1; - fifo_2clock #(.WIDTH(36), .SIZE(TXFIFOSIZE)) tx_2clk_fifo + fifo_2clock_cascade #(.WIDTH(36), .SIZE(TXFIFOSIZE)) tx_2clk_fifo (.wclk(sys_clk), .datain(tx_f36_data), .src_rdy_i(tx_f36_src_rdy), .dst_rdy_o(tx_f36_dst_rdy), .space(), .rclk(tx_clk), .dataout(tx_f36_data_int1), diff --git a/top/u2_core/u2_core.v b/top/u2_core/u2_core.v index e4c224ab6..456800521 100755 --- a/top/u2_core/u2_core.v +++ b/top/u2_core/u2_core.v @@ -572,7 +572,7 @@ module u2_core (.clk(dsp_clk), .rst(dsp_rst), .set_stb(set_stb),.set_addr(set_addr),.set_data(set_data), .master_time(master_time),.underrun(underrun), - .rd_dat_i(rd1_dat), .rd_flags_i(rd_flags), .rd_ready_i(rd1_ready_o), .rd_ready_o(rd1_ready_i), + .rd_dat_i(rd1_dat), .rd_flags_i(rd1_flags), .rd_ready_i(rd1_ready_o), .rd_ready_o(rd1_ready_i), .sample(sample_tx), .run(run_tx), .strobe(strobe_tx), .fifo_occupied(dsp_tx_occ),.fifo_full(dsp_tx_full),.fifo_empty(dsp_tx_empty), .debug(debug_txc) ); |