| // baud rate 115200bps, stop bit 1bit, data 8bit, no parity, no flow control |
| input wire [7:0] tx_data, |
| input wire [7:0] access_addr, |
| output wire[7:0] rx_data, |
| output wire receive_flag, |
| output reg int_req = 1'b0 |
| always @(negedge clk) begin |
| if(state == 1'b0) begin //データ待機中 |
| if(receive_flag == 1'b1) begin |
| end else if(state == 1'b1) begin //データが来たことをCPUに伝える |
| if(access_addr == 8'd252 && reg_w_en == 1'b1) begin |
| tx tx1(clk, tx_en, begin_flag, tx_data, tx, busy_flag); |
| rx rx1(clk, rx_en, rx, rx_data, receive_flag); |