Line 60... |
Line 60... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.37 2001/12/27 13:24:09 mohor
|
|
// lsr[7] was not showing overrun errors.
|
|
//
|
// Revision 1.36 2001/12/20 13:25:46 mohor
|
// Revision 1.36 2001/12/20 13:25:46 mohor
|
// rx push changed to be only one cycle wide.
|
// rx push changed to be only one cycle wide.
|
//
|
//
|
// Revision 1.35 2001/12/19 08:03:34 mohor
|
// Revision 1.35 2001/12/19 08:03:34 mohor
|
// Warnings cleared.
|
// Warnings cleared.
|
Line 193... |
Line 196... |
|
|
// 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"
|
|
|
`define UART_DL1 7:0
|
`define UART_DL1 7:0
|
`define UART_DL2 15:8
|
`define UART_DL2 15:8
|
|
|
module uart_regs (clk,
|
module uart_regs (clk,
|
Line 211... |
Line 214... |
`else
|
`else
|
// debug interface signals enabled
|
// debug interface signals enabled
|
ier, iir, fcr, mcr, lcr, msr, lsr, rf_count, tf_count, tstate, rstate,
|
ier, iir, fcr, mcr, lcr, msr, lsr, rf_count, tf_count, tstate, rstate,
|
`endif
|
`endif
|
rts_pad_o, dtr_pad_o, int_o
|
rts_pad_o, dtr_pad_o, int_o
|
|
`ifdef UART_HAS_BAUDRATE_OUTPUT
|
|
, baud_o
|
|
`endif
|
|
|
);
|
);
|
|
|
input clk;
|
input clk;
|
input wb_rst_i;
|
input wb_rst_i;
|
input [`UART_ADDR_WIDTH-1:0] wb_addr_i;
|
input [`UART_ADDR_WIDTH-1:0] wb_addr_i;
|
Line 228... |
Line 235... |
|
|
input [3:0] modem_inputs;
|
input [3:0] modem_inputs;
|
output rts_pad_o;
|
output rts_pad_o;
|
output dtr_pad_o;
|
output dtr_pad_o;
|
output int_o;
|
output int_o;
|
|
`ifdef UART_HAS_BAUDRATE_OUTPUT
|
|
output baud_o;
|
|
`endif
|
|
|
`ifdef DATA_BUS_WIDTH_8
|
`ifdef DATA_BUS_WIDTH_8
|
`else
|
`else
|
// if 32-bit databus and debug interface are enabled
|
// if 32-bit databus and debug interface are enabled
|
output [3:0] ier;
|
output [3:0] ier;
|
Line 248... |
Line 258... |
|
|
`endif
|
`endif
|
|
|
wire [3:0] modem_inputs;
|
wire [3:0] modem_inputs;
|
reg enable;
|
reg enable;
|
|
`ifdef UART_HAS_BAUDRATE_OUTPUT
|
|
assign baud_o = enable; // baud_o is actually the enable signal
|
|
`endif
|
|
|
|
|
wire stx_pad_o; // received from transmitter module
|
wire stx_pad_o; // received from transmitter module
|
wire srx_pad_i;
|
wire srx_pad_i;
|
|
|
reg [7:0] wb_dat_o;
|
reg [7:0] wb_dat_o;
|
|
|
Line 331... |
Line 346... |
wire thre_set_en; // THRE status is delayed one character time when a character is written to fifo.
|
wire thre_set_en; // THRE status is delayed one character time when a character is written to fifo.
|
reg [7:0] block_cnt; // While counter counts, THRE status is blocked (delayed one character cycle)
|
reg [7:0] block_cnt; // While counter counts, THRE status is blocked (delayed one character cycle)
|
reg [7:0] block_value; // One character length minus stop bit
|
reg [7:0] block_value; // One character length minus stop bit
|
|
|
// Transmitter Instance
|
// Transmitter Instance
|
uart_transmitter transmitter(clk, wb_rst_i, lcr, tf_push, wb_dat_i, enable, stx_pad_o, tstate, tf_count, tx_reset, lsr_mask);
|
wire serial_out;
|
|
|
|
uart_transmitter transmitter(clk, wb_rst_i, lcr, tf_push, wb_dat_i, enable, serial_out, tstate, tf_count, tx_reset, lsr_mask);
|
|
|
|
// handle loopback
|
|
wire serial_in = loopback ? serial_out : srx_pad_i;
|
|
assign stx_pad_o = loopback ? 1'b1 : serial_out;
|
|
|
// Receiver Instance
|
// Receiver Instance
|
uart_receiver receiver(clk, wb_rst_i, lcr, rf_pop, srx_pad_i, enable,
|
uart_receiver receiver(clk, wb_rst_i, lcr, rf_pop, serial_in, enable,
|
counter_t, rf_count, rf_data_out, rf_error_bit, rf_overrun, rx_reset, lsr_mask, rstate, rf_push_pulse);
|
counter_t, rf_count, rf_data_out, rf_error_bit, rf_overrun, rx_reset, lsr_mask, rstate, rf_push_pulse);
|
|
|
|
|
// Asynchronous reading here because the outputs are sampled in uart_wb.v file
|
// Asynchronous reading here because the outputs are sampled in uart_wb.v file
|
always @(dl or dlab or ier or iir or scratch
|
always @(dl or dlab or ier or iir or scratch
|