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

Subversion Repositories ethmac

[/] [ethmac/] [trunk/] [rtl/] [verilog/] [eth_macstatus.v] - Diff between revs 42 and 43

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

Rev 42 Rev 43
Line 39... Line 39...
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//
//
// CVS Revision History
// CVS Revision History
//
//
// $Log: not supported by cvs2svn $
// $Log: not supported by cvs2svn $
 
// Revision 1.5  2002/02/08 16:21:54  mohor
 
// Rx status is written back to the BD.
 
//
// Revision 1.4  2002/01/23 10:28:16  mohor
// Revision 1.4  2002/01/23 10:28:16  mohor
// Link in the header changed.
// Link in the header changed.
//
//
// Revision 1.3  2001/10/19 08:43:51  mohor
// Revision 1.3  2001/10/19 08:43:51  mohor
// eth_timescale.v changed to timescale.v This is done because of the
// eth_timescale.v changed to timescale.v This is done because of the
Line 76... Line 79...
                      MRxClk, Reset, ReceivedLengthOK, ReceiveEnd, ReceivedPacketGood, RxCrcError,
                      MRxClk, Reset, ReceivedLengthOK, ReceiveEnd, ReceivedPacketGood, RxCrcError,
                      MRxErr, MRxDV, RxStateSFD, RxStateData, RxStatePreamble, RxStateIdle, Transmitting,
                      MRxErr, MRxDV, RxStateSFD, RxStateData, RxStatePreamble, RxStateIdle, Transmitting,
                      RxByteCnt, RxByteCntEq0, RxByteCntGreat2, RxByteCntMaxFrame, ReceivedPauseFrm,
                      RxByteCnt, RxByteCntEq0, RxByteCntGreat2, RxByteCntMaxFrame, ReceivedPauseFrm,
                      InvalidSymbol, MRxD, LatchedCrcError, Collision, CollValid, RxLateCollision,
                      InvalidSymbol, MRxD, LatchedCrcError, Collision, CollValid, RxLateCollision,
                      r_RecSmall, r_MinFL, r_MaxFL, ShortFrame, DribbleNibble, ReceivedPacketTooBig, r_HugEn,
                      r_RecSmall, r_MinFL, r_MaxFL, ShortFrame, DribbleNibble, ReceivedPacketTooBig, r_HugEn,
                      LoadRxStatus
                      LoadRxStatus, StartTxDone, StartTxAbort, RetryCnt, RetryCntLatched, MTxClk, MaxCollisionOccured,
 
                      RetryLimit, LateCollision, LateCollLatched, StartDefer, DeferLatched, TxStartFrm,
 
                      StatePreamble, StateData, CarrierSense, CarrierSenseLost, TxUsedData
                    );
                    );
 
 
 
 
 
 
parameter Tp = 1;
parameter Tp = 1;
Line 107... Line 112...
input   [5:0] CollValid;
input   [5:0] CollValid;
input         r_RecSmall;
input         r_RecSmall;
input  [15:0] r_MinFL;
input  [15:0] r_MinFL;
input  [15:0] r_MaxFL;
input  [15:0] r_MaxFL;
input         r_HugEn;
input         r_HugEn;
 
input         StartTxDone;
 
input         StartTxAbort;
 
input   [3:0] RetryCnt;
 
input         MTxClk;
 
input         MaxCollisionOccured;
 
input         LateCollision;
 
input         StartDefer;
 
input         TxStartFrm;
 
input         StatePreamble;
 
input   [1:0] StateData;
 
input         CarrierSense;
 
input         TxUsedData;
 
 
 
 
output        ReceivedLengthOK;
output        ReceivedLengthOK;
output        ReceiveEnd;
output        ReceiveEnd;
output        ReceivedPacketGood;
output        ReceivedPacketGood;
output        InvalidSymbol;
output        InvalidSymbol;
Line 118... Line 136...
output        RxLateCollision;
output        RxLateCollision;
output        ShortFrame;
output        ShortFrame;
output        DribbleNibble;
output        DribbleNibble;
output        ReceivedPacketTooBig;
output        ReceivedPacketTooBig;
output        LoadRxStatus;
output        LoadRxStatus;
 
output  [3:0] RetryCntLatched;
 
output        RetryLimit;
 
output        LateCollLatched;
 
output        DeferLatched;
 
output        CarrierSenseLost;
 
 
 
 
reg           ReceiveEnd;
reg           ReceiveEnd;
 
 
reg           LatchedCrcError;
reg           LatchedCrcError;
reg           LatchedMRxErr;
reg           LatchedMRxErr;
reg           LoadRxStatus;
reg           LoadRxStatus;
reg           InvalidSymbol;
reg           InvalidSymbol;
 
reg     [3:0] RetryCntLatched;
 
reg           RetryLimit;
 
reg           LateCollLatched;
 
reg           DeferLatched;
 
reg           CarrierSenseLost;
 
 
wire          TakeSample;
wire          TakeSample;
wire          SetInvalidSymbol; // Invalid symbol was received during reception in 100Mbps 
wire          SetInvalidSymbol; // Invalid symbol was received during reception in 100Mbps 
 
 
// Crc error
// Crc error
Line 287... Line 316...
  else
  else
  if(TakeSample)
  if(TakeSample)
    ReceivedPacketTooBig <=#Tp ~r_HugEn & RxByteCnt[15:0] > r_MaxFL[15:0];
    ReceivedPacketTooBig <=#Tp ~r_HugEn & RxByteCnt[15:0] > r_MaxFL[15:0];
end
end
 
 
 
 
 
 
 
// Latched Retry counter for tx status
 
always @ (posedge MTxClk or posedge Reset)
 
begin
 
  if(Reset)
 
    RetryCntLatched <=#Tp 4'h0;
 
  else
 
  if(StartTxDone | StartTxAbort)
 
    RetryCntLatched <=#Tp RetryCnt;
 
end
 
 
 
 
 
// Latched Retransmission limit
 
always @ (posedge MTxClk or posedge Reset)
 
begin
 
  if(Reset)
 
    RetryLimit <=#Tp 4'h0;
 
  else
 
  if(StartTxDone | StartTxAbort)
 
    RetryLimit <=#Tp MaxCollisionOccured;
 
end
 
 
 
 
 
// Latched Late Collision
 
always @ (posedge MTxClk or posedge Reset)
 
begin
 
  if(Reset)
 
    LateCollLatched <=#Tp 1'b0;
 
  else
 
  if(StartTxDone | StartTxAbort)
 
    LateCollLatched <=#Tp LateCollision;
 
end
 
 
 
 
 
 
 
// Latched Defer state
 
always @ (posedge MTxClk or posedge Reset)
 
begin
 
  if(Reset)
 
    DeferLatched <=#Tp 1'b0;
 
  else
 
  if(StartDefer & TxUsedData)
 
    DeferLatched <=#Tp 1'b1;
 
  else
 
  if(TxStartFrm)
 
    DeferLatched <=#Tp 1'b0;
 
end
 
 
 
 
 
// CarrierSenseLost
 
always @ (posedge MTxClk or posedge Reset)
 
begin
 
  if(Reset)
 
    CarrierSenseLost <=#Tp 1'b0;
 
  else
 
  if((StatePreamble | (|StateData)) & ~CarrierSense)
 
    CarrierSenseLost <=#Tp 1'b1;
 
  else
 
  if(TxStartFrm)
 
    CarrierSenseLost <=#Tp 1'b0;
 
end
 
 
 
 
endmodule
endmodule
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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