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

Subversion Repositories socgen

[/] [socgen/] [trunk/] [Projects/] [opencores.org/] [wishbone/] [ip/] [wb_uart16550/] [rtl/] [verilog/] [wb_fsm] - Blame information for rev 131

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 131 jt_eaton
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  uart_wb.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
////  UART core WISHBONE interface.                               ////
19
////                                                              ////
20
////  Known problems (limits):                                    ////
21
////  Inserts one wait state on all transfers.                    ////
22
////  Note affected signals and the way they are affected.        ////
23
////                                                              ////
24
////  To Do:                                                      ////
25
////  Nothing.                                                    ////
26
////                                                              ////
27
////  Author(s):                                                  ////
28
////      - gorban@opencores.org                                  ////
29
////      - Jacob Gorban                                          ////
30
////      - Igor Mohor (igorm@opencores.org)                      ////
31
////                                                              ////
32
////  Created:        2001/05/12                                  ////
33
////  Last Updated:   2001/05/17                                  ////
34
////                  (See log for the revision history)          ////
35
////                                                              ////
36
////                                                              ////
37
//////////////////////////////////////////////////////////////////////
38
////                                                              ////
39
//// Copyright (C) 2000, 2001 Authors                             ////
40
////                                                              ////
41
//// This source file may be used and distributed without         ////
42
//// restriction provided that this copyright statement is not    ////
43
//// removed from the file and that any derivative work contains  ////
44
//// the original copyright notice and the associated disclaimer. ////
45
////                                                              ////
46
//// This source file is free software; you can redistribute it   ////
47
//// and/or modify it under the terms of the GNU Lesser General   ////
48
//// Public License as published by the Free Software Foundation; ////
49
//// either version 2.1 of the License, or (at your option) any   ////
50
//// later version.                                               ////
51
////                                                              ////
52
//// This source is distributed in the hope that it will be       ////
53
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
54
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
55
//// PURPOSE.  See the GNU Lesser General Public License for more ////
56
//// details.                                                     ////
57
////                                                              ////
58
//// You should have received a copy of the GNU Lesser General    ////
59
//// Public License along with this source; if not, download it   ////
60
//// from http://www.opencores.org/lgpl.shtml                     ////
61
////                                                              ////
62
//////////////////////////////////////////////////////////////////////
63
//
64
// CVS Revision History
65
//
66
// $Log: not supported by cvs2svn $
67
// Revision 1.16  2002/07/29 21:16:18  gorban
68
// The uart_defines.v file is included again in sources.
69
//
70
// Revision 1.15  2002/07/22 23:02:23  gorban
71
// Bug Fixes:
72
//  * Possible loss of sync and bad reception of stop bit on slow baud rates fixed.
73
//   Problem reported by Kenny.Tung.
74
//  * Bad (or lack of ) loopback handling fixed. Reported by Cherry Withers.
75
//
76
// Improvements:
77
//  * Made FIFO's as general inferrable memory where possible.
78
//  So on FPGA they should be inferred as RAM (Distributed RAM on Xilinx).
79
//  This saves about 1/3 of the Slice count and reduces P&R and synthesis times.
80
//
81
//
82
// Revision 1.12  2001/12/19 08:03:34  mohor
83
// Warnings cleared.
84
//
85
// Revision 1.11  2001/12/06 14:51:04  gorban
86
// Bug in LSR[0] is fixed.
87
// All WISHBONE signals are now sampled, so another wait-state is introduced on all transfers.
88
//
89
// Revision 1.10  2001/12/03 21:44:29  gorban
90
// Updated specification documentation.
91
// Added full 32-bit data bus interface, now as default.
92
// Address is 5-bit wide in 32-bit data bus mode.
93
// Added wb_sel_i input to the core. It's used in the 32-bit mode.
94
// Added debug interface with two 32-bit read-only registers in 32-bit mode.
95
// Bits 5 and 6 of LSR are now only cleared on TX FIFO write.
96
// My small test bench is modified to work with 32-bit mode.
97
//
98
// Revision 1.9  2001/10/20 09:58:40  gorban
99
// Small synopsis fixes
100
//
101
// Revision 1.8  2001/08/24 21:01:12  mohor
102
// Things connected to parity changed.
103
// Clock devider changed.
104
//
105
// Revision 1.7  2001/08/23 16:05:05  mohor
106
// Stop bit bug fixed.
107
// Parity bug fixed.
108
// WISHBONE read cycle bug fixed,
109
// OE indicator (Overrun Error) bug fixed.
110
// PE indicator (Parity Error) bug fixed.
111
// Register read bug fixed.
112
//
113
// Revision 1.4  2001/05/31 20:08:01  gorban
114
// FIFO changes and other corrections.
115
//
116
// Revision 1.3  2001/05/21 19:12:01  gorban
117
// Corrected some Linter messages.
118
//
119
// Revision 1.2  2001/05/17 18:34:18  gorban
120
// First 'stable' release. Should be sythesizable now. Also added new header.
121
//
122
// Revision 1.0  2001-05-17 21:27:13+02  jacob
123
// Initial revision
124
//
125
//
126
 
