Complete the code to declare a coverage variable for toggling a signal.
covergroup cg_[1]; option.per_instance = 1; coverpoint signal_toggle; endgroup
The coverage group name should be descriptive. toggle_cov clearly indicates coverage for toggling.
Complete the code to define a coverpoint for a 2-bit signal named 'state'.
coverpoint [1] { bins idle = {2'b00}; bins active = {2'b01, 2'b10}; bins error = {2'b11}; }
The coverpoint must match the signal name. Here, state is the correct signal.
Fix the error in the coverage bin definition for signal 'cmd' to cover values 0 to 3.
coverpoint cmd {
bins low_values = [1];
}In SystemVerilog coverage bins, ranges are defined with square brackets like [0:3].
Fill both blanks to create a cross coverage between signals 'addr' and 'data'.
cross [1], [2];
Cross coverage is defined between two coverpoints. Here, addr and data are the signals to cross.
Fill all three blanks to define a covergroup with a coverpoint and a cross, then instantiate it.
covergroup [1]; coverpoint [2]; cross [2], [3]; endgroup [1] cg_inst = new();
The covergroup name is cg_example. The coverpoint and cross use signal_a and signal_b. Finally, the instance is created with the covergroup name.
