summaryrefslogtreecommitdiff
path: root/hdl
diff options
context:
space:
mode:
authorJulian Blake Kongslie2022-02-20 15:26:43 -0800
committerJulian Blake Kongslie2022-02-20 15:26:43 -0800
commit5f396d028c6da87223d60079cbad4d1e3fc2d14f (patch)
treec3d01033241e854e87e0cc1f7ff032415f6c29f5 /hdl
parentCSn[0] is, in fact, a lie. We only have 23 bits of address space. (diff)
downloadsimple-memory-controller-5f396d028c6da87223d60079cbad4d1e3fc2d14f.tar.xz
Correctly reset command parser state after sending commands or invalid input.
Diffstat (limited to 'hdl')
-rw-r--r--hdl/command_parser.sv11
1 files changed, 10 insertions, 1 deletions
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
40 state = state.first; 40 state = state.first;
41 end else begin 41 end else begin
42 if (echo_ready) echo_valid = 0; 42 if (echo_ready) echo_valid = 0;
43 if (command_ready) command_valid = 0; 43 if (command_ready && command_valid) begin
44 command_valid = 0;
45 command_address = 0;
46 command_write = 0;
47 command_data = 0;
48 end
44 if (uart_ready && uart_valid) begin 49 if (uart_ready && uart_valid) begin
45 echo_valid = 1; 50 echo_valid = 1;
46 echo_data = uart_data; 51 echo_data = uart_data;
@@ -69,6 +74,10 @@ module command_parser
69 command_write = 1; 74 command_write = 1;
70 command_data = 0; 75 command_data = 0;
71 state = READ_DATA_1; 76 state = READ_DATA_1;
77 end else begin
78 command_address = 0;
79 command_write = 0;
80 command_data = 0;
72 end 81 end
73 end 82 end
74 83