OpenCores
URL https://opencores.org/ocsvn/sgmii/sgmii/trunk

Subversion Repositories sgmii

[/] [sgmii/] [trunk/] [src/] [mRateAdapter.v] - Diff between revs 2 and 11

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 2 Rev 11
Line 45... Line 45...
        reg r_TxER_D;
        reg r_TxER_D;
        reg r_Active;
        reg r_Active;
        wire w_TxSop;
        wire w_TxSop;
        wire w_TxEop;
        wire w_TxEop;
 
 
        assign w_TxActive = i_TxEN & i_TxER;
        assign w_TxActive = i_TxEN | i_TxER;
        assign w_TxSop = (~r_TxActive && w_TxActive);
        assign w_TxSop = (~r_TxActive & w_TxActive);
        assign w_TxEop = (r_TxActive && ~w_TxActive);
        assign w_TxEop = (r_TxActive & ~w_TxActive);
 
 
        always@(posedge i_TxClk)
        always@(posedge i_TxClk)
        begin
        begin
                r_TxActive <= w_TxActive;
                r_TxActive <= w_TxActive;
 
 
Line 59... Line 59...
 
 
                if(w_TxActive) begin
                if(w_TxActive) begin
                        if(r_HighNib) r8_Byte <= {i8_TxD[3:0],r4_LowNib};
                        if(r_HighNib) r8_Byte <= {i8_TxD[3:0],r4_LowNib};
                        if(r_HighNib && (~w_TxSop)) r_TxEN_D <= i_TxEN;
                        if(r_HighNib && (~w_TxSop)) r_TxEN_D <= i_TxEN;
                        if(r_HighNib && (~w_TxSop)) r_TxER_D <= i_TxER;
                        if(r_HighNib && (~w_TxSop)) r_TxER_D <= i_TxER;
                        end else
                end else if(r_HighNib)
                         begin
                         begin
                         r_TxEN_D <= 1'b0;
                         r_TxEN_D <= 1'b0;
                         r_TxER_D <= 1'b0;
                         r_TxER_D <= 1'b0;
                         end
                         end
                if((~r_HighNib)|| (w_TxSop))
                if((~r_HighNib)|| (w_TxSop))
Line 102... Line 102...
        always@(posedge i_GClk)
        always@(posedge i_GClk)
        begin
        begin
                r_RxActive <= w_RxActive;
                r_RxActive <= w_RxActive;
                if(w_RxSop) r4_Cntr<=4'h0;
                if(w_RxSop) r4_Cntr<=4'h0;
                else if(w_RxActive) r4_Cntr <= ((r4_Cntr==4'h9)?4'h0:(r4_Cntr+4'h1));
                else if(w_RxActive) r4_Cntr <= ((r4_Cntr==4'h9)?4'h0:(r4_Cntr+4'h1));
 
                else r4_Cntr <= 4'h0;
 
 
                if(r4_Cntr==4'h0) r6_GByte <= {i_RxEN,i_RxER,i8_RxD[3:0]};
                if(r4_Cntr==4'h0) r6_GByte <= {i_RxEN,i_RxER,i8_RxD[3:0]};
                else if(r4_Cntr==4'h5) r6_GByte <= {i_RxEN,i_RxER,i8_RxD[7:4]};
                else if(r4_Cntr==4'h5) r6_GByte <= {i_RxEN,i_RxER,i8_RxD[7:4]};
        end
        end
 
 
        always@(posedge i_RxClk)
        always@(posedge i_RxClk)

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.