| `timescale 1ns / 1ps |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
|
|
| module uart |
| #( |
| parameter CLKRATE = 100000000, |
| parameter BAUD = 115200, |
| parameter WORD_LENGTH = 8 |
| ) |
| ( |
| input clk, |
| input rst, |
| input [WORD_LENGTH-1:0] tx_data, |
| input tx_data_valid, |
| input tx_data_last, |
| output tx_data_ready, |
| output UART_TX |
| ); |
| |
| logic tx_data_fifo_m_axis_tlast; |
| logic tx_data_fifo_m_axis_tready; |
| logic tx_data_fifo_m_axis_tvalid; |
| logic [WORD_LENGTH-1:0] tx_data_fifo_m_axis_tdata; |
| |
| tx_fifo |
| tx_data_fifo_i( |
| |
| .wr_rst_busy(), |
| .rd_rst_busy(), |
| .s_aclk(clk), |
| .s_aresetn(~rst), |
| |
| .s_axis_tvalid(tx_data_valid), |
| .s_axis_tready(tx_data_ready), |
| .s_axis_tdata(tx_data), |
| .s_axis_tlast(tx_data_last), |
| |
| .m_axis_tvalid(tx_data_fifo_m_axis_tvalid), |
| .m_axis_tready(tx_data_fifo_m_axis_tready), |
| .m_axis_tdata(tx_data_fifo_m_axis_tdata), |
| .m_axis_tlast(tx_data_fifo_m_axis_tlast) |
| ); |
| |
| uart_tx |
| #( |
| .CLKRATE(CLKRATE), |
| .BAUD(BAUD), |
| .WORD_LENGTH(WORD_LENGTH) |
| ) |
| uart_tx_i |
| ( |
| .clk(clk), |
| .rst(rst), |
| .tx_data(tx_data_fifo_m_axis_tdata), |
| .tx_data_valid(tx_data_fifo_m_axis_tvalid), |
| .tx_data_ready(tx_data_fifo_m_axis_tready), |
| .UART_TX(UART_TX) |
| ); |
| |
| endmodule |
|
|