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

Subversion Repositories uart16550

[/] [uart16550/] [trunk/] [rtl/] [verilog/] [uart_defines.v] - Blame information for rev 29

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 mohor
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  uart_defines.v                                              ////
4
////                                                              ////
5
////                                                              ////
6
////  This file is part of the "UART 16550 compatible" project    ////
7
////  http://www.opencores.org/cores/uart16550/                   ////
8
////                                                              ////
9
////  Documentation related to this project:                      ////
10
////  - http://www.opencores.org/cores/uart16550/                 ////
11
////                                                              ////
12
////  Projects compatibility:                                     ////
13
////  - WISHBONE                                                  ////
14
////  RS232 Protocol                                              ////
15
////  16550D uart (mostly supported)                              ////
16
////                                                              ////
17
////  Overview (main Features):                                   ////
18
////  Defines of the Core                                         ////
19
////                                                              ////
20
////  Known problems (limits):                                    ////
21
////  None                                                        ////
22
////                                                              ////
23
////  To Do:                                                      ////
24
////  Nothing.                                                    ////
25
////                                                              ////
26
////  Author(s):                                                  ////
27
////      - gorban@opencores.org                                  ////
28
////      - Jacob Gorban                                          ////
29 29 mohor
////      - Igor Mohor (igorm@opencores.org)                      ////
30 27 mohor
////                                                              ////
31
////  Created:        2001/05/12                                  ////
32
////  Last Updated:   2001/05/17                                  ////
33
////                  (See log for the revision history)          ////
34
////                                                              ////
35
////                                                              ////
36
//////////////////////////////////////////////////////////////////////
37
////                                                              ////
38 29 mohor
//// Copyright (C) 2000, 2001 Authors                             ////
39 27 mohor
////                                                              ////
40
//// This source file may be used and distributed without         ////
41
//// restriction provided that this copyright statement is not    ////
42
//// removed from the file and that any derivative work contains  ////
43
//// the original copyright notice and the associated disclaimer. ////
44
////                                                              ////
45
//// This source file is free software; you can redistribute it   ////
46
//// and/or modify it under the terms of the GNU Lesser General   ////
47
//// Public License as published by the Free Software Foundation; ////
48
//// either version 2.1 of the License, or (at your option) any   ////
49
//// later version.                                               ////
50
////                                                              ////
51
//// This source is distributed in the hope that it will be       ////
52
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
53
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
54
//// PURPOSE.  See the GNU Lesser General Public License for more ////
55
//// details.                                                     ////
56
////                                                              ////
57
//// You should have received a copy of the GNU Lesser General    ////
58
//// Public License along with this source; if not, download it   ////
59
//// from http://www.opencores.org/lgpl.shtml                     ////
60
////                                                              ////
61
//////////////////////////////////////////////////////////////////////
62
//
63
// CVS Revision History
64
//
65
// $Log: not supported by cvs2svn $
66 29 mohor
// Revision 1.6  2001/08/23 16:05:05  mohor
67
// Stop bit bug fixed.
68
// Parity bug fixed.
69
// WISHBONE read cycle bug fixed,
70
// OE indicator (Overrun Error) bug fixed.
71
// PE indicator (Parity Error) bug fixed.
72
// Register read bug fixed.
73
//
74 27 mohor
// Revision 1.5  2001/05/31 20:08:01  gorban
75
// FIFO changes and other corrections.
76
//
77
// Revision 1.4  2001/05/21 19:12:02  gorban
78
// Corrected some Linter messages.
79
//
80
// Revision 1.3  2001/05/17 18:34:18  gorban
81
// First 'stable' release. Should be sythesizable now. Also added new header.
82
//
83
// Revision 1.0  2001-05-17 21:27:11+02  jacob
84
// Initial revision
85
//
86
//
87
 
