efabless / EF_UART

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

wrong parity calculation for data length rather than 9 #9

Closed M0stafaRady closed 6 months ago

M0stafaRady commented 10 months ago

The parity bit in odd and even cases are wrongly calculated because the length of data isn't considered in this calculation. As show in the code snippet, it calculate the parity of the whole d_in variable which is a 9 bits width and can have data larger than the sent ones. if the data length is less than 9.

https://github.com/efabless/EF_UART/blob/a99c27adaf30e3da114f6e19d30105970e83a741/hdl/rtl/EF_UART.v#L517-L535