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

Subversion Repositories uart16550

[/] [uart16550/] [trunk/] [rtl/] [verilog/] [uart_wb.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_TX_FIFO.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 29 mohor
////      - Igor Mohor (igorm@opencores.org)                      ////
31 27 mohor
////                                                              ////
32
////  Created:        2001/05/12                                  ////
33
////  Last Updated:   2001/05/17                                  ////
34
////                  (See log for the revision history)          ////
35
////                                                              ////
36
////                                                              ////
37
//////////////////////////////////////////////////////////////////////
38
////                                                              ////
39 29 mohor
//// Copyright (C) 2000, 2001 Authors                             ////
40 27 mohor
////                                                              ////
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 29 mohor
// Revision 1.7  2001/08/23 16:05:05  mohor
68
// Stop bit bug fixed.
69
// Parity bug fixed.
70
// WISHBONE read cycle bug fixed,
71
// OE indicator (Overrun Error) bug fixed.
72
// PE indicator (Parity Error) bug fixed.
73
// Register read bug fixed.
74
//
75 27 mohor
// Revision 1.4  2001/05/31 20:08:01  gorban
76
// FIFO changes and other corrections.
77
//
78
// Revision 1.3  2001/05/21 19:12:01  gorban
79
// Corrected some Linter messages.
80
//
81
// Revision 1.2  2001/05/17 18:34:18  gorban
82
// First 'stable' release. Should be sythesizable now. Also added new header.
83
//
84
// Revision 1.0  2001-05-17 21:27:13+02  jacob
85
// Initial revision
86
//
87
//
88
 
89
// UART core WISHBONE interface 
90
//
91
// Author: Jacob Gorban   (jacob.gorban@flextronicssemi.com)
92
// Company: Flextronics Semiconductor
93
//
94
 
95
`include "timescale.v"
96
 
97
module uart_wb (clk,
98
        wb_rst_i,
99
        wb_we_i, wb_stb_i, wb_cyc_i, wb_ack_o,
100
        we_o, re_o // Write and read enable output for the core
101
 
102
        );
103
 
104
input                           clk;
105
 
106
// WISHBONE interface   
107
input                           wb_rst_i;
108
input                           wb_we_i;
109
input                           wb_stb_i;
110
input                           wb_cyc_i;
111
output                          wb_ack_o;
112
output                          we_o;
113
output                          re_o;
114
 
115
wire                            we_o;
116
reg                             wb_ack_o;
117
 
118
always @(posedge clk or posedge wb_rst_i)
119
begin
120
        if (wb_rst_i)
121
        begin
122
                wb_ack_o <= #1 1'b0;
123
        end
124
        else
125
        begin
126
//              wb_ack_o <= #1 wb_stb_i & wb_cyc_i; // 1 clock wait state on all transfers
127
                wb_ack_o <= #1 wb_stb_i & wb_cyc_i & ~wb_ack_o; // 1 clock wait state on all transfers
128
        end
129
end
130
 
131
assign we_o =  wb_we_i & wb_cyc_i & wb_stb_i; //WE for registers        
132
assign re_o = ~wb_we_i & wb_cyc_i & wb_stb_i; //RE for registers        
133
 
134
endmodule

powered by: WebSVN 2.1.0

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