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

Subversion Repositories oms8051mini

[/] [oms8051mini/] [trunk/] [rtl/] [msg_handler/] [msg_handler_top.v] - Blame information for rev 20

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

Line No. Rev Author Line
1 19 dinesha
 
2
//////////////////////////////////////////////////////////////////////
3
////                                                              ////
4
////  UART Message Handler Top Module                             ////
5
////                                                              ////
6
////  This file is part of the uart2spi  cores project            ////
7
////  http://www.opencores.org/cores/oms8051min/                  ////
8
////                                                              ////
9
////  Description                                                 ////
10
////  top level integration.                                      ////
11
////    1. uart_core_nf                                           ////
12
////    2. uart_msg_handler                                       ////
13
////                                                              ////
14
////  To Do:                                                      ////
15
////    nothing                                                   ////
16
////                                                              ////
17
////  Author(s):                                                  ////
18
////      - Dinesh Annayya, dinesha@opencores.org                 ////
19
////                                                              ////
20
//////////////////////////////////////////////////////////////////////
21
////                                                              ////
22
//// Copyright (C) 2000 Authors and OPENCORES.ORG                 ////
23
////                                                              ////
24
//// This source file may be used and distributed without         ////
25
//// restriction provided that this copyright statement is not    ////
26
//// removed from the file and that any derivative work contains  ////
27
//// the original copyright notice and the associated disclaimer. ////
28
////                                                              ////
29
//// This source file is free software; you can redistribute it   ////
30
//// and/or modify it under the terms of the GNU Lesser General   ////
31
//// Public License as published by the Free Software Foundation; ////
32
//// either version 2.1 of the License, or (at your option) any   ////
33
//// later version.                                               ////
34
////                                                              ////
35
//// This source is distributed in the hope that it will be       ////
36
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
37
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
38
//// PURPOSE.  See the GNU Lesser General Public License for more ////
39
//// details.                                                     ////
40
////                                                              ////
41
//// You should have received a copy of the GNU Lesser General    ////
42
//// Public License along with this source; if not, download it   ////
43
//// from http://www.opencores.org/lgpl.shtml                     ////
44
////                                                              ////
45
//////////////////////////////////////////////////////////////////////
46
 
47
module msg_handler_top (
48
        line_reset_n ,
49
        line_clk ,
50
 
51
      // Towards Register Interface
52
        reg_addr,
53
        reg_wr,
54
        reg_wdata,
55
        reg_req,
56
        reg_ack,
57
        reg_rdata,
58
 
59
 
60
       // Status information
61
        frm_error      ,
62
        par_error      ,
63
 
64
        baud_clk_16x,
65
 
66
       // Line Interface
67
        rxd,
68
        txd
69
 
70
 
71
     );
72
 
73
 
74
 
75
//---------------------------------
76
// Global Dec
77
// ---------------------------------
78
 
79
input        line_reset_n          ; // line reset
80
input        line_clk              ; // line clock
81
 
82
//--------------------------------------
83
// ERROR Indication
84
// -------------------------------------
85
output        frm_error            ; // framing error
86
output        par_error            ; // par error
87
 
88
output        baud_clk_16x         ; // 16x Baud clock
89
 
90
 
91
//-------------------------------------
92
// Message Handler Line Interface
93
// -------------------------------------
94
input         rxd                  ; // uart rxd
95
output        txd                  ; // uart txd
96
 
97
//---------------------------------------
98
// Register Master Interface
99
// --------------------------------------
100
output  [15:0]  reg_addr           ; // Register Address
101
output  [7:0]   reg_wdata          ; // Register Wdata
102
output          reg_req            ; // Register Request
103
output          reg_wr             ; // 1 -> write; 0 -> read
104
input           reg_ack            ; // Register Ack
105
input  [7:0]    reg_rdata          ;
106
//--------------------------------------
107
// UART TXD Path
108
// -------------------------------------
109
wire            tx_data_avail      ; // Indicate valid TXD Data 
110
wire [7:0]      tx_data            ; // TXD Data to be transmited
111
wire            tx_rd              ; // Indicate TXD Data Been Read
112
 
