You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.2 KiB
Coq

6 months ago
module uart_top(
input wire sys_clk ,
input wire sys_rst_n ,
input wire rx ,
input wire [3: 0] key_in ,
output wire tx
);
wire [7: 0] data_byte ;
wire [7: 0] data_out ;
wire [3: 0] key_out ;
wire tx_vld ;
wire rx_vld ;
reg rcv_start ;
// uart_rx uart_rx_inst(
// .sys_clk (sys_clk) ,
// .sys_rst_n (sys_rst_n) ,
// .rx_din (rx) ,//
// .rcv_start (rcv_start) ,
// .rx_dout (data_byte) ,//
// .rx_vld (rx_vld) //
// );
key_filter key_filter_inst(//20ms
.sys_clk (sys_clk),
.sys_rst_n (sys_rst_n),
.key_in (key_in),
.key_out (key_out)
);
assign rx_vld = |key_out;//0001 0010 0100 1000
assign data_out = {4'b0000, key_out};//,0x01=0000_0010
uart_tx uart_tx_inst(
.sys_clk (sys_clk) ,
.sys_rst_n (sys_rst_n) ,
.tx_din (data_out) ,//
.rx_vld (rx_vld) ,//
.tx_vld (tx_vld) ,
.tx_dout (tx)//
);
endmodule