Given the following coverage data snippet from a Verilog coverage report, what is the coverage percentage for the state variable?
state: 8 bins, 6 hit
Coverage percentage = (bins hit / total bins) * 100
6 bins hit out of 8 total bins means coverage is (6/8)*100 = 75%. But 6/8 = 0.75 which is 75%. The correct option is 75%.
In Verilog code coverage, which type specifically checks that all combinations of input signals have been exercised?
Think about coverage that involves multiple signals combined.
Cross coverage tracks combinations of signals or variables to ensure all pairs or tuples of values occur. This checks input combinations.
Consider this Verilog coverage code snippet:
covergroup cg;
coverpoint signal {
bins low = {0};
bins high = {1};
}
endgroup
initial begin
cg cg_inst = new();
cg_inst.sample(signal);
endWhat error will this code produce when simulated?
Check if signal is declared anywhere.
The variable signal is used but not declared anywhere in the code, causing a runtime error.
Choose the correct Verilog code snippet that defines a covergroup named cg with a coverpoint on opcode signal.
Check the syntax for parameterized covergroups.
Option B correctly declares a covergroup with an input argument and a coverpoint on that input.
Given two coverpoints:
coverpoint a {
bins a_bins = {0,1};
}
coverpoint b {
bins b_bins = {0,1,2};
}
cross a, b;How many bins does the cross coverage create?
Multiply the number of bins in each coverpoint.
Cross coverage bins = number of bins in 'a' * number of bins in 'b' = 2 * 3 = 6.
