mszabo Posted August 5, 2011 Report Share Posted August 5, 2011 So in my test I have a whole bunch of registers and would like to selectively enable coverage on some of the registers. This seems like it should be an easy task, I just replace my uvm_reg::include_coverage("*",...) with uvm_reg::include_coverage("*reg_R*",...) Now all registers containing the name reg_R will have coverage enabled right? However it doesn't appear to work that way. Digging in to both the register example I see: Example Register Model New Function (from register/coverage/regmodel..sv) : function new(string name = "reg_R"); super.new(name, 8, build_coverage(UVM_CVR_REG_BITS + UVM_CVR_FIELD_VALS)); if (has_coverage(UVM_CVR_REG_BITS)) cg_bits = new(); if (has_coverage(UVM_CVR_FIELD_VALS)) cg_vals = new(); endfunction: new The call to super.new() takes an argument has_coverage which will make the decision whether or not to build coverage. So this calls build_coverage() which checks the name (using get_full_name()) against a scope database and determines if coverage should be included. However at this point super.new() has not been called so the name will not include in the above case "reg_R". I suppose the user could call add_coverage() later on after the register model is built, but in the example the only place the cover structures are new'ed is in the new() function. So just changing the has_coverage() won't help at that point. Am I missing something obvious here or is there no good way of enabling coverage on a specific register without manually editing the register model source. Quote Link to comment Share on other sites More sharing options...
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.