Jump to content

Recommended Posts

Posted
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
Posted
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
Posted

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

Posted

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 

Posted

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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...