summaryrefslogtreecommitdiff
path: root/hdl/result_printer.sv
diff options
context:
space:
mode:
Diffstat (limited to 'hdl/result_printer.sv')
-rw-r--r--hdl/result_printer.sv14
1 files changed, 10 insertions, 4 deletions
diff --git a/hdl/result_printer.sv b/hdl/result_printer.sv
index 4f27d0e..6e1bd53 100644
--- a/hdl/result_printer.sv
+++ b/hdl/result_printer.sv
@@ -21,6 +21,7 @@ module result_printer
21 (* syn_encoding = "one-hot" *) enum int unsigned 21 (* syn_encoding = "one-hot" *) enum int unsigned
22 { HIGH_NIBBLE 22 { HIGH_NIBBLE
23 , LOW_NIBBLE 23 , LOW_NIBBLE
24 , WORD_SEPARATOR
24 } state; 25 } state;
25 26
26 always @(posedge clock) begin 27 always @(posedge clock) begin
@@ -50,12 +51,17 @@ module result_printer
50 case (state) 51 case (state)
51 HIGH_NIBBLE: echo_data = b[7:4]; 52 HIGH_NIBBLE: echo_data = b[7:4];
52 LOW_NIBBLE: echo_data = b[3:0]; 53 LOW_NIBBLE: echo_data = b[3:0];
54 WORD_SEPARATOR: echo_data = ":";
53 endcase 55 endcase
54 if (echo_data < 10) 56 if (state != WORD_SEPARATOR) begin
55 echo_data = echo_data + "0"; 57 if (echo_data < 10)
56 else 58 echo_data = echo_data + "0";
57 echo_data = echo_data + "A" - 10; 59 else
60 echo_data = echo_data + "A" - 10;
61 end
58 state = state.next; 62 state = state.next;
63 if (state == WORD_SEPARATOR && (byte_count != 1 || word_count == 1))
64 state = state.next;
59 if (state == state.first) begin 65 if (state == state.first) begin
60 byte_count = byte_count - 1; 66 byte_count = byte_count - 1;
61 if (byte_count == 0) begin 67 if (byte_count == 0) begin