|
|
@@ -21,15 +21,25 @@ module uart_rx_byte #(
|
|
|
localparam [1:0] ST_DATA = 2'd2;
|
|
|
localparam [1:0] ST_STOP = 2'd3;
|
|
|
|
|
|
- (* async_reg = "true" *) reg [1:0] rx_sync_pipe;
|
|
|
+ (* keep = "true" *) reg [1:0] rx_sync_pipe;
|
|
|
reg [1:0] state;
|
|
|
reg [COUNTER_BITS-1:0] bit_counter;
|
|
|
reg [2:0] bit_index;
|
|
|
reg [7:0] data_reg;
|
|
|
|
|
|
+ // Keep the asynchronous input synchronizer on an ordinary, explicitly
|
|
|
+ // clocked two-flop path. TD maps async_reg plus async-reset metadata to an
|
|
|
+ // unclocked first-stage primitive on EF2; synchronous reset avoids that
|
|
|
+ // unsafe mapping while preserving two full settling clocks.
|
|
|
+ always @(posedge clk) begin
|
|
|
+ if (!rst_n)
|
|
|
+ rx_sync_pipe <= 2'b11;
|
|
|
+ else
|
|
|
+ rx_sync_pipe <= {rx_sync_pipe[0], rx_i};
|
|
|
+ end
|
|
|
+
|
|
|
always @(posedge clk or negedge rst_n) begin
|
|
|
if (!rst_n) begin
|
|
|
- rx_sync_pipe <= 2'b11;
|
|
|
state <= ST_IDLE;
|
|
|
bit_counter <= {COUNTER_BITS{1'b0}};
|
|
|
bit_index <= 3'd0;
|
|
|
@@ -38,7 +48,6 @@ module uart_rx_byte #(
|
|
|
byte_data <= 8'd0;
|
|
|
framing_error <= 1'b0;
|
|
|
end else begin
|
|
|
- rx_sync_pipe <= {rx_sync_pipe[0], rx_i};
|
|
|
byte_valid <= 1'b0;
|
|
|
framing_error <= 1'b0;
|
|
|
|