1 |
3 |
toni32 |
////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
// Copyright (c) 2004 Xilinx, Inc.
|
3 |
|
|
// All Rights Reserved
|
4 |
|
|
////////////////////////////////////////////////////////////////////////////////
|
5 |
|
|
// ____ ____
|
6 |
|
|
// / /\/ /
|
7 |
|
|
// /___/ \ / Vendor: Xilinx
|
8 |
|
|
// \ \ \/ Version: 1.01
|
9 |
|
|
// \ \ Filename: uart_tx.v
|
10 |
|
|
// / / Date Last Modified: 08/04/2004
|
11 |
|
|
// /___/ /\ Date Created: 10/14/2002
|
12 |
|
|
// \ \ / \
|
13 |
|
|
// \___\/\___\
|
14 |
|
|
//
|
15 |
|
|
//Device: Xilinx
|
16 |
|
|
//Purpose:
|
17 |
|
|
// UART Transmitter with integral 16 byte FIFO buffer
|
18 |
|
|
// 8 bit, no parity, 1 stop bit
|
19 |
|
|
//Reference:
|
20 |
|
|
// None
|
21 |
|
|
//Revision History:
|
22 |
|
|
// Rev 1.00 - kc - Start of design entry in VHDL, 10/14/2002.
|
23 |
|
|
// Rev 1.01 - sus - Converted to verilog, 08/04/2004.
|
24 |
|
|
////////////////////////////////////////////////////////////////////////////////
|
25 |
|
|
// Contact: e-mail picoblaze@xilinx.com
|
26 |
|
|
//////////////////////////////////////////////////////////////////////////////////
|
27 |
|
|
//
|
28 |
|
|
// Disclaimer:
|
29 |
|
|
// LIMITED WARRANTY AND DISCLAIMER. These designs are
|
30 |
|
|
// provided to you "as is". Xilinx and its licensors make and you
|
31 |
|
|
// receive no warranties or conditions, express, implied,
|
32 |
|
|
// statutory or otherwise, and Xilinx specifically disclaims any
|
33 |
|
|
// implied warranties of merchantability, non-infringement, or
|
34 |
|
|
// fitness for a particular purpose. Xilinx does not warrant that
|
35 |
|
|
// the functions contained in these designs will meet your
|
36 |
|
|
// requirements, or that the operation of these designs will be
|
37 |
|
|
// uninterrupted or error free, or that defects in the Designs
|
38 |
|
|
// will be corrected. Furthermore, Xilinx does not warrant or
|
39 |
|
|
// make any representations regarding use or the results of the
|
40 |
|
|
// use of the designs in terms of correctness, accuracy,
|
41 |
|
|
// reliability, or otherwise.
|
42 |
|
|
//
|
43 |
|
|
// LIMITATION OF LIABILITY. In no event will Xilinx or its
|
44 |
|
|
// licensors be liable for any loss of data, lost profits, cost
|
45 |
|
|
// or procurement of substitute goods or services, or for any
|
46 |
|
|
// special, incidental, consequential, or indirect damages
|
47 |
|
|
// arising from the use or operation of the designs or
|
48 |
|
|
// accompanying documentation, however caused and on any theory
|
49 |
|
|
// of liability. This limitation will apply even if Xilinx
|
50 |
|
|
// has been advised of the possibility of such damage. This
|
51 |
|
|
// limitation shall apply not-withstanding the failure of the
|
52 |
|
|
// essential purpose of any limited remedies herein.
|
53 |
|
|
//////////////////////////////////////////////////////////////////////////////////
|
54 |
|
|
|
55 |
|
|
`timescale 1 ps / 1ps
|
56 |
|
|
|
57 |
|
|
module uart_tx
|
58 |
|
|
( data_in,
|
59 |
|
|
write_buffer,
|
60 |
|
|
reset_buffer,
|
61 |
|
|
en_16_x_baud,
|
62 |
|
|
serial_out,
|
63 |
|
|
buffer_full,
|
64 |
|
|
buffer_half_full,
|
65 |
|
|
clk);
|
66 |
|
|
|
67 |
|
|
input[7:0] data_in;
|
68 |
|
|
input write_buffer;
|
69 |
|
|
input reset_buffer;
|
70 |
|
|
input en_16_x_baud;
|
71 |
|
|
output serial_out;
|
72 |
|
|
output buffer_full;
|
73 |
|
|
output buffer_half_full;
|
74 |
|
|
input clk;
|
75 |
|
|
|
76 |
|
|
wire [7:0] data_in;
|
77 |
|
|
wire write_buffer;
|
78 |
|
|
wire reset_buffer;
|
79 |
|
|
wire en_16_x_baud;
|
80 |
|
|
wire serial_out;
|
81 |
|
|
wire buffer_full;
|
82 |
|
|
wire buffer_half_full;
|
83 |
|
|
wire clk;
|
84 |
|
|
|
85 |
|
|
//----------------------------------------------------------------------------------
|
86 |
|
|
//
|
87 |
|
|
// Start of UART_TX
|
88 |
|
|
//
|
89 |
|
|
//
|
90 |
|
|
//----------------------------------------------------------------------------------
|
91 |
|
|
//
|
92 |
|
|
// Signals used in UART_TX
|
93 |
|
|
//
|
94 |
|
|
//----------------------------------------------------------------------------------
|
95 |
|
|
//
|
96 |
|
|
wire [7:0] fifo_data_out;
|
97 |
|
|
wire fifo_data_present;
|
98 |
|
|
wire fifo_read;
|
99 |
|
|
//
|
100 |
|
|
//----------------------------------------------------------------------------------
|
101 |
|
|
//
|
102 |
|
|
// Start of UART_TX circuit description
|
103 |
|
|
//
|
104 |
|
|
//----------------------------------------------------------------------------------
|
105 |
|
|
//
|
106 |
|
|
|
107 |
|
|
// 8 to 1 multiplexer to convert parallel data to serial
|
108 |
|
|
kcuart_tx kcuart
|
109 |
|
|
( .data_in(fifo_data_out),
|
110 |
|
|
.send_character(fifo_data_present),
|
111 |
|
|
.en_16_x_baud(en_16_x_baud),
|
112 |
|
|
.serial_out(serial_out),
|
113 |
|
|
.Tx_complete(fifo_read),
|
114 |
|
|
.clk(clk));
|
115 |
|
|
|
116 |
|
|
bbfifo_16x8 buf_0
|
117 |
|
|
( .data_in(data_in),
|
118 |
|
|
.data_out(fifo_data_out),
|
119 |
|
|
.reset(reset_buffer),
|
120 |
|
|
.write(write_buffer),
|
121 |
|
|
.read(fifo_read),
|
122 |
|
|
.full(buffer_full),
|
123 |
|
|
.half_full(buffer_half_full),
|
124 |
|
|
.data_present(fifo_data_present),
|
125 |
|
|
.clk(clk));
|
126 |
|
|
|
127 |
|
|
endmodule
|
128 |
|
|
|
129 |
|
|
//----------------------------------------------------------------------------------
|
130 |
|
|
//
|
131 |
|
|
// END OF FILE UART_TX.V
|
132 |
|
|
//
|
133 |
|
|
//----------------------------------------------------------------------------------
|
134 |
|
|
|
135 |
|
|
|