efabless / EF_UART

Universal Asynchronous Receiver/Transmitter (UART) with FIFOs Soft IP
Apache License 2.0
3 stars 2 forks source link

APB wrapper misses the first element in the RX fifo #7

Closed M0stafaRady closed 6 months ago

M0stafaRady commented 10 months ago

The current APB wrapper exhibits an issue with the reading process from the RX FIFO. It incorrectly accesses the wrong FIFO element. For instance, instead of fetching the first element as intended, it retrieves the second one. This error occurs as the FIFO's second element is popped during the address phase, leading to the data phase capturing this second element rather than the intended first one, as demonstrated in the provided code snippet. https://github.com/efabless/EF_UART/blob/018334c67b7d2067ea16bf2038ca4507af94a072/hdl/rtl/bus_wrappers/EF_UART_APB.v#L244-L246

I suggest this can be fixed by either buffer the rdata value in the address phase or use apb_re_delayed instead of apb_re