-
Notifications
You must be signed in to change notification settings - Fork 932
Description
Description
In the current flash_phy_rd implementation, the data_erased signal is used to bypass the descrambling logic when an unprogrammed (erased) word is read.
opentitan/hw/top_earlgrey/ip_autogen/flash_ctrl/rtl/flash_phy_rd.sv
Lines 494 to 495 in e86869f
| // descramble is only required if the location is scramble enabled AND it is not erased. | |
| assign descram = rd_done & rd_attrs.descramble & ~data_erased; |
A single bit flip within an erased word should be correctable by the reliability ECC. However, because data_erased is calculated using the raw, uncorrected data (data_i), a single flip causes data_erased to be de-asserted.
opentitan/hw/top_earlgrey/ip_autogen/flash_ctrl/rtl/flash_phy_rd.sv
Lines 431 to 433 in e86869f
| // When all bits are 1, the data has been erased | |
| // This check is only valid when read data returns. | |
| assign data_erased = rd_done & (data_i == {FullDataWidth{1'b1}}); |
(Note:
data_i = content + ICV + ECC)
The hardware then incorrectly attempts to descramble the word. This results in corrupted data and a subsequent integrity check failure, effectively making the single-bit error uncorrectable.
CC: @vogelpi, @moidx, @johannheyszl