I have a module named sf which has a signal named max_payload_size. The module sf is instantiated 256 times. How can i find the functional coverage of signal “max_payload_size” for all 256 instances. I have a uvm testbench for it. The code for finding the functional coverage is written in a class extended from uvm_subscriber.
You’re missing a lot of details. You need to explain what condition would provide 100% coverage. When does this signal need to be sampled? Are you looking for coverage for each instance individually or collectively?
The brute force approach, based on the information you’ve provided, involves creating an array of 256 monitors equipped with analysis ports. These monitors will connect to 256 instances of your coverage collector. Each monitor can probe your modules’ signals using one of the methods outlined in this paper: Updated Example Code from DVCon Paper: The Missing Link: The Testbench to DUT Connection.
By default, the coverage you defined in your collector is collective. However, you can change this to individual by setting the option.per_instance=1 when declaring your covergroup.