ejo Posted November 25, 2013 Report Posted November 25, 2013 Is it a requirement that unused bits are to be modeled for uvm reg to work? For example, if there is a 24 bit field in a 32 bit reg, can the 8 unused bits be left out of the model or is it necessary to add fields to cover the unused 8 bits in the register? Erling Quote
uwes Posted November 25, 2013 Report Posted November 25, 2013 just leave them out. uvmreg only considers modeled fields. /uwe Quote
ejo Posted November 25, 2013 Author Report Posted November 25, 2013 This is what I was hoping for. However, I get miscompares when there are unused bits in a reg. Problem is do_check of uvm_reg does not exclude unused bits from the compare, and a mismatch is reported. It then goes on looping over the fields in what looks like an attempt to report the mismatching fields, but only fields that are not to be checked are actually checked. And even if the correct fields had been checked, there would be nothing to report since the mismatch isn't in the fields but in the unused bits. Also, not finding any mismatch in the fields does not have do_check reconsider the result, it still returns failure. Not sure how to deal with this. Programmatically adding dummy fields for everything unused should work, but with many unused fields there will be a waste of resources. It seems overriding do_check with something functional is a better approach, but the compare will be slower since there is no cached mirror to compare the actual value with, and another iteration over the fields will be necessary. Erling Quote
uwes Posted December 2, 2013 Report Posted December 2, 2013 hi, i just looked briefly at the implementation of do_check() but it looks ok. can you please supply the register definition and the expected/actual value? /uwe Quote
ejo Posted December 2, 2013 Author Report Posted December 2, 2013 hi, i just looked briefly at the implementation of do_check() but it looks ok. can you please supply the register definition and the expected/actual value? /uwe do_check() (when called from write() of uvm_predictor) is passed get_mirrored_value() as the expected value and reg_item.value[0] as the actual value, ie the expected value will be the the combined mirror values of the fields, while the actual value will be combined read-back of the bus transactions covering the register. The unused bits in the expected value will therefore be cleared, while the unused bits in the actual value will be whatever dead pattern the dut returns for unused bits. That can't match in the general case. Or have I missed something obvious? By the way, the loop in do_check() reporting the mismatching fields seems to have been fixed in 1.1d (ie it checks fields to be checked, not vice versa as is the case in 1.1b, which is what I am using). Still, all fields matching does not have do_check() undo the decision to fail the check. Erling Quote
uwes Posted December 3, 2013 Report Posted December 3, 2013 hi, i see the issue. do_check() is prepared a "no-compare" mask but only marks the UVM_NO_CHECK and WO* areas. non-modelled are not marked as "no-compare" since they are no fields. im going to file a mantis /uwe Quote
uwes Posted December 3, 2013 Report Posted December 3, 2013 hi, have a look at http://sourceforge.net/p/uvm/code/ci/852d197932c928f526c44779e16c68bcc2854e73/ this should ignore unmodelled fields. let me know if this works for you /uwe Quote
ejo Posted December 3, 2013 Author Report Posted December 3, 2013 uwe, I have tested your modified do_check() (as an override for the 1.1b version), and it works perfectly. Thank you. Erling Quote
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.