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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [rtl/] [verilog/] [ethmac/] [ethmac.v] - Diff between revs 409 and 439

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

Rev 409 Rev 439
Line 63... Line 63...
 
 
  //TX
  //TX
  mtx_clk_pad_i, mtxd_pad_o, mtxen_pad_o, mtxerr_pad_o,
  mtx_clk_pad_i, mtxd_pad_o, mtxen_pad_o, mtxerr_pad_o,
 
 
  //RX
  //RX
  mrx_clk_pad_i, mrxd_pad_i, mrxdv_pad_i, mrxerr_pad_i, mcoll_pad_i, mcrs_pad_i,
   mrx_clk_pad_i, mrxd_pad_i, mrxdv_pad_i, mrxerr_pad_i, mcoll_pad_i,
 
   mcrs_pad_i,
 
 
  // MIIM
  // MIIM
  mdc_pad_o, md_pad_i, md_pad_o, md_padoe_o,
  mdc_pad_o, md_pad_i, md_pad_o, md_padoe_o,
 
 
  int_o
  int_o
Line 82... Line 83...
`endif
`endif
 
 
);
);
 
 
 
 
parameter Tp = 1;
 
 
 
 
 
// WISHBONE common
// WISHBONE common
input           wb_clk_i;     // WISHBONE clock
input           wb_clk_i;     // WISHBONE clock
input           wb_rst_i;     // WISHBONE reset
input           wb_rst_i;     // WISHBONE reset
input   [31:0]  wb_dat_i;     // WISHBONE data input
input   [31:0]  wb_dat_i;     // WISHBONE data input
Line 165... Line 164...
wire            r_RStat;
wire            r_RStat;
wire            r_ScanStat;
wire            r_ScanStat;
wire            NValid_stat;
wire            NValid_stat;
wire            Busy_stat;
wire            Busy_stat;
wire            LinkFail;
wire            LinkFail;
wire    [15:0]  Prsd;             // Read Status Data (data read from the PHY)
   wire [15:0]                          Prsd; // Read Status Data (data read 
 
                                             // from the PHY)
