In reply to dave_59:
Hi Dave,
I’m relative “new” in using of RAL and some definitions related to its access methods are not clear for me. For e.g. mirror() documentation (in UVM 1.1d version)
The code of this method, is:
task uvm_reg::mirror(output uvm_status_e status,
input uvm_check_e check = UVM_NO_CHECK,
input uvm_path_e path = UVM_DEFAULT_PATH,
input uvm_reg_map map = null,
input uvm_sequence_base parent = null,
input int prior = -1,
input uvm_object extension = null,
input string fname = “”,
input int lineno = 0);
uvm_reg_data_t v;
uvm_reg_data_t exp;
uvm_reg_backdoor bkdr = get_backdoor();
XatomicX(1);
m_fname = fname;
m_lineno = lineno;
if (path == UVM_DEFAULT_PATH)
path = m_parent.get_default_path();
if (path == UVM_BACKDOOR && (bkdr != null || has_hdl_path()))
map = uvm_reg_map::backdoor();
else
map = get_local_map(map, “read()”);
if (map == null)
return;
// **Remember what we think the value is before it gets updated
** if (check == UVM_CHECK)
exp = get_mirrored_value();
XreadX(status, v, path, map, parent, prior, extension, fname, lineno);
if (status == UVM_NOT_OK) begin
XatomicX(0);
return;
end
if (check == UVM_CHECK) void’(do_check(exp, v, map));
XatomicX(0);
endtask: mirror
I have few questions here:
-
According to "Remember what we think the value is before it gets updated
", and, if we are using (as it is recommended)set_auto_predict(0)
then, a mirror() action will generate that UVM_ERROR from do_check() if there was a change in ACTUAL (DUT) register that we intended to read, right?
-
What will be the (best) solution to avoid this error that comes when a mirror() is performed? a) set_auto_predict(1); b) set_compare(UVM_NO_CHECK); c) call a predict() before a mirror()?
-
what we should do if the register of interest has volatile fields, but still we need to perform a mirror() with check.
Thank you in advance!
Alexandra