uvm_rookie Posted May 18, 2012 Report Share Posted May 18, 2012 In my IPXACT file, I specify a register to be “read-onlyâ€. When I do a read, I do not expect the check function to be turned on, but it did. As a result, my test failed because of the mis-compare. The uvm_reg.svh has the following source code. How come the “if†statement is checking for “WO†rather than “RO†? How would I specify the “UVM_NO_CHECK†in the IPXACT file ? Should a "RO" register implies "UVM_NO_CHECK" ? Here's the "do_check" source code from uvm 1.1a // do_check function bit uvm_reg::do_check(input uvm_reg_data_t expected, input uvm_reg_data_t actual, uvm_reg_map map); uvm_reg_data_t dc = 0; foreach(m_fields) begin string acc = m_fields.get_access(map); acc = acc.substr(0, 1); if (m_fields.get_compare() == UVM_NO_CHECK || acc == "WO") begin dc |= ((1 << m_fields.get_n_bits())-1) << m_fields.get_lsb_pos(); end end Quote Link to comment Share on other sites More sharing options...
amitshere Posted May 21, 2012 Report Share Posted May 21, 2012 You can't have a UVM_NO_CHECK for a 'RO' field.. You would want to check that a WRITE to the field actually doesn't take effect.. This can be validated when you do a READ, Quote Link to comment Share on other sites More sharing options...
uvm_rookie Posted May 21, 2012 Author Report Share Posted May 21, 2012 You can't have a UVM_NO_CHECK for a 'RO' field.. You would want to check that a WRITE to the field actually doesn't take effect.. This can be validated when you do a READ, I was referring to a RO register, not individual field. Quote Link to comment Share on other sites More sharing options...
lisakb1963 Posted May 21, 2012 Report Share Posted May 21, 2012 set_compare function void set_compare( uvm_check_e check = UVM_CHECK ) Sets the compare policy during a mirror update. The field value is checked against its mirror only when both the check argument in uvm_reg_block::mirror, uvm_reg::mirror, or uvm_reg_field::mirror and the compare policy for the field is UVM_CHECK. The generator should have a vendor extension for this. But some don't so you manually have to set it: For a field: status_reg.fld0.set_compare(UVM_NO_CHECK); For a register: //this depends on the generator config_reg.data.set_compare(UVM_NO_CHECK); You have to extend the register file that contains these registers and create a derived class that call super.build(). Does the set_compare and then build(); Your generator may have an XML vendor extension for this. Quote Link to comment Share on other sites More sharing options...
janick Posted May 22, 2012 Report Share Posted May 22, 2012 I was referring to a RO register, not individual field. There is no such thing as a RO register. Even if the register contains only one field, it is still the field that is RO. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.