wire            WCtrlDataStart;
wire            WCtrlDataStart;
wire            RStatStart;
wire            RStatStart;
wire            UpdateMIIRX_DATAReg;
wire            UpdateMIIRX_DATAReg;
 
 
wire            TxStartFrm;
wire            TxStartFrm;
Line 194... Line 194...
 
 
 
 
// Connecting Miim module
// Connecting Miim module
eth_miim miim1
eth_miim miim1
(
(
  .Clk(wb_clk_i),                         .Reset(wb_rst_i),                   .Divider(r_ClkDiv),
      .Clk(wb_clk_i),
  .NoPre(r_MiiNoPre),                     .CtrlData(r_CtrlData),              .Rgad(r_RGAD),
      .Reset(wb_rst_i),
  .Fiad(r_FIAD),                          .WCtrlData(r_WCtrlData),            .RStat(r_RStat),
      .Divider(r_ClkDiv),
  .ScanStat(r_ScanStat),                  .Mdi(md_pad_i),                     .Mdo(md_pad_o),
      .NoPre(r_MiiNoPre),
  .MdoEn(md_padoe_o),                     .Mdc(mdc_pad_o),                    .Busy(Busy_stat),
      .CtrlData(r_CtrlData),
  .Prsd(Prsd),                            .LinkFail(LinkFail),                .Nvalid(NValid_stat),
      .Rgad(r_RGAD),
  .WCtrlDataStart(WCtrlDataStart),        .RStatStart(RStatStart),            .UpdateMIIRX_DATAReg(UpdateMIIRX_DATAReg)
      .Fiad(r_FIAD),
 
      .WCtrlData(r_WCtrlData),
 
      .RStat(r_RStat),
 
      .ScanStat(r_ScanStat),
 
      .Mdi(md_pad_i),
 
      .Mdo(md_pad_o),
 
      .MdoEn(md_padoe_o),
 
      .Mdc(mdc_pad_o),
 
      .Busy(Busy_stat),
 
      .Prsd(Prsd),
 
      .LinkFail(LinkFail),
 
      .Nvalid(NValid_stat),
 
      .WCtrlDataStart(WCtrlDataStart),
 
      .RStatStart(RStatStart),
 
      .UpdateMIIRX_DATAReg(UpdateMIIRX_DATAReg)
);
);
 
 
 
 
 
 
 
 
Line 353... Line 367...
 
 
 
 
// Connecting Ethernet registers
// Connecting Ethernet registers
eth_registers ethreg1
eth_registers ethreg1
(
(
  .DataIn(wb_dat_i),                      .Address(wb_adr_i[9:2]),                    .Rw(wb_we_i),
      .DataIn(wb_dat_i),
  .Cs(RegCs),                             .Clk(wb_clk_i),                             .Reset(wb_rst_i),
      .Address(wb_adr_i[9:2]),
  .DataOut(RegDataOut),                   .r_RecSmall(r_RecSmall),
      .Rw(wb_we_i),
  .r_Pad(r_Pad),                          .r_HugEn(r_HugEn),                          .r_CrcEn(r_CrcEn),
 
  .r_DlyCrcEn(r_DlyCrcEn),                .r_FullD(r_FullD),
      .Cs(RegCs),
  .r_ExDfrEn(r_ExDfrEn),                  .r_NoBckof(r_NoBckof),                      .r_LoopBck(r_LoopBck),
      .Clk(wb_clk_i),
  .r_IFG(r_IFG),                          .r_Pro(r_Pro),                              .r_Iam(),
      .Reset(wb_rst_i),
  .r_Bro(r_Bro),                          .r_NoPre(r_NoPre),                          .r_TxEn(r_TxEn),
 
  .r_RxEn(r_RxEn),                        .Busy_IRQ(Busy_IRQ),                        .RxE_IRQ(RxE_IRQ),
      .DataOut(RegDataOut),
  .RxB_IRQ(RxB_IRQ),                      .TxE_IRQ(TxE_IRQ),                          .TxB_IRQ(TxB_IRQ),
      .r_RecSmall(r_RecSmall),
 
 
 
      .r_Pad(r_Pad),
 
      .r_HugEn(r_HugEn),
 
      .r_CrcEn(r_CrcEn),
 
 
 
      .r_DlyCrcEn(r_DlyCrcEn),
 
      .r_FullD(r_FullD),
 
 
 
      .r_ExDfrEn(r_ExDfrEn),
 
      .r_NoBckof(r_NoBckof),
 
      .r_LoopBck(r_LoopBck),
 
 
 
      .r_IFG(r_IFG),
 
      .r_Pro(r_Pro),
 
      .r_Iam(),
 
 
 
      .r_Bro(r_Bro),
 
      .r_NoPre(r_NoPre),
 
      .r_TxEn(r_TxEn),
 
 
 
      .r_RxEn(r_RxEn),
 
      .Busy_IRQ(Busy_IRQ),
 
      .RxE_IRQ(RxE_IRQ),
 
 
 
      .RxB_IRQ(RxB_IRQ),
 
      .TxE_IRQ(TxE_IRQ),
 
      .TxB_IRQ(TxB_IRQ),
 
 
  .r_IPGT(r_IPGT),
  .r_IPGT(r_IPGT),
  .r_IPGR1(r_IPGR1),                      .r_IPGR2(r_IPGR2),                          .r_MinFL(r_MinFL),
 
  .r_MaxFL(r_MaxFL),                      .r_MaxRet(r_MaxRet),                        .r_CollValid(r_CollValid),
      .r_IPGR1(r_IPGR1),
  .r_TxFlow(r_TxFlow),                    .r_RxFlow(r_RxFlow),                        .r_PassAll(r_PassAll),
      .r_IPGR2(r_IPGR2),
  .r_MiiNoPre(r_MiiNoPre),                .r_ClkDiv(r_ClkDiv),
      .r_MinFL(r_MinFL),
  .r_WCtrlData(r_WCtrlData),              .r_RStat(r_RStat),                          .r_ScanStat(r_ScanStat),
 
  .r_RGAD(r_RGAD),                        .r_FIAD(r_FIAD),                            .r_CtrlData(r_CtrlData),
      .r_MaxFL(r_MaxFL),
  .NValid_stat(NValid_stat),              .Busy_stat(Busy_stat),
      .r_MaxRet(r_MaxRet),
  .LinkFail(LinkFail),                    .r_MAC(r_MAC),                              .WCtrlDataStart(WCtrlDataStart),
      .r_CollValid(r_CollValid),
  .RStatStart(RStatStart),                .UpdateMIIRX_DATAReg(UpdateMIIRX_DATAReg),  .Prsd(Prsd),
 
  .r_TxBDNum(r_TxBDNum),                  .int_o(int_o),
      .r_TxFlow(r_TxFlow),
  .r_HASH0(r_HASH0),                      .r_HASH1(r_HASH1),                          .r_TxPauseRq(r_TxPauseRq),
      .r_RxFlow(r_RxFlow),
  .r_TxPauseTV(r_TxPauseTV),              .RstTxPauseRq(RstTxPauseRq),                .TxCtrlEndFrm(TxCtrlEndFrm),
      .r_PassAll(r_PassAll),
  .StartTxDone(StartTxDone),              .TxClk(mtx_clk_pad_i),                      .RxClk(mrx_clk_pad_i),
 
 
      .r_MiiNoPre(r_MiiNoPre),
 
      .r_ClkDiv(r_ClkDiv),
 
 
 
      .r_WCtrlData(r_WCtrlData),
 
      .r_RStat(r_RStat),
 
      .r_ScanStat(r_ScanStat),
 
 
 
      .r_RGAD(r_RGAD),
 
      .r_FIAD(r_FIAD),
 
      .r_CtrlData(r_CtrlData),
 
 
 
      .NValid_stat(NValid_stat),
 
      .Busy_stat(Busy_stat),
 
 
 
      .LinkFail(LinkFail),
 
      .r_MAC(r_MAC),
 
      .WCtrlDataStart(WCtrlDataStart),
 
 
 
      .RStatStart(RStatStart),
 
      .UpdateMIIRX_DATAReg(UpdateMIIRX_DATAReg),
 
      .Prsd(Prsd),
 
 
 
      .r_TxBDNum(r_TxBDNum),
 
      .int_o(int_o),
 
 
 
      .r_HASH0(r_HASH0),
 
      .r_HASH1(r_HASH1),
 
      .r_TxPauseRq(r_TxPauseRq),
 
 
 
      .r_TxPauseTV(r_TxPauseTV),
 
      .RstTxPauseRq(RstTxPauseRq),
 
      .TxCtrlEndFrm(TxCtrlEndFrm),
 
 
 
      .StartTxDone(StartTxDone),
 
      .TxClk(mtx_clk_pad_i),
 
      .RxClk(mrx_clk_pad_i),
 
 
 .dbg_dat(wb_dbg_dat0),
 .dbg_dat(wb_dbg_dat0),
 
 
  .SetPauseTimer(SetPauseTimer)
  .SetPauseTimer(SetPauseTimer)
 
 
);
);
 
 
 
 
Line 391... Line 471...
wire        RxStartFrm;
wire        RxStartFrm;
wire        RxEndFrm;
wire        RxEndFrm;
wire        RxAbort;
wire        RxAbort;
 
 
wire        WillTransmit;            // Will transmit (to RxEthMAC)
wire        WillTransmit;            // Will transmit (to RxEthMAC)
wire        ResetCollision;          // Reset Collision (for synchronizing collision)
   wire        ResetCollision;          // Reset Collision (for synchronizing 
 
                                        // collision)
