-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuart_system.sv
More file actions
24 lines (19 loc) · 774 Bytes
/
uart_system.sv
File metadata and controls
24 lines (19 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
module uart_system
#(
parameter DATA_WIDTH = 8,
parameter BAUD_RATE = 19200
)(
input logic clk, rstN,txByteStart,rx,
input logic [DATA_WIDTH-1:0]byteForTx,
output logic tx,tx_ready,rx_ready,rx_new_byte_indicate,
output logic [DATA_WIDTH-1:0]byteFromRx
);
logic baudTick;
uart_baudRateGen #(.BAUD_RATE(BAUD_RATE)) baudRateGen(.clk, .rstN, .baudTick);
uart_transmitter #(.DATA_WIDTH(DATA_WIDTH)) transmitter(
.dataIn(byteForTx), .clk, .baudTick, .rstN, .txStart(txByteStart), .tx, .tx_ready
);
uart_receiver #(.DATA_WIDTH(DATA_WIDTH)) receiver (
.rx, .clk, .rstN, .baudTick, .rx_ready, .dataOut(byteFromRx), .new_byte_indicate(rx_new_byte_indicate)
);
endmodule:uart_system