Skip to content

Catch a write that never reaches hardware – write()’s status and the mirror both say it did

write-from-scratch / mirror / best-practiceUVM · runs take about 2 minutes

With auto-prediction on (configured in the test), uvm_reg::write() calls do_predict() when the bus transaction completes, and do_predict() only checks the status was UVM_IS_OK. A write the hardware silently drops but completes cleanly (a stuck write-enable, say) is predicted as a success, and the mirror takes the value you meant to write.

RequirementsFor write_verifier::verify_write(uvm_reg r, uvm_reg_map map, bit [7:0] data)

  1. It writes through the register layer, like any frontdoor access.
  2. It confirms the write landed by reading the register back over the bus and comparing: not from write()’s status, and not from r.get_mirrored_value(), which already holds the intended value.
  3. A matching read-back increments confirmed_count; a mismatch increments dropped_count.

Right nowconfirmed_count=0, want 3. The stub checks nothing.

Done whenOf the four registers written in the test, register 2 has a stuck write-enable, so confirmed_count is 3 and dropped_count is 1. Checking the mirror instead gives confirmed_count=4, dropped_count=0.

Source on GitHub

write_updates_the_mirror_even_when_dropped.sv