wire  [7:0] TxDataOut;               // Transmit Packet Data (to TxEthMAC)
wire  [7:0] TxDataOut;               // Transmit Packet Data (to TxEthMAC)
wire        WillSendControlFrame;
wire        WillSendControlFrame;
wire        ReceiveEnd;
wire        ReceiveEnd;
wire        ReceivedPacketGood;
wire        ReceivedPacketGood;
wire        ReceivedLengthOK;
wire        ReceivedLengthOK;
Line 411... Line 492...
wire  [1:0] StateData;
wire  [1:0] StateData;
 
 
// Connecting MACControl
// Connecting MACControl
eth_maccontrol maccontrol1
eth_maccontrol maccontrol1
(
(
  .MTxClk(mtx_clk_pad_i),                       .TPauseRq(TPauseRq),
      .MTxClk(mtx_clk_pad_i),
  .TxPauseTV(r_TxPauseTV),                      .TxDataIn(TxData),
      .TPauseRq(TPauseRq),
  .TxStartFrmIn(TxStartFrm),                    .TxEndFrmIn(TxEndFrm),
 
  .TxUsedDataIn(TxUsedDataIn),                  .TxDoneIn(TxDoneIn),
      .TxPauseTV(r_TxPauseTV),
  .TxAbortIn(TxAbortIn),                        .MRxClk(mrx_clk_pad_i),
      .TxDataIn(TxData),
  .RxData(RxData),                              .RxValid(RxValid),
 
  .RxStartFrm(RxStartFrm),                      .RxEndFrm(RxEndFrm),
      .TxStartFrmIn(TxStartFrm),
  .ReceiveEnd(ReceiveEnd),                      .ReceivedPacketGood(ReceivedPacketGood),
      .TxEndFrmIn(TxEndFrm),
 
 
 
      .TxUsedDataIn(TxUsedDataIn),
 
      .TxDoneIn(TxDoneIn),
 
 
 
      .TxAbortIn(TxAbortIn),
 
      .MRxClk(mrx_clk_pad_i),
 
 
 
      .RxData(RxData),
 
      .RxValid(RxValid),
 
 
 
      .RxStartFrm(RxStartFrm),
 
      .RxEndFrm(RxEndFrm),
 
 
 
      .ReceiveEnd(ReceiveEnd),
 
      .ReceivedPacketGood(ReceivedPacketGood),
 
 
  .TxFlow(r_TxFlow),
  .TxFlow(r_TxFlow),
  .RxFlow(r_RxFlow),                            .DlyCrcEn(r_DlyCrcEn),
 
  .MAC(r_MAC),                                  .PadIn(r_Pad | PerPacketPad),
      .RxFlow(r_RxFlow),
  .PadOut(PadOut),                              .CrcEnIn(r_CrcEn | PerPacketCrcEn),
      .DlyCrcEn(r_DlyCrcEn),
  .CrcEnOut(CrcEnOut),                          .TxReset(wb_rst_i),
 
  .RxReset(wb_rst_i),                           .ReceivedLengthOK(ReceivedLengthOK),
      .MAC(r_MAC),
  .TxDataOut(TxDataOut),                        .TxStartFrmOut(TxStartFrmOut),
      .PadIn(r_Pad | PerPacketPad),
  .TxEndFrmOut(TxEndFrmOut),                    .TxUsedDataOut(TxUsedData),
 
  .TxDoneOut(TxDone),                           .TxAbortOut(TxAbort),
      .PadOut(PadOut),
  .WillSendControlFrame(WillSendControlFrame),  .TxCtrlEndFrm(TxCtrlEndFrm),
      .CrcEnIn(r_CrcEn | PerPacketCrcEn),
  .ReceivedPauseFrm(ReceivedPauseFrm),          .ControlFrmAddressOK(ControlFrmAddressOK),
 
 
      .CrcEnOut(CrcEnOut),
 
      .TxReset(wb_rst_i),
 
 
 
      .RxReset(wb_rst_i),
 
      .ReceivedLengthOK(ReceivedLengthOK),
 
 
 
      .TxDataOut(TxDataOut),
 
      .TxStartFrmOut(TxStartFrmOut),
 
 
 
      .TxEndFrmOut(TxEndFrmOut),
 
      .TxUsedDataOut(TxUsedData),
 
 
 
      .TxDoneOut(TxDone),
 
      .TxAbortOut(TxAbort),
 
 
 
      .WillSendControlFrame(WillSendControlFrame),
 
      .TxCtrlEndFrm(TxCtrlEndFrm),
 
 
 
      .ReceivedPauseFrm(ReceivedPauseFrm),
 
      .ControlFrmAddressOK(ControlFrmAddressOK),
 
 
  .SetPauseTimer(SetPauseTimer),
  .SetPauseTimer(SetPauseTimer),
  .RxStatusWriteLatched_sync2(RxStatusWriteLatched_sync2),                .r_PassAll(r_PassAll)
 
 
      .RxStatusWriteLatched_sync2(RxStatusWriteLatched_sync2),
 
      .r_PassAll(r_PassAll)
);
);
 
 
 
 
 
 
wire TxCarrierSense;          // Synchronized CarrierSense (to Tx clock)
   wire        TxCarrierSense;          // Synchronized CarrierSense (to Tx 
 
                                        // clock)
