I have a question about the read() function of register abstraction layer (RAL) of UVM.
From my understanding, when a read() is performed, BOTH the mirror and desired registers are updated by the actual DUT value. I understand why the mirrored value is updated, but why would the desired register be updated?
I think this causes an issue: If I have a case where a DUT bug causes an incorrect register value to be returned on a read. The read mismatches my desired register value and an error is generated by the testbench as expected. However, if I do a second read, no error is detected because the desired register model was updated during the previous read and now matches the DUT value. It also seems like I could even have a race condition where the desired is update before my comparison is done and not see the mismatch.
Can you provide a brief rationale for why the desired register is updated to the dut value? I would expect only the mirrored value to be updated.