Difference between register read() and mirror() method

Hi,
I would like to know the difference between register read() method with set_check_on_read(1) and register mirror() method.

Thanks,
Omkar

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));

In reply to o-hassan:

Hi,
I would like to know the difference between register read() method with set_check_on_read(1) and register mirror() method.
Thanks,
Omkar

Hey,

The read() with set_check_on_read(1) will Compare the read value with the current mirror value only when the auto-prediction mode is ON.

Thus in explicit prediction (auto-prediction mode OFF) we have to use mirror() to compare the read value with the current mirror value.

Thank you,

Regards,
Muneeb Ulla Shariff

1 Like