diff options
| author | Jan Tuomi <jan@jantuomi.fi> | 2025-03-19 22:35:13 +0200 |
|---|---|---|
| committer | Jan Tuomi <jan@jantuomi.fi> | 2025-03-19 22:35:13 +0200 |
| commit | 24e1d2d7e51c6019dea9496883e9f509260b08e7 (patch) | |
| tree | bd719b5db06a44798b050dc7734d30ec35100bc9 /atk16_fpga/top.v | |
| parent | 1e3961030578c69180992f46096ef24ea2f4c3a5 (diff) | |
Remove repl functionality to make the serial pgm as simple as possible
Diffstat (limited to 'atk16_fpga/top.v')
| -rw-r--r-- | atk16_fpga/top.v | 59 |
1 files changed, 4 insertions, 55 deletions
diff --git a/atk16_fpga/top.v b/atk16_fpga/top.v index 6fcbddd..07486cb 100644 --- a/atk16_fpga/top.v +++ b/atk16_fpga/top.v @@ -15,11 +15,8 @@ module top ( localparam START_TX = 2; localparam TX_IN_PROG = 3; localparam WAIT_TX_DONE = 4; - localparam HANDLE_RX_DATA = 5; - localparam SEND_STRING_WELCOME = 6; - localparam SEND_STRING_HELP = 7; - localparam SEND_STRING_PROGRAM_READY = 8; - localparam RECEIVE_PROGRAM_DATA = 9; + localparam SEND_STRING_WELCOME = 5; + localparam RECEIVE_PROGRAM_DATA = 6; reg [7:0] state = SEND_STRING_WELCOME; @@ -27,14 +24,6 @@ module top ( `STR_welcome reg [7:0] welcome_index = 0; - // SEND_STRING_HELP data - `STR_help - reg [7:0] help_index = 0; - - // SEND_STRING_PROGRAM_READY data - `STR_program_ready - reg [7:0] program_ready_index = 0; - // Synchronous state machine with reset. always @(posedge SYSCLK) begin case (state) @@ -72,17 +61,6 @@ module top ( end end - // STATES FOR PROCESSING DATA - HANDLE_RX_DATA: begin - if (data_rx == cmd_program) begin - state <= SEND_STRING_PROGRAM_READY; - end else if (data_rx == cmd_help) begin - state <= SEND_STRING_HELP; - end else begin - state <= RX_START; - end - end - SEND_STRING_WELCOME: begin if (welcome_index < 8'd`LEN_welcome) begin data_tx <= str_welcome[welcome_index]; @@ -91,32 +69,6 @@ module top ( state_after_tx <= SEND_STRING_WELCOME; end else begin welcome_index <= 0; - state <= RX_START; - state_after_tx <= RX_START; - end - end - - SEND_STRING_HELP: begin - if (help_index < 8'd`LEN_help) begin - data_tx <= str_help[help_index]; - help_index <= help_index + 1; - state <= START_TX; - state_after_tx <= SEND_STRING_HELP; - end else begin - help_index <= 0; - state <= RX_START; - state_after_tx <= RX_START; - end - end - - SEND_STRING_PROGRAM_READY: begin - if (program_ready_index < 8'd`LEN_program_ready) begin - data_tx <= str_program_ready[program_ready_index]; - program_ready_index <= program_ready_index + 1; - state <= START_TX; - state_after_tx <= SEND_STRING_PROGRAM_READY; - end else begin - program_ready_index <= 0; state <= RECEIVE_PROGRAM_DATA; state_after_tx <= RX_START; end @@ -142,9 +94,6 @@ module top ( // State to transition to after TX done. reg [7:0] state_after_tx = RX_START; - reg [7:0] cmd_help = 8'd104; // h - reg [7:0] cmd_program = 8'd112; // p - // Instantiate the UART transmitter. uart_tx uart_inst ( .clk (SYSCLK), @@ -156,7 +105,7 @@ module top ( wire [7:0] data_rx; wire rx_done; - reg [7:0] state_after_rx = HANDLE_RX_DATA; + reg [7:0] state_after_rx = RECEIVE_PROGRAM_DATA; uart_rx uart_rx_inst ( .clk (SYSCLK), @@ -165,7 +114,7 @@ module top ( .done(rx_done) ); - assign LED1 = data_rx == cmd_program; + assign LED1 = 1; assign LED2 = LED1; endmodule |
