Line 62... |
Line 62... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
// Revision 1.13 2002/02/07 16:20:20 gorban
|
|
// major bug in 32-bit mode that prevented register access fixed.
|
|
//
|
|
// Revision 1.12 2001/12/19 08:03:34 mohor
|
// Revision 1.12 2001/12/19 08:03:34 mohor
|
// Warnings cleared.
|
// Warnings cleared.
|
//
|
//
|
// Revision 1.11 2001/12/06 14:51:04 gorban
|
// Revision 1.11 2001/12/06 14:51:04 gorban
|
// Bug in LSR[0] is fixed.
|
// Bug in LSR[0] is fixed.
|
Line 119... |
Line 116... |
//
|
//
|
|
|
// synopsys translate_off
|
// synopsys translate_off
|
`include "timescale.v"
|
`include "timescale.v"
|
// synopsys translate_on
|
// synopsys translate_on
|
`include "uart_defines.v"
|
//`include "uart_defines.v"
|
|
|
module uart_wb (clk, wb_rst_i,
|
module uart_wb (clk, wb_rst_i,
|
wb_we_i, wb_stb_i, wb_cyc_i, wb_ack_o, wb_adr_i,
|
wb_we_i, wb_stb_i, wb_cyc_i, wb_ack_o, wb_adr_i,
|
wb_adr_int, wb_dat_i, wb_dat_o, wb_dat8_i, wb_dat8_o, wb_dat32_o, wb_sel_i,
|
wb_adr_int, wb_dat_i, wb_dat_o, wb_dat8_i, wb_dat8_o, wb_dat32_o, wb_sel_i,
|
we_o, re_o // Write and read enable output for the core
|
we_o, re_o // Write and read enable output for the core
|
Line 224... |
Line 221... |
wb_stb_is <= #1 wb_stb_i;
|
wb_stb_is <= #1 wb_stb_i;
|
wb_dat_is <= #1 wb_dat_i;
|
wb_dat_is <= #1 wb_dat_i;
|
wb_sel_is <= #1 wb_sel_i;
|
wb_sel_is <= #1 wb_sel_i;
|
end
|
end
|
|
|
|
assign wb_adr_int = wb_adr_is;
|
|
|
`ifdef DATA_BUS_WIDTH_8 // 8-bit data bus
|
`ifdef DATA_BUS_WIDTH_8 // 8-bit data bus
|
always @(posedge clk or posedge wb_rst_i)
|
always @(posedge clk or posedge wb_rst_i)
|
if (wb_rst_i)
|
if (wb_rst_i)
|
wb_dat_o <= #1 0;
|
wb_dat_o <= #1 0;
|
else
|
else
|
wb_dat_o <= #1 wb_dat8_o;
|
wb_dat_o <= #1 wb_dat8_o;
|
|
|
always @(wb_dat_is)
|
always @(wb_dat_is)
|
wb_dat8_i = wb_dat_is;
|
wb_dat8_i = wb_dat_is;
|
|
|
assign wb_adr_int = wb_adr_is;
|
|
|
|
`else // 32-bit bus
|
`else // 32-bit bus
|
// put output to the correct byte in 32 bits using select line
|
// put output to the correct byte in 32 bits using select line
|
always @(posedge clk or posedge wb_rst_i)
|
always @(posedge clk or posedge wb_rst_i)
|
if (wb_rst_i)
|
if (wb_rst_i)
|
wb_dat_o <= #1 0;
|
wb_dat_o <= #1 0;
|
Line 260... |
Line 257... |
4'b0100 : wb_dat8_i = wb_dat_is[23:16];
|
4'b0100 : wb_dat8_i = wb_dat_is[23:16];
|
4'b1000 : wb_dat8_i = wb_dat_is[31:24];
|
4'b1000 : wb_dat8_i = wb_dat_is[31:24];
|
default : wb_dat8_i = wb_dat_is[7:0];
|
default : wb_dat8_i = wb_dat_is[7:0];
|
endcase // case(wb_sel_i)
|
endcase // case(wb_sel_i)
|
|
|
reg [1:0] adr2 ; // lower 2 bits of regenerated address
|
|
always @(wb_sel_is)
|
|
case (wb_sel_is)
|
|
`ifdef BIG_BYTE_ENDIAN
|
|
4'b0001 : adr2 = 2'b11;
|
|
4'b0010 : adr2 = 2'b10;
|
|
4'b0100 : adr2 = 2'b01;
|
|
4'b1000 : adr2 = 2'b00;
|
|
`else
|
|
4'b0001 : adr2 = 2'b00;
|
|
4'b0010 : adr2 = 2'b01;
|
|
4'b0100 : adr2 = 2'b10;
|
|
4'b1000 : adr2 = 2'b11;
|
|
`endif
|
|
default : adr2 = 2'b0;
|
|
endcase // case(wb_sel_is)
|
|
|
|
assign wb_adr_int = {wb_adr_is[`UART_ADDR_WIDTH-1:2], adr2};
|
|
`endif // !`ifdef DATA_BUS_WIDTH_8
|
`endif // !`ifdef DATA_BUS_WIDTH_8
|
|
|
endmodule
|
endmodule
|
|
|
|
|