another uart demonstration: uart echo module
This commit is contained in:
37
uart/rtl/uart_echo.v
Normal file
37
uart/rtl/uart_echo.v
Normal file
@@ -0,0 +1,37 @@
|
||||
`default_nettype none
|
||||
module uart_echo #(parameter CLOCKS_PER_BAUD=16'd104)(
|
||||
input wire clk,
|
||||
input wire rst_n,
|
||||
input wire rx_i,
|
||||
output wire tx_o
|
||||
);
|
||||
|
||||
wire tx_en;
|
||||
wire [7:0] tx_data;
|
||||
|
||||
uart_rx #(/*autoinstparam*/
|
||||
// Parameters
|
||||
.CLOCKS_PER_BAUD (CLOCKS_PER_BAUD)) rx (/*autoinst*/
|
||||
// Outputs
|
||||
.data_o (tx_data),
|
||||
.rx_done_o (tx_en),
|
||||
// Inputs
|
||||
.clk (clk),
|
||||
.rst_n (rst_n),
|
||||
.rx_i (rx_i));
|
||||
uart_tx #(/*autoinstparam*/
|
||||
// Parameters
|
||||
.CLOCKS_PER_BAUD (CLOCKS_PER_BAUD)) tx (/*autoinst*/
|
||||
// Outputs
|
||||
.tx_o (tx_o),
|
||||
.tx_done_o (),
|
||||
// Inputs
|
||||
.clk (clk),
|
||||
.rst_n (rst_n),
|
||||
.en_i (tx_en),
|
||||
.data_i (tx_data));
|
||||
|
||||
endmodule
|
||||
// Local Variables:
|
||||
// verilog-library-directories:(".." "../rtl" ".")
|
||||
// End:
|
||||
Reference in New Issue
Block a user