wire Collision;               // Synchronized Collision
wire Collision;               // Synchronized Collision
 
 
reg CarrierSense_Tx1;
reg CarrierSense_Tx1;
reg CarrierSense_Tx2;
reg CarrierSense_Tx2;
reg Collision_Tx1;
reg Collision_Tx1;
Line 464... Line 585...
 
 
 
 
// Connecting TxEthMAC
// Connecting TxEthMAC
eth_txethmac txethmac1
eth_txethmac txethmac1
(
(
  .MTxClk(mtx_clk_pad_i),             .Reset(wb_rst_i),                   .CarrierSense(TxCarrierSense),
 
  .Collision(Collision),              .TxData(TxDataOut),                 .TxStartFrm(TxStartFrmOut),
      .MTxClk(mtx_clk_pad_i),
  .TxUnderRun(TxUnderRun),            .TxEndFrm(TxEndFrmOut),             .Pad(PadOut),
      .Reset(wb_rst_i),
  .MinFL(r_MinFL),                    .CrcEn(CrcEnOut),                   .FullD(r_FullD),
      .CarrierSense(TxCarrierSense),
  .HugEn(r_HugEn),                    .DlyCrcEn(r_DlyCrcEn),              .IPGT(r_IPGT),
 
  .IPGR1(r_IPGR1),                    .IPGR2(r_IPGR2),                    .CollValid(r_CollValid),
      .Collision(Collision),
  .MaxRet(r_MaxRet),                  .NoBckof(r_NoBckof),                .ExDfrEn(r_ExDfrEn),
      .TxData(TxDataOut),
  .MaxFL(r_MaxFL),                    .MTxEn(mtxen_pad_o),                .MTxD(mtxd_pad_o),
      .TxStartFrm(TxStartFrmOut),
  .MTxErr(mtxerr_pad_o),              .TxUsedData(TxUsedDataIn),          .TxDone(TxDoneIn),
 
  .TxRetry(TxRetry),                  .TxAbort(TxAbortIn),                .WillTransmit(WillTransmit),
      .TxUnderRun(TxUnderRun),
  .ResetCollision(ResetCollision),    .RetryCnt(RetryCnt),                .StartTxDone(StartTxDone),
      .TxEndFrm(TxEndFrmOut),
  .StartTxAbort(StartTxAbort),        .MaxCollisionOccured(MaxCollisionOccured), .LateCollision(LateCollision),
      .Pad(PadOut),
  .DeferIndication(DeferIndication),  .StatePreamble(StatePreamble),      .StateData(StateData)
 
 
      .MinFL(r_MinFL),
 
      .CrcEn(CrcEnOut),
 
      .FullD(r_FullD),
 
 
 
      .HugEn(r_HugEn),
 
      .DlyCrcEn(r_DlyCrcEn),
 
      .IPGT(r_IPGT),
 
 
 
      .IPGR1(r_IPGR1),
 
      .IPGR2(r_IPGR2),
 
      .CollValid(r_CollValid),
 
 
 
      .MaxRet(r_MaxRet),
 
      .NoBckof(r_NoBckof),
 
      .ExDfrEn(r_ExDfrEn),
 
 
 
      .MaxFL(r_MaxFL),
 
      .MTxEn(mtxen_pad_o),
 
      .MTxD(mtxd_pad_o),
 
 
 
      .MTxErr(mtxerr_pad_o),
 
      .TxUsedData(TxUsedDataIn),
 
      .TxDone(TxDoneIn),
 
 
 
      .TxRetry(TxRetry),
 
      .TxAbort(TxAbortIn),
 
      .WillTransmit(WillTransmit),
 
 
 
      .ResetCollision(ResetCollision),
 
      .RetryCnt(RetryCnt),
 
      .StartTxDone(StartTxDone),
 
 
 
      .StartTxAbort(StartTxAbort),
 
      .MaxCollisionOccured(MaxCollisionOccured),
 
      .LateCollision(LateCollision),
 
 
 
      .DeferIndication(DeferIndication),
 
      .StatePreamble(StatePreamble),
 
      .StateData(StateData)
);
);
 
 
 
 
 
 
 
 
Line 498... Line 658...
 
 
 
 
// Connecting RxEthMAC
// Connecting RxEthMAC
eth_rxethmac rxethmac1
eth_rxethmac rxethmac1
(
(
  .MRxClk(mrx_clk_pad_i),               .MRxDV(MRxDV_Lb),                     .MRxD(MRxD_Lb),
 
  .Transmitting(Transmitting),          .HugEn(r_HugEn),                      .DlyCrcEn(r_DlyCrcEn),
      .MRxClk(mrx_clk_pad_i),
  .MaxFL(r_MaxFL),                      .r_IFG(r_IFG),                        .Reset(wb_rst_i),
      .MRxDV(MRxDV_Lb),
  .RxData(RxData),                      .RxValid(RxValid),                    .RxStartFrm(RxStartFrm),
      .MRxD(MRxD_Lb),
  .RxEndFrm(RxEndFrm),                  .ByteCnt(RxByteCnt),
 
  .ByteCntEq0(RxByteCntEq0),            .ByteCntGreat2(RxByteCntGreat2),      .ByteCntMaxFrame(RxByteCntMaxFrame),
      .Transmitting(Transmitting),
  .CrcError(RxCrcError),                .StateIdle(RxStateIdle),              .StatePreamble(RxStatePreamble),
      .HugEn(r_HugEn),
  .StateSFD(RxStateSFD),                .StateData(RxStateData),
      .DlyCrcEn(r_DlyCrcEn),
  .MAC(r_MAC),                          .r_Pro(r_Pro),                        .r_Bro(r_Bro),
 
  .r_HASH0(r_HASH0),                    .r_HASH1(r_HASH1),                    .RxAbort(RxAbort),
      .MaxFL(r_MaxFL),
  .AddressMiss(AddressMiss),            .PassAll(r_PassAll),                  .ControlFrmAddressOK(ControlFrmAddressOK)
      .r_IFG(r_IFG),
 
      .Reset(wb_rst_i),
 
 
 
      .RxData(RxData),
 
      .RxValid(RxValid),
 
      .RxStartFrm(RxStartFrm),
 
 
 
      .RxEndFrm(RxEndFrm),
 
      .ByteCnt(RxByteCnt),
 
 
 
      .ByteCntEq0(RxByteCntEq0),
 
      .ByteCntGreat2(RxByteCntGreat2),
 
      .ByteCntMaxFrame(RxByteCntMaxFrame),
 
 
 
      .CrcError(RxCrcError),
 
      .StateIdle(RxStateIdle),
 
      .StatePreamble(RxStatePreamble),
 
 
 
      .StateSFD(RxStateSFD),
 
      .StateData(RxStateData),
 
 
 
      .MAC(r_MAC),
 
      .r_Pro(r_Pro),
 
      .r_Bro(r_Bro),
 
 
 
      .r_HASH0(r_HASH0),
 
      .r_HASH1(r_HASH1),
 
      .RxAbort(RxAbort),
 
 
 
      .AddressMiss(AddressMiss),
 
      .PassAll(r_PassAll),
 
      .ControlFrmAddressOK(ControlFrmAddressOK)
);
);
 
 
 
 
// MII Carrier Sense Synchronization
// MII Carrier Sense Synchronization
always @ (posedge mtx_clk_pad_i or posedge wb_rst_i)
always @ (posedge mtx_clk_pad_i or posedge wb_rst_i)
Line 609... Line 800...
always @ (posedge wb_clk_i or posedge wb_rst_i)
always @ (posedge wb_clk_i or posedge wb_rst_i)
begin
begin
  if(wb_rst_i)
  if(wb_rst_i)
    RstTxPauseRq <= 1'b0;
    RstTxPauseRq <= 1'b0;
  else
  else
    RstTxPauseRq <= WillSendControlFrame_sync2 & ~WillSendControlFrame_sync3;
          RstTxPauseRq <= WillSendControlFrame_sync2 &
 
                          ~WillSendControlFrame_sync3;
