Functional Coverage
Functional Coverage
29. In the below code, there is a bug. Fix it and what will be the coverage(%) and why?
module top;
bit [0:2] p;
bit [0:2] q[$]= '{3,5,6};
covergroup cg;
cp : coverpoint p;
endgroup
initial
foreach(q[i])
begin
p = q[i];
cg_inst.sample();
end
endmodule
Ans – iff
31. In the below code, How many bins are created? And show the distribution of values
for these bins
bit [0:2] y;
covergroup cg;
cp_y : coverpoint y
{ option.auto_bin_max = 4 ; }
endgroup
32. Not all values are interesting or relevant in a cover point, so when the user knows the
exact values he is going to cover, he will use
a) Explicit bins
b) Implicit bins
c) Cross bins
d) All of the above
35. How many bins are created in the below example and what is the coverage. Explain
module top;
bit [0:2] y;
bit [0:2] p[$]= '{1,6,3,7,3,4,3,5};
event ev;
covergroup cg @(ev);
cp_y : coverpoint y {
ignore_bins ig = {1,2,3,4,5};}
endgroup
cg cg_inst = new();
initial
foreach(p[i])
begin
y = p[i];
-> ev;
end
endmodule
36. What is the difference between ignore_bins and illegal_bins.
38. Describe the difference between Code Coverage and Functional Coverage Which is
more important and Why we need them.