Difference between register read() and mirror() method

In reply to o-hassan:

Hi,

  1. Mirror compares read value against the mirror value. However, with set_check_on_read(1) method, we can eliminate this difference.
  2. Read, reads DUT value and returns it to the caller. Mirror also reads DUT value but does not return the value to the caller. See below snippet,

//Returns the value
reg.read(.status(status), .value(value));

//Does not return the value. Compares read value 
//against mirror value when UVM_CHECK is there
reg.mirror(.status(status), .check(UVM_CHECK));