88
`define UART_ADDR_WIDTH 3
89
 
90
// Register addresses
91
`define UART_REG_RB     3'd0    // receiver buffer
92
`define UART_REG_TR  3'd0       // transmitter
93
`define UART_REG_IE     3'd1    // Interrupt enable
94
`define UART_REG_II  3'd2       // Interrupt identification
95
`define UART_REG_FC  3'd2       // FIFO control
96
`define UART_REG_LC     3'd3    // Line Control
97
`define UART_REG_MC     3'd4    // Modem control
98
`define UART_REG_LS  3'd5       // Line status
99
`define UART_REG_MS  3'd6       // Modem status
100
`define UART_REG_DL1    3'd0    // Divisor latch bytes (1-4)
101
`define UART_REG_DL2    3'd1
102
`define UART_REG_DL3    3'd4
103
`define UART_REG_DL4    3'd5
104
 
105
// Interrupt Enable register bits
106
`define UART_IE_RDA     0        // Received Data available interrupt
107
`define UART_IE_THRE    1       // Transmitter Holding Register empty interrupt
108
`define UART_IE_RLS     2       // Receiver Line Status Interrupt
109
`define UART_IE_MS      3       // Modem Status Interrupt
110
 
111
// Interrupt Identification register bits
112
`define UART_II_IP      0        // Interrupt pending when 0
113
`define UART_II_II      3:1     // Interrupt identification
114
 
115
// Interrupt identification values for bits 3:1
116
`define UART_II_RLS     3'b011  // Receiver Line Status
117
`define UART_II_RDA     3'b010  // Receiver Data available
118
`define UART_II_TI      3'b110  // Timeout Indication
119
`define UART_II_THRE    3'b001  // Transmitter Holding Register empty
120
`define UART_II_MS      3'b000  // Modem Status
121
 
122
// FIFO Control Register bits
123
`define UART_FC_TL      1:0      // Trigger level
124
 
125
// FIFO trigger level values
126
`define UART_FC_1       2'b00
127
`define UART_FC_4       2'b01
128
`define UART_FC_8       2'b10
129
`define UART_FC_14      2'b11
130
 
131
// Line Control register bits
132
`define UART_LC_BITS    1:0      // bits in character
133
`define UART_LC_SB      2       // stop bits
134
`define UART_LC_PE      3       // parity enable
135
`define UART_LC_EP      4       // even parity
136
`define UART_LC_SP      5       // stick parity
137
`define UART_LC_BC      6       // Break control
138
`define UART_LC_DL      7       // Divisor Latch access bit
139
 
140
// Modem Control register bits
141
`define UART_MC_DTR     0
142
`define UART_MC_RTS     1
143
`define UART_MC_OUT1    2
144
`define UART_MC_OUT2    3
145
`define UART_MC_LB      4       // Loopback mode
146
 
147
// Line Status Register bits
148
`define UART_LS_DR      0        // Data ready
149
`define UART_LS_OE      1       // Overrun Error
150
`define UART_LS_PE      2       // Parity Error
151
`define UART_LS_FE      3       // Framing Error
152
`define UART_LS_BI      4       // Break interrupt
153
`define UART_LS_TFE     5       // Transmit FIFO is empty
154
`define UART_LS_TE      6       // Transmitter Empty indicator
155
`define UART_LS_EI      7       // Error indicator
156
 
157
// Modem Status Register bits
158
`define UART_MS_DCTS    0        // Delta signals
159
`define UART_MS_DDSR    1
160
`define UART_MS_TERI    2
161
`define UART_MS_DDCD    3
162
`define UART_MS_CCTS    4       // Complement signals
163
`define UART_MS_CDSR    5
164
`define UART_MS_CRI     6
165
`define UART_MS_CDCD    7
166
 
167
 
168
// FIFO parameter defines
169
 
170
`define UART_FIFO_WIDTH 8
171
`define UART_FIFO_DEPTH 16
172
`define UART_FIFO_POINTER_W     4
173
`define UART_FIFO_COUNTER_W     5
174
// receiver fifo has width 10 because it has parity and framing error bits
175
`define UART_FIFO_REC_WIDTH  10
176
 
177
 
178
 
179
 
180
 
181
 
182
 
183
`define VERBOSE_WB  0           // All activity on the WISHBONE is recorded
184
`define VERBOSE_LINE_STATUS 0   // Details about the lsr (line status register)
185
`define FAST_TEST   1           // 64/1024 packets are sent
186
 

powered by: WebSVN 2.1.0

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