|
|
|
|
|
|
|
|
|
|
|
|
Coverage Options
|
|
|
Like in Vera, Systemverilog provides ways to control the behavior of the covergroup, coverpoint and cross. One of the most common usage of these coverage options is setting weightage of a covergroup. In a advanced testbench there could be many covergroups, and from the verification point of view some covergroups have high priority, and they migh be is less number, on other there hand there could be covergroups which are of low priority, and they are in large number. There is no way simulator is going to know this priority information, so Systemverilog provides options to communicate this to simulator. This way, even if don't have good coverage on low priority covegroup, it won't effect overall coverage in big way. |
|
|
|
|
|
There are two types of options |
|
|
|
|
|
- covergroup instance specific options
- All instance specific options
|
|
|
|
|
|
Below table shows all the options available in systemverilog to control behaviour of coverage group |
|
|
|
|
|
Options Name
|
Default
|
Description
|
weight=number
|
1
|
If set at the covergroup syntactic level, it specifies the weight of this covergroup instance for computing the overall instance coverage of the simulation. If set at the coverpoint (or cross) syntactic level, it specifies the weight of a coverpoint (or cross) for computing the instance coverage of the enclosing covergroup.
|
goal=number
|
90
|
Specifies the target goal for a covergroup instance or for a coverpoint or a cross of an instance.
|
name=string
|
unique name
|
Specifies a name for the covergroup instance.
|
comment=string
|
|
A comment that appears with a covergroup instance or with a coverpoint or cross of the covergroup instance
|
at_least=number
|
1
|
Minimum number of times a bin needs to hit before it is declared as hit
|
detect_overlap=boolean
|
0
|
When true, a warning is issued if there is an overlap between the range list (or transition list) of two bins of a coverpoint.
|
auto_bin_max=number
|
64
|
Maximum number of automatically created bins when no bins are explicitly defined for a coverpoint.
|
cross_num_print_missing = number
|
0
|
Number of missing (not covered) cross product bins that must be saved to the coverage database and printed in the coverage report.
|
per_instance=boolean
|
0
|
Each instance contributes to the overall coverage information for the covergroup type. When true, coverage information for this covergroup instance is tracked as well.
|
|
|
|
|
|
|
Out of above, below list of options could improve quality of coverag convergence. |
|
|
|
|
|
- weight=number
- goal=number
- at_least=number
- per_instance=boolean
|
|
|
|
|
|
Note : Refer to LRM if you need more information on this |
|
|
|
|
|
|
|
|
|
|
|
Example : Coverage options
|
|
|
|
|
|
1 module test();
2
3 logic [2:0] addr;
4 wire [2:0] addr2;
5 reg ce;
6
7 assign addr2 = addr + 1;
8
9 covergroup address_cov () @ (posedge ce);
10 option.name = "address_cov";
11 option.comment = "This is cool";
12 option.per_instance = 1;
13 option.goal = 100;
14 option.weight = 50;
15 ADDRESS : coverpoint addr {
16 option.auto_bin_max = 100;
17 }
18 ADDRESS2 : coverpoint addr2 {
19 option.auto_bin_max = 10;
20 }
21 endgroup
22
23 address_cov my_cov = new();
24
25 initial begin
26 my_cov.ADDRESS.option.at_least = 1;
27 my_cov.ADDRESS2.option.at_least = 2;
28 ce <= 0;
29 $monitor("ce %b addr 8'h%x addr2 8'h%x",ce,addr,addr2);
30 repeat (10) begin
31 ce <= 1;
32 addr <= $urandom_range(0,7);
33 #10 ;
34 ce <= 0;
35 #10 ;
36 end
37 end
38
39 endmodule
You could download file coverage_options.sv here
|
|
|
|
|
|
Simulation : Coverage options
|
|
|
|
|
|
ce 1 addr 8'h6 addr2 8'h7
ce 0 addr 8'h6 addr2 8'h7
ce 1 addr 8'h4 addr2 8'h5
ce 0 addr 8'h4 addr2 8'h5
ce 1 addr 8'h5 addr2 8'h6
ce 0 addr 8'h5 addr2 8'h6
ce 1 addr 8'h2 addr2 8'h3
ce 0 addr 8'h2 addr2 8'h3
ce 1 addr 8'h3 addr2 8'h4
ce 0 addr 8'h3 addr2 8'h4
ce 1 addr 8'h7 addr2 8'h0
ce 0 addr 8'h7 addr2 8'h0
ce 1 addr 8'h0 addr2 8'h1
ce 0 addr 8'h0 addr2 8'h1
ce 1 addr 8'h7 addr2 8'h0
ce 0 addr 8'h7 addr2 8'h0
ce 1 addr 8'h6 addr2 8'h7
ce 0 addr 8'h6 addr2 8'h7
ce 1 addr 8'h3 addr2 8'h4
ce 0 addr 8'h3 addr2 8'h4
|
|
|
|
|
|
Report : Coverage options
|
|
|
|
|
|
===========================================================
Group : test::address_cov
===========================================================
SCORE INSTANCES WEIGHT GOAL
87.50 62.50 1 100
1 Instances:
SCORE WEIGHT GOAL NAME
62.50 50 100 address_cov
-----------------------------------------------------------
Summary for Group test::address_cov
CATEGORY EXPECTED UNCOVERED COVERED PERCENT
Variables 16 2 14 87.50
Variables for Group test::address_cov
VARIABLE EXPECTED UNCOVERED COVERED PERCENT GOAL WEIGHT
ADDRESS 8 1 7 87.50 100 1
ADDRESS2 8 1 7 87.50 100 1
-----------------------------------------------------------
Summary for Variable ADDRESS
CATEGORY EXPECTED UNCOVERED COVERED PERCENT
Automatically Generated Bins 8 1 7 87.50
Automatically Generated Bins for ADDRESS
Uncovered bins
NAME COUNT AT LEAST NUMBER
[auto[1]] 0 1 1
Covered bins
NAME COUNT AT LEAST
auto[0] 1 1
auto[2] 1 1
auto[3] 2 1
auto[4] 1 1
auto[5] 1 1
auto[6] 2 1
auto[7] 2 1
-----------------------------------------------------------
Summary for Variable ADDRESS2
CATEGORY EXPECTED UNCOVERED COVERED PERCENT
Automatically Generated Bins 8 1 7 87.50
Automatically Generated Bins for ADDRESS2
Uncovered bins
NAME COUNT AT LEAST NUMBER
[auto[2]] 0 1 1
Covered bins
NAME COUNT AT LEAST
auto[0] 2 1
auto[1] 1 1
auto[3] 1 1
auto[4] 2 1
auto[5] 1 1
auto[6] 1 1
auto[7] 2 1
===========================================================
Group Instance : address_cov
===========================================================
Comment: This is cool
SCORE WEIGHT GOAL
62.50 50 100
Group:
SCORE INSTANCES WEIGHT GOAL NAME
87.50 62.50 1 100 test::address_cov
-----------------------------------------------------------
Summary for Group Instance address_cov
CATEGORY EXPECTED UNCOVERED COVERED PERCENT
Variables 16 6 10 62.50
Variables for Group Instance address_cov
VARIABLE EXPECTED UNCOVERED COVERED PERCENT GOAL WEIGHT
ADDRESS 8 1 7 87.50 100 1
ADDRESS2 8 5 3 37.50 100 1
-----------------------------------------------------------
Summary for Variable ADDRESS
CATEGORY EXPECTED UNCOVERED COVERED PERCENT
Automatically Generated Bins 8 1 7 87.50
Automatically Generated Bins for ADDRESS
Uncovered bins
NAME COUNT AT LEAST NUMBER
[auto[1]] 0 1 1
Covered bins
NAME COUNT AT LEAST
auto[0] 1 1
auto[2] 1 1
auto[3] 2 1
auto[4] 1 1
auto[5] 1 1
auto[6] 2 1
auto[7] 2 1
-----------------------------------------------------------
Summary for Variable ADDRESS2
CATEGORY EXPECTED UNCOVERED COVERED PERCENT
Automatically Generated Bins 8 5 3 37.50
Automatically Generated Bins for ADDRESS2
Uncovered bins
NAME COUNT AT LEAST NUMBER
[auto[2]] 0 2 1
auto[1] 1 2 1
auto[3] 1 2 1
auto[5] 1 2 1
auto[6] 1 2 1
Covered bins
NAME COUNT AT LEAST
auto[0] 2 2
auto[4] 2 2
auto[7] 2 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Copyright © 1998-2014 |
Deepak Kumar Tala - All rights reserved |
Do you have any Comment? mail me at:deepak@asic-world.com
|
|