UVM register model coverage woes - part 2

So after I described my troubles with the UVM register model's coverage in my previous post, I revisited the issue in a slightly different context and discovered the current solution was rather lacking.

Register block coverage

In the previous example, coverage was taken for a value written via the register model. You access the data provided by the sample method, so you don't need any visibility into the register model you're covering.
But what happens if you want to cover a bunch of registers, say you want to sample the values of various registers by calling the sample_values method after configuring them. In this case you need to be able to access the register classes which you won't be able to do as you're in a wrapper class, and not in the register block class.

Two possible solutions

  • Define the sample function for the various covergroups to include values of multiple registers. In the sample_values function call the sample function with the required values.
  • When creating the wrapper class, pass the register block as an argument to the  wrapper class, allowing the coverpoints to access the registers defined in the register block.
That's it for now,

Tsvi

Comments

Popular posts from this blog

The crooked ways of UVM's register model's coverage methods

uvm_config_db vs uvm_resource_db, where they come from and what are they good for

Don't use null as a sequencer argument to uvm_reg_sequence