I noticed this same issue was well when using the regassist tool.
First, it should be known that the ‘set_coverage(uvm_reg_cvr_t is_on)’ method must be called in order to turn of coverage for a given register or parent register block (e.g. reg model). This is in addition to the uvm_reg::include_coverage(“*”, UVM_CVR_FIELD_VALS) call.
If you only enable coverage for fields, and do not enable coverage for a ‘block’, then the regassist tool does not ever call the set_coverage function in the build function generated for the register model.
You can manually call the set_coverage(UVM_CVR_FIELD_VALS) (for example) on the reg model after the build function is called, and this should enable the coverage type generated by the regassist tool for the register objects.
Furthermore, the sample_values function created by the register assistant tool is meant to be invoked by a user (see UVM user guide - sample vs sample_values for uvm_reg*). If a parent uvm_reg_block containing registers has its ‘sample_values’ function called, then the default functionality is for it to iterate over each register and call its corresponding ‘sample_values’ function. For this reason, I had to put a handle to the register model in the reg adapter, and directly call reg_model.sample_values() in the reg2bus and bus2reg functions. This is a bit of a brute force approach since all registers will be sampled and not the specific register being accessed, but it works.
Finally, if you enable coverage for a ‘block’ using the regassist tool, then the set_coverage function is called in the build function of the generated reg model, BUT set_coverage is called ONLY for UVM_CVR_ADDR_MAP, and this will indirectly turn off the other coverage types (e.g. the UVM_CVR_FIELD_VALS for the register fields).
The work around for this is to recall the set coverage function on the register model after the build function is called to enable the desired coverage types:
reg_model.set_coverage(UVM_CVR_FIELD_VALS|UVM_CVR_ADDR_MAP);
This finally got everything to work for me. I’ve sent the issue to Mentor Graphics, and hopefully this message helps others.