Hi everyone,
I can’t seem to ‘dot’ down into a class to change an attribute value when that class was replaced using a factory override.
Questions:
Do I need to reference the override class with a different naming convention or something? Can I reference new attributes in a factory override class that are not in the original class before it was overwritten?
Details follow:
I have a UVM testbench that contains an agent with a ‘basic’ coverage class (uvm subscriber).
For my particular test environment, I reuse that agent and replace the coverage class with my project specific detailed coverage class.
I replace it using a factory override.
base_coverage::type_id::set_inst_override(my_detailed_coverage::get_type(),“uvm_test_top.vrp_env_inst.agent.basecoverage”);
Note that the new “my_detailed_coverage class” contains additional attributes that are not in the base_coverage class.
In my test, I’m trying to set one of those attributes in the factory override coverage class (my_detailed_coverage) by doing this:
env_inst.agent.basecoverage.my_new_attribute=1;
Here’s the error:
I get the error stating No field named ‘my_new_attribute’.
If I temporarily add the attribute to the base class, it seems to work but the point was to not clutter up the base class with my test specific items.
What am I misunderstanding?
Thanks,