113
 
114
//--------------------------------------
115
// UART RXD Path
116
// -------------------------------------
117
wire         rx_ready              ; // Indicate Ready to accept the Read Data
118
wire [7:0]  rx_data                ; // RXD Data 
119
wire        rx_wr                  ; // Valid RXD Data
120
 
121
//-------------------------------------
122
// Configuration 
123
// -------------------------------------
124
wire          cfg_tx_enable        ; // Tx Enable
125
wire          cfg_rx_enable        ; // Rx Enable
126
wire          cfg_stop_bit         ; // 0 -> 1 Stop, 1 -> 2 Stop
127
wire  [1:0]   cfg_pri_mod          ; // priority mode, 0 -> nop, 1 -> Even, 2 -> Odd
128
wire  [11:0]  cfg_baud_16x         ; // 16x Baud clock generation
129
 
130
 
131
//---------------------------------------------------------------
132
// UART Core without internal FIFO
133
// --------------------------------------------------------------
134
 
135
assign        cfg_tx_enable  = 1'b1; // Enable Transmit Path
136
assign        cfg_rx_enable  = 1'b1; // Enable Received Path
137
assign        cfg_stop_bit   = 1'b1; // 0 -> 1 Start , 1 -> 2 Stop Bits
138
assign        cfg_pri_mod    = 1'b1; // priority mode, 0 -> nop, 1 -> Even, 2 -> Odd
139
assign        cfg_baud_16x   = 'h1;
140
 
141
 
142
 
143
uart_core_nf u_core (
144
          .line_reset_n       (line_reset_n   ),
145
          .line_clk           (line_clk       ),
146
 
147
        // configuration control
148
          .cfg_tx_enable      (cfg_tx_enable  ),
149
          .cfg_rx_enable      (cfg_rx_enable  ),
150
          .cfg_stop_bit       (cfg_stop_bit   ),
151
          .cfg_pri_mod        (cfg_pri_mod    ),
152
          .cfg_baud_16x       (cfg_baud_16x   ),
153
 
154
    // TXD Information
155
          .tx_data_avail      (tx_data_avail  ),
156
          .tx_rd              (tx_rd          ),
157
          .tx_data            (tx_data        ),
158
 
159
 
160
    // RXD Information
161
          .rx_ready           (rx_ready       ),
162
          .rx_wr              (rx_wr          ),
163
          .rx_data            (rx_data        ),
164
 
165
       // Status information
166
          .frm_error          (frm_error      ),
167
          .par_error          (par_error      ),
168
 
169
          .baud_clk_16x       (baud_clk_16x   ),
170
 
171
       // Line Interface
172
          .rxd                (rxd            ),
173
          .txd                (txd            )
174
 
175
     );
176
 
177
 
178
 
179
msg_handler u_msg (
180
          .reset_n            (line_reset_n   ),
181
          .sys_clk            (baud_clk_16x   ),
182
 
183
 
184
    // UART-TX Information
185
          .tx_data_avail      (tx_data_avail  ),
186
          .tx_rd              (tx_rd          ),
187
          .tx_data            (tx_data        ),
188
 
189
 
190
    // UART-RX Information
191
          .rx_ready           (rx_ready       ),
192
          .rx_wr              (rx_wr          ),
193
          .rx_data            (rx_data        ),
194
 
195
      // Towards Control Unit
196
          .reg_addr           (reg_addr       ),
197
          .reg_wr             (reg_wr         ),
198
          .reg_wdata          (reg_wdata      ),
199
          .reg_req            (reg_req        ),
200
          .reg_ack            (reg_ack        ),
201
          .reg_rdata          (reg_rdata      )
202
 
203
     );
204
 
205
endmodule

powered by: WebSVN 2.1.0

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