Vous êtes sur la page 1sur 3

Functional Coverage

28. What encapsulates the specification of a coverage model


a) Coverpoint
b) Covergroup
c) Interface
d) Bins

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:bug: instance of cg is not created...coverage 37.50%


30. Which construct specifies an optional condition that disables coverage for that cover
point?

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

33. How many bins are created below?


bit [0:2] y;
covergroup cg;
cp_y : coverpoint y {
bins a[] = {0,1};
bins b[] = {2,3};
bins c[] = {4,5};
bins d = default;
}
endgroup

34. How many bins are created below :


int y;
covergroup cg;
cp_y : coverpoint y {
bins a[4] = {[0:7]};
} endgroup

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.

37. List all the bins for the following code :


bit [0:1] y;
bit [0:1] z;
covergroup cg;
cp_y : coverpoint y ;
cross_yz : cross cp_y, z ;
endgroup

38. Describe the difference between Code Coverage and Functional Coverage Which is
more important and Why we need them.

39. The key aspect of functional coverage is


a) It is user defined
b) Automatically extracted by the design code
c) Expression and statement coverage
d) The end result is a measure of how much your tests exercise the design code

40. You get a good coverage for a given design with


a) Low code coverage and high functional coverage
b) High functional coverage and high code coverage
c) Low functional coverage and high code coverage
d) Low functional coverage and low code coverage

Vous aimerez peut-être aussi