end
end
 
 
 
 
 
 
 
 
Line 654... Line 846...
// Synchronizing RxAbort to the WISHBONE clock
// Synchronizing RxAbort to the WISHBONE clock
always @ (posedge mrx_clk_pad_i or posedge wb_rst_i)
always @ (posedge mrx_clk_pad_i or posedge wb_rst_i)
begin
begin
  if(wb_rst_i)
  if(wb_rst_i)
    RxAbort_latch <=  1'b0;
    RxAbort_latch <=  1'b0;
  else if(RxAbort | (ShortFrame & ~r_RecSmall) | LatchedMRxErr & ~InvalidSymbol | (ReceivedPauseFrm & (~r_PassAll)))
        else if(RxAbort | (ShortFrame & ~r_RecSmall) | LatchedMRxErr &
 
                ~InvalidSymbol | (ReceivedPauseFrm & (~r_PassAll)))
    RxAbort_latch <=  1'b1;
    RxAbort_latch <=  1'b1;
  else if(RxAbortRst)
  else if(RxAbortRst)
    RxAbort_latch <=  1'b0;
    RxAbort_latch <=  1'b0;
end
end
 
 
Line 694... Line 887...
 
 
 
 
// Connecting Wishbone module
// Connecting Wishbone module
eth_wishbone wishbone
eth_wishbone wishbone
(
(
  .WB_CLK_I(wb_clk_i),                .WB_DAT_I(wb_dat_i),
 
 
      .WB_CLK_I(wb_clk_i),
 
      .WB_DAT_I(wb_dat_i),
 
 
  .WB_DAT_O(BD_WB_DAT_O),
  .WB_DAT_O(BD_WB_DAT_O),
 
 
  // WISHBONE slave
  // WISHBONE slave
  .WB_ADR_I(wb_adr_i[9:2]),           .WB_WE_I(wb_we_i),
 
  .BDCs(BDCs),                        .WB_ACK_O(BDAck),
      .WB_ADR_I(wb_adr_i[9:2]),
 
      .WB_WE_I(wb_we_i),
 
 
 
      .BDCs(BDCs),
 
      .WB_ACK_O(BDAck),
 
 
 
 
  .Reset(wb_rst_i),
  .Reset(wb_rst_i),
 
 
  // WISHBONE master
  // WISHBONE master
  .m_wb_adr_o(m_wb_adr_tmp),          .m_wb_sel_o(m_wb_sel_o),                  .m_wb_we_o(m_wb_we_o),
 
  .m_wb_dat_i(m_wb_dat_i),            .m_wb_dat_o(m_wb_dat_o),                  .m_wb_cyc_o(m_wb_cyc_o),
      .m_wb_adr_o(m_wb_adr_tmp),
  .m_wb_stb_o(m_wb_stb_o),            .m_wb_ack_i(m_wb_ack_i),                  .m_wb_err_i(m_wb_err_i),
      .m_wb_sel_o(m_wb_sel_o),
 
      .m_wb_we_o(m_wb_we_o),
 
 
 
      .m_wb_dat_i(m_wb_dat_i),
 
      .m_wb_dat_o(m_wb_dat_o),
 
      .m_wb_cyc_o(m_wb_cyc_o),
 
 
 
      .m_wb_stb_o(m_wb_stb_o),
 
      .m_wb_ack_i(m_wb_ack_i),
 
      .m_wb_err_i(m_wb_err_i),
 
 
`ifdef ETH_WISHBONE_B3
`ifdef ETH_WISHBONE_B3
  .m_wb_cti_o(m_wb_cti_o),            .m_wb_bte_o(m_wb_bte_o),
 
 
      .m_wb_cti_o(m_wb_cti_o),
 
      .m_wb_bte_o(m_wb_bte_o),
`endif
`endif
 
 
 
 
    //TX
    //TX
  .MTxClk(mtx_clk_pad_i),             .TxStartFrm(TxStartFrm),                  .TxEndFrm(TxEndFrm),
 
  .TxUsedData(TxUsedData),            .TxData(TxData),
      .MTxClk(mtx_clk_pad_i),
  .TxRetry(TxRetry),                  .TxAbort(TxAbort),                        .TxUnderRun(TxUnderRun),
      .TxStartFrm(TxStartFrm),
 
      .TxEndFrm(TxEndFrm),
 
 
 
      .TxUsedData(TxUsedData),
 
      .TxData(TxData),
 
 
 
      .TxRetry(TxRetry),
 
      .TxAbort(TxAbort),
 
      .TxUnderRun(TxUnderRun),
 
 
  .TxDone(TxDone),
  .TxDone(TxDone),
  .PerPacketCrcEn(PerPacketCrcEn),    .PerPacketPad(PerPacketPad),
 
 
      .PerPacketCrcEn(PerPacketCrcEn),
 
      .PerPacketPad(PerPacketPad),
 
 
  // Register
  // Register
  .r_TxEn(r_TxEn),                    .r_RxEn(r_RxEn),                          .r_TxBDNum(r_TxBDNum),
 
  .r_RxFlow(r_RxFlow),                      .r_PassAll(r_PassAll),
      .r_TxEn(r_TxEn),
 
      .r_RxEn(r_RxEn),
 
      .r_TxBDNum(r_TxBDNum),
 
 
 
      .r_RxFlow(r_RxFlow),
 
      .r_PassAll(r_PassAll),
 
 
  //RX
  //RX
  .MRxClk(mrx_clk_pad_i),             .RxData(RxData),                          .RxValid(RxValid),
 
  .RxStartFrm(RxStartFrm),            .RxEndFrm(RxEndFrm),
      .MRxClk(mrx_clk_pad_i),
  .Busy_IRQ(Busy_IRQ),                .RxE_IRQ(RxE_IRQ),                        .RxB_IRQ(RxB_IRQ),
      .RxData(RxData),
  .TxE_IRQ(TxE_IRQ),                  .TxB_IRQ(TxB_IRQ),
      .RxValid(RxValid),
 
 
  .RxAbort(RxAbort_wb),               .RxStatusWriteLatched_sync2(RxStatusWriteLatched_sync2),
      .RxStartFrm(RxStartFrm),
 
      .RxEndFrm(RxEndFrm),
  .InvalidSymbol(InvalidSymbol),      .LatchedCrcError(LatchedCrcError),        .RxLength(RxByteCnt),
 
  .RxLateCollision(RxLateCollision),  .ShortFrame(ShortFrame),                  .DribbleNibble(DribbleNibble),
      .Busy_IRQ(Busy_IRQ),
  .ReceivedPacketTooBig(ReceivedPacketTooBig), .LoadRxStatus(LoadRxStatus),     .RetryCntLatched(RetryCntLatched),
      .RxE_IRQ(RxE_IRQ),
  .RetryLimit(RetryLimit),            .LateCollLatched(LateCollLatched),        .DeferLatched(DeferLatched),
      .RxB_IRQ(RxB_IRQ),
 
 
 
      .TxE_IRQ(TxE_IRQ),
 
      .TxB_IRQ(TxB_IRQ),
 
 
 
 
 
      .RxAbort(RxAbort_wb),
 
      .RxStatusWriteLatched_sync2(RxStatusWriteLatched_sync2),
 
 
 
 
 
      .InvalidSymbol(InvalidSymbol),
 
      .LatchedCrcError(LatchedCrcError),
 
      .RxLength(RxByteCnt),
 
 
 
      .RxLateCollision(RxLateCollision),
 
      .ShortFrame(ShortFrame),
 
      .DribbleNibble(DribbleNibble),
 
 
 
      .ReceivedPacketTooBig(ReceivedPacketTooBig),
 
      .LoadRxStatus(LoadRxStatus),
 
      .RetryCntLatched(RetryCntLatched),
 
 
 
      .RetryLimit(RetryLimit),
 
      .LateCollLatched(LateCollLatched),
 
      .DeferLatched(DeferLatched),
 
 
  .RstDeferLatched(RstDeferLatched),
  .RstDeferLatched(RstDeferLatched),
  .CarrierSenseLost(CarrierSenseLost),.ReceivedPacketGood(ReceivedPacketGood),  .AddressMiss(AddressMiss),
 
 
      .CarrierSenseLost(CarrierSenseLost),
 
      .ReceivedPacketGood(ReceivedPacketGood),
 
      .AddressMiss(AddressMiss),
 
 
  .ReceivedPauseFrm(ReceivedPauseFrm)
  .ReceivedPauseFrm(ReceivedPauseFrm)
 
 
`ifdef ETH_BIST
`ifdef ETH_BIST
  ,
  ,
 
 
  .mbist_si_i       (mbist_si_i),
  .mbist_si_i       (mbist_si_i),
 
 
  .mbist_so_o       (mbist_so_o),
  .mbist_so_o       (mbist_so_o),
 
 
  .mbist_ctrl_i       (mbist_ctrl_i)
  .mbist_ctrl_i       (mbist_ctrl_i)
`endif
`endif
 `ifdef WISHBONE_DEBUG
 `ifdef WISHBONE_DEBUG
  ,
  ,
 
 
  .dbg_dat0(wb_dbg_dat0)
  .dbg_dat0(wb_dbg_dat0)
`endif
`endif
 
 
);
);
 
 
assign m_wb_adr_o = {m_wb_adr_tmp, 2'h0};
assign m_wb_adr_o = {m_wb_adr_tmp, 2'h0};
 
 
// Connecting MacStatus module
// Connecting MacStatus module
eth_macstatus macstatus1
eth_macstatus macstatus1
(
(
  .MRxClk(mrx_clk_pad_i),             .Reset(wb_rst_i),
 
  .ReceiveEnd(ReceiveEnd),            .ReceivedPacketGood(ReceivedPacketGood),     .ReceivedLengthOK(ReceivedLengthOK),
      .MRxClk(mrx_clk_pad_i),
  .RxCrcError(RxCrcError),            .MRxErr(MRxErr_Lb),                          .MRxDV(MRxDV_Lb),
      .Reset(wb_rst_i),
  .RxStateSFD(RxStateSFD),            .RxStateData(RxStateData),                   .RxStatePreamble(RxStatePreamble),
 
  .RxStateIdle(RxStateIdle),          .Transmitting(Transmitting),                 .RxByteCnt(RxByteCnt),
      .ReceiveEnd(ReceiveEnd),
  .RxByteCntEq0(RxByteCntEq0),        .RxByteCntGreat2(RxByteCntGreat2),           .RxByteCntMaxFrame(RxByteCntMaxFrame),
      .ReceivedPacketGood(ReceivedPacketGood),
 
      .ReceivedLengthOK(ReceivedLengthOK),
 
 
 
      .RxCrcError(RxCrcError),
 
      .MRxErr(MRxErr_Lb),
 
      .MRxDV(MRxDV_Lb),
 
 
 
      .RxStateSFD(RxStateSFD),
 
      .RxStateData(RxStateData),
 
      .RxStatePreamble(RxStatePreamble),
 
 
 
      .RxStateIdle(RxStateIdle),
 
      .Transmitting(Transmitting),
 
      .RxByteCnt(RxByteCnt),
 
 
 
      .RxByteCntEq0(RxByteCntEq0),
 
      .RxByteCntGreat2(RxByteCntGreat2),
 
      .RxByteCntMaxFrame(RxByteCntMaxFrame),
 
 
  .InvalidSymbol(InvalidSymbol),
  .InvalidSymbol(InvalidSymbol),
  .MRxD(MRxD_Lb),                     .LatchedCrcError(LatchedCrcError),           .Collision(mcoll_pad_i),
 
  .CollValid(r_CollValid),            .RxLateCollision(RxLateCollision),           .r_RecSmall(r_RecSmall),
      .MRxD(MRxD_Lb),
  .r_MinFL(r_MinFL),                  .r_MaxFL(r_MaxFL),                           .ShortFrame(ShortFrame),
      .LatchedCrcError(LatchedCrcError),
  .DribbleNibble(DribbleNibble),      .ReceivedPacketTooBig(ReceivedPacketTooBig), .r_HugEn(r_HugEn),
      .Collision(mcoll_pad_i),
  .LoadRxStatus(LoadRxStatus),        .RetryCnt(RetryCnt),                         .StartTxDone(StartTxDone),
 
  .StartTxAbort(StartTxAbort),        .RetryCntLatched(RetryCntLatched),           .MTxClk(mtx_clk_pad_i),
      .CollValid(r_CollValid),
  .MaxCollisionOccured(MaxCollisionOccured), .RetryLimit(RetryLimit),              .LateCollision(LateCollision),
      .RxLateCollision(RxLateCollision),
  .LateCollLatched(LateCollLatched),  .DeferIndication(DeferIndication),           .DeferLatched(DeferLatched),
      .r_RecSmall(r_RecSmall),
 
 
 
      .r_MinFL(r_MinFL),
 
      .r_MaxFL(r_MaxFL),
 
      .ShortFrame(ShortFrame),
 
 
 
      .DribbleNibble(DribbleNibble),
 
      .ReceivedPacketTooBig(ReceivedPacketTooBig),
 
      .r_HugEn(r_HugEn),
 
 
 
      .LoadRxStatus(LoadRxStatus),
 
      .RetryCnt(RetryCnt),
 
      .StartTxDone(StartTxDone),
 
 
 
      .StartTxAbort(StartTxAbort),
 
      .RetryCntLatched(RetryCntLatched),
 
      .MTxClk(mtx_clk_pad_i),
 
 
 
      .MaxCollisionOccured(MaxCollisionOccured),
 
      .RetryLimit(RetryLimit),
 
      .LateCollision(LateCollision),
 
 
 
      .LateCollLatched(LateCollLatched),
 
      .DeferIndication(DeferIndication),
 
      .DeferLatched(DeferLatched),
 
 
  .RstDeferLatched(RstDeferLatched),
  .RstDeferLatched(RstDeferLatched),
  .TxStartFrm(TxStartFrmOut),         .StatePreamble(StatePreamble),               .StateData(StateData),
 
  .CarrierSense(CarrierSense_Tx2),    .CarrierSenseLost(CarrierSenseLost),         .TxUsedData(TxUsedDataIn),
      .TxStartFrm(TxStartFrmOut),
  .LatchedMRxErr(LatchedMRxErr),      .Loopback(r_LoopBck),                        .r_FullD(r_FullD)
      .StatePreamble(StatePreamble),
 
      .StateData(StateData),
 
 
 
      .CarrierSense(CarrierSense_Tx2),
 
      .CarrierSenseLost(CarrierSenseLost),
 
      .TxUsedData(TxUsedDataIn),
 
 
 
      .LatchedMRxErr(LatchedMRxErr),
 
      .Loopback(r_LoopBck),
 
      .r_FullD(r_FullD)
);
);
 
 
 
 
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.