|
|
@@ -130,6 +130,8 @@ module host_uart_endpoint #(
|
|
|
.data_done(rx_crc_data_done), .crc(rx_crc_value)
|
|
|
);
|
|
|
|
|
|
+ wire parser_hunting;
|
|
|
+
|
|
|
frame_rx #(
|
|
|
.MAX_PAYLOAD(MAX_PAYLOAD),
|
|
|
.INTER_BYTE_TIMEOUT_CYCLES(INTER_BYTE_TIMEOUT_CYCLES),
|
|
|
@@ -148,7 +150,8 @@ module host_uart_endpoint #(
|
|
|
.crc_start_o(rx_crc_start), .crc_data_valid_o(rx_crc_data_valid),
|
|
|
.crc_data_o(rx_crc_data),
|
|
|
.crc_busy_i(rx_crc_busy), .crc_data_done_i(rx_crc_data_done),
|
|
|
- .crc_value_i(rx_crc_value)
|
|
|
+ .crc_value_i(rx_crc_value),
|
|
|
+ .hunting_o(parser_hunting)
|
|
|
);
|
|
|
|
|
|
// The parser holds its frame on frame_valid until the endpoint
|
|
|
@@ -174,7 +177,7 @@ module host_uart_endpoint #(
|
|
|
// (seen != hunting), so ownership survives the idle line between
|
|
|
// the claim edge and the first byte of the frame.
|
|
|
reg parser_busy_seen;
|
|
|
- wire parser_idle = (u_frame_rx.state == 4'd0) && !parser_frame_valid &&
|
|
|
+ wire parser_idle = parser_hunting && !parser_frame_valid &&
|
|
|
parser_busy_seen;
|
|
|
|
|
|
always @(posedge clk or negedge rst_n) begin
|
|
|
@@ -197,7 +200,7 @@ module host_uart_endpoint #(
|
|
|
ttl_rx_sync1 <= ttl_rx_sync0;
|
|
|
rs232_rx_prev <= rs232_rx_sync1;
|
|
|
ttl_rx_prev <= ttl_rx_sync1;
|
|
|
- if (u_frame_rx.state != 4'd0)
|
|
|
+ if (!parser_hunting)
|
|
|
parser_busy_seen <= 1'b1;
|
|
|
else if (rx_owner == OWNER_NONE)
|
|
|
parser_busy_seen <= 1'b0;
|