127
// UART core WISHBONE interface
128
//
129
// Author: Jacob Gorban   (jacob.gorban@flextronicssemi.com)
130
// Company: Flextronics Semiconductor
131
//
132
 
133
 
134
 
135
module `VARIANT`WB_FSM
136
(
137
 
138
input  wire    clk,
139
input  wire    wb_rst_i,
140
input  wire    wb_we_i,
141
input  wire    wb_stb_i,
142
input  wire    wb_cyc_i,
143
 
144
output  reg    wb_ack_o,
145
output wire    we_o,
146
output wire    re_o
147
 
148
);
149
 
150
 
151
 
152
 
153
 
154
 
155
reg            wb_we_is;
156
reg            wb_cyc_is;
157
reg            wb_stb_is;
158
reg            wre;
159
reg [1:0]      wbstate;
160
 
161
 
162
// Sample input signals
163
 
164
always  @(posedge clk )
165
    if (wb_rst_i)
166
       begin
167
        wb_we_is  <=  0;
168
        wb_cyc_is <=  0;
169
        wb_stb_is <=  0;
170
       end
171
    else
172
       begin
173
        wb_we_is  <=  wb_we_i;
174
        wb_cyc_is <=  wb_cyc_i;
175
        wb_stb_is <=  wb_stb_i;
176
       end
177
 
178
 
179
 
180
 
181
 
182
 
183
always  @(posedge clk )
184
    if (wb_rst_i)
185
       begin
186
        wb_ack_o <=  1'b0;
187
        wbstate <=  0;
188
        wre <=  1'b1;
189
       end
190
    else
191
        case (wbstate)
192
            0: begin
193
                if (wb_stb_is && wb_cyc_is)
194
                  begin
195
                    wre      <=  0;
196
                    wbstate  <=  1;
197
                    wb_ack_o <=  1;
198
                  end
199
                 else
200
                  begin
201
                    wre      <=  1;
202
                    wb_ack_o <=  0;
203
                  end
204
               end
205
            1: begin
206
               wb_ack_o      <=  0;
207
               wbstate       <=  2;
208
               wre           <=  0;
209
               end
210
            2,3: begin
211
                 wb_ack_o    <=  0;
212
                 wbstate     <=  0;
213
                 wre         <=  0;
214
                 end
215
        endcase
216
 
217
assign we_o =  wb_we_is && wb_stb_is *& wb_cyc_is && wre ; //WE for registers
218
assign re_o = ~wb_we_is && wb_stb_is && wb_cyc_is && wre ; //RE for registers
219
 
220
 
221
 
222
 
223
 
224
 
225
 
226
endmodule
227
 
228
 
229
 
230
 
231
 
232
 
233
 
234
 
235
 
236
 

powered by: WebSVN 2.1.0

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