From 5f396d028c6da87223d60079cbad4d1e3fc2d14f Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Sun, 20 Feb 2022 15:26:43 -0800 Subject: Correctly reset command parser state after sending commands or invalid input. --- hdl/command_parser.sv | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'hdl') diff --git a/hdl/command_parser.sv b/hdl/command_parser.sv index 92abced..d15d72d 100644 --- a/hdl/command_parser.sv +++ b/hdl/command_parser.sv @@ -40,7 +40,12 @@ module command_parser state = state.first; end else begin if (echo_ready) echo_valid = 0; - if (command_ready) command_valid = 0; + if (command_ready && command_valid) begin + command_valid = 0; + command_address = 0; + command_write = 0; + command_data = 0; + end if (uart_ready && uart_valid) begin echo_valid = 1; echo_data = uart_data; @@ -69,6 +74,10 @@ module command_parser command_write = 1; command_data = 0; state = READ_DATA_1; + end else begin + command_address = 0; + command_write = 0; + command_data = 0; end end -- cgit v1.2.3