Line 39... |
Line 39... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.23 2002/03/25 13:33:53 mohor
|
|
// md_padoen_o changed to md_padoe_o. Signal was always active high, just
|
|
// name was incorrect.
|
|
//
|
// Revision 1.22 2002/02/26 16:59:54 mohor
|
// Revision 1.22 2002/02/26 16:59:54 mohor
|
// Small fixes for external/internal DMA missmatches.
|
// Small fixes for external/internal DMA missmatches.
|
//
|
//
|
// Revision 1.21 2002/02/26 16:21:00 mohor
|
// Revision 1.21 2002/02/26 16:21:00 mohor
|
// Interrupts changed in the top file
|
// Interrupts changed in the top file
|
Line 324... |
Line 328... |
wire TxC_IRQ; // Interrupt Tx Control Frame
|
wire TxC_IRQ; // Interrupt Tx Control Frame
|
wire RxC_IRQ; // Interrupt Rx Control Frame
|
wire RxC_IRQ; // Interrupt Rx Control Frame
|
|
|
wire DWord;
|
wire DWord;
|
wire BDAck;
|
wire BDAck;
|
wire [31:0] DMA_WB_DAT_O; // wb_dat_o that comes from the WishboneDMA module
|
wire [31:0] BD_WB_DAT_O; // wb_dat_o that comes from the Wishbone module (for buffer descriptors read/write)
|
wire BDCs; // Buffer descriptor CS
|
wire BDCs; // Buffer descriptor CS
|
|
|
|
wire temp_wb_ack_o;
|
|
wire [31:0] temp_wb_dat_o;
|
|
wire temp_wb_err_o;
|
|
|
|
`ifdef ETH_REGISTERED_OUTPUTS
|
|
reg temp_wb_ack_o_reg;
|
|
reg [31:0] temp_wb_dat_o_reg;
|
|
reg temp_wb_err_o_reg;
|
|
`endif
|
|
|
assign DWord = &wb_sel_i;
|
assign DWord = &wb_sel_i;
|
assign RegCs = wb_stb_i & wb_cyc_i & DWord & ~wb_adr_i[11] & ~wb_adr_i[10];
|
assign RegCs = wb_stb_i & wb_cyc_i & DWord & ~wb_adr_i[11] & ~wb_adr_i[10]; // 0x0 - 0x3FF
|
assign BDCs = wb_stb_i & wb_cyc_i & DWord & ~wb_adr_i[11] & wb_adr_i[10];
|
assign BDCs = wb_stb_i & wb_cyc_i & DWord & ~wb_adr_i[11] & wb_adr_i[10]; // 0x400 - 0x5FF
|
assign wb_ack_o = RegCs | BDAck;
|
assign temp_wb_ack_o = RegCs | BDAck;
|
assign wb_err_o = wb_stb_i & wb_cyc_i & ~DWord;
|
assign temp_wb_dat_o = (RegCs & ~wb_we_i)? RegDataOut : BD_WB_DAT_O;
|
|
assign temp_wb_err_o = wb_stb_i & wb_cyc_i & ~DWord;
|
|
|
|
`ifdef ETH_REGISTERED_OUTPUTS
|
|
assign wb_ack_o = temp_wb_ack_o_reg;
|
|
assign wb_dat_o[31:0] = temp_wb_dat_o_reg;
|
|
assign wb_err_o = temp_wb_err_o_reg;
|
|
`else
|
|
assign wb_ack_o = temp_wb_ack_o;
|
|
assign wb_dat_o[31:0] = temp_wb_dat_o;
|
|
assign wb_err_o = temp_wb_err_o;
|
|
`endif
|
|
|
|
|
// Selecting the WISHBONE output data
|
|
assign wb_dat_o[31:0] = (RegCs & ~wb_we_i)? RegDataOut : DMA_WB_DAT_O;
|
`ifdef ETH_REGISTERED_OUTPUTS
|
|
always @ (posedge wb_clk_i or posedge wb_rst_i)
|
|
begin
|
|
if(wb_rst_i)
|
|
begin
|
|
temp_wb_ack_o_reg <=#Tp 1'b0;
|
|
temp_wb_dat_o_reg <=#Tp 32'h0;
|
|
temp_wb_err_o_reg <=#Tp 1'b0;
|
|
end
|
|
else
|
|
begin
|
|
temp_wb_ack_o_reg <=#Tp temp_wb_ack_o;
|
|
temp_wb_dat_o_reg <=#Tp temp_wb_dat_o;
|
|
temp_wb_err_o_reg <=#Tp temp_wb_err_o;
|
|
end
|
|
end
|
|
`endif
|
|
|
|
|
|
|
// Connecting Ethernet registers
|
// Connecting Ethernet registers
|
eth_registers ethreg1
|
eth_registers ethreg1
|
(
|
(
|
Line 590... |
Line 631... |
`else
|
`else
|
eth_wishbone wishbone
|
eth_wishbone wishbone
|
`endif
|
`endif
|
(
|
(
|
.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(DMA_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),
|
.WB_ADR_I(wb_adr_i[9:2]), .WB_WE_I(wb_we_i),
|
.BDCs(BDCs), .WB_ACK_O(BDAck),
|
.BDCs(BDCs), .WB_ACK_O(BDAck),
|
|
|
Line 629... |
Line 670... |
.RxStartFrm(RxStartFrm), .RxEndFrm(RxEndFrm),
|
.RxStartFrm(RxStartFrm), .RxEndFrm(RxEndFrm),
|
.Busy_IRQ(Busy_IRQ), .RxE_IRQ(RxE_IRQ), .RxB_IRQ(RxB_IRQ),
|
.Busy_IRQ(Busy_IRQ), .RxE_IRQ(RxE_IRQ), .RxB_IRQ(RxB_IRQ),
|
.TxE_IRQ(TxE_IRQ), .TxB_IRQ(TxB_IRQ), .TxC_IRQ(TxC_IRQ),
|
.TxE_IRQ(TxE_IRQ), .TxB_IRQ(TxB_IRQ), .TxC_IRQ(TxC_IRQ),
|
.RxC_IRQ(RxC_IRQ),
|
.RxC_IRQ(RxC_IRQ),
|
|
|
.RxAbort(RxAbort),
|
.RxAbort(RxAbort | (ShortFrame & ~r_RecSmall)),
|
|
|
.InvalidSymbol(InvalidSymbol), .LatchedCrcError(LatchedCrcError), .RxLength(RxByteCnt),
|
.InvalidSymbol(InvalidSymbol), .LatchedCrcError(LatchedCrcError), .RxLength(RxByteCnt),
|
.RxLateCollision(RxLateCollision), .ShortFrame(ShortFrame), .DribbleNibble(DribbleNibble),
|
.RxLateCollision(RxLateCollision), .ShortFrame(ShortFrame), .DribbleNibble(DribbleNibble),
|
.ReceivedPacketTooBig(ReceivedPacketTooBig), .LoadRxStatus(LoadRxStatus), .RetryCntLatched(RetryCntLatched),
|
.ReceivedPacketTooBig(ReceivedPacketTooBig), .LoadRxStatus(LoadRxStatus), .RetryCntLatched(RetryCntLatched),
|
.RetryLimit(RetryLimit), .LateCollLatched(LateCollLatched), .DeferLatched(DeferLatched),
|
.RetryLimit(RetryLimit), .LateCollLatched(LateCollLatched), .DeferLatched(DeferLatched),
|