opentitan
opentitan copied to clipboard
[hw,dma,rtl] Only set error code when entering the error state
Previously, the error code is written when entering the error state AND while being in there. Since the error code value is only availble in the transition into the error state, and further update overwrites the error code again with zero.
This change ensures that the error code only gets update in the transition into the error state, where the correct value is available