From 848abf29b5744364ede9c0cfde395237907fffd5 Mon Sep 17 00:00:00 2001 From: Ross Thompson Date: Sun, 22 May 2022 10:55:28 -0500 Subject: [PATCH] Fixed receive fifo ITNR bug. --- pipelined/src/uncore/uartPC16550D.sv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pipelined/src/uncore/uartPC16550D.sv b/pipelined/src/uncore/uartPC16550D.sv index c374c909b..ca9481fa3 100644 --- a/pipelined/src/uncore/uartPC16550D.sv +++ b/pipelined/src/uncore/uartPC16550D.sv @@ -326,8 +326,8 @@ module uartPC16550D( rxdataready <= #1 1; end else if (~MEMRb & A == 3'b000 & ~DLAB) begin // reading RBR updates ready / pops fifo if (fifoenabled) begin - if (rxfifotail+1 < rxfifohead) rxfifotail <= #1 rxfifotail + 1; - if (rxfifohead == rxfifotail +1) rxdataready <= #1 0; + if (~rxfifoempty) rxfifotail <= #1 rxfifotail + 1; + if (rxfifoempty) rxdataready <= #1 0; end else begin rxdataready <= #1 0; RXBR <= #1 {1'b0, RXBR[9:0]}; // Ben 31 March 2022: I added this so that rxoverrunerr permanently goes away upon reading RBR (when not in FIFO mode)