IMPORTANT NOTICE: Please be advised that the Verification Academy Forums will be offline for scheduled maintenance on Sunday, March 23rd at 4:00 US/Pacific.
Hello All,
I would like to know if there is way to declare coverpoint to dynamic array , Its evident from below mentioned link as of how to declare coverpoint to static array, but I would like to know the same for dynamic array.
It depends. Do you know the size of the dynamic array at the time the covergroup needs to be constructed? If yes, then you can make a dynamic array of covergroups and construct it to be the same time. If you do not know, then you need to explain more clearly what you are trying to cover, i.e. what it takes to get 100% coverage.
You need to explain what “doesn’t work” means. Are you getting different coverage result from what you expect? How is it different?
One thing that may missing is you need
option.per_instance = 1; inside the
covergroup. Otherwise the coverage for all the instances gets merged together by default.
So, Currently the simulation has compilation error since i have added this portion of the code.
It is not happy about This particular line
“my_cg m_my_cg1;” and states it as “Syntactically this identifier appears to begin a datatype but it does not refer to a visible datatype in the current scope.”
Thus please let me explain the code structure:
class my_fcov extends uvm_subscriber #(my_sqi);
…
covergroup my_cg with function sample(bit cp_s);
coverpoint cp_s;
endgroup
my_cg m_my_cg1;
extern function new(string name, uvm_component parent);
extern virtual function void write(my_sqi t